annotate roundup/anypy/dbm_.py @ 4547:d9d7319afffa

Add config-option "nosy" to messages_to_author setting in [nosy] section... ...of config: This will send a message to the author only in the case where the author is on the nosy-list (either added earlier or via the add_author setting). Current config-options for this setting will send / not send to author without considering the nosy list. [[Posted on behalf of Dr. Schlatterbeck during the git conversion.]] committer: Eric S. Raymond <esr@thyrsus.com>
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Wed, 19 Oct 2011 11:32:20 -0400
parents 0d9369d35483
children d5da643b3d25
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4360
661466ba19cd add missing file
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
1 # In Python 3 the "anydbm" module was renamed to be "dbm" which is now a
661466ba19cd add missing file
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
2 # package containing the various implementations. The "wichdb" module's
661466ba19cd add missing file
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
3 # whichdb() function was moved to the new "dbm" module.
661466ba19cd add missing file
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
4
4383
0d9369d35483 fix up some pre-Python2.6 compatibility issues in the *dbm interface
Richard Jones <richard@users.sourceforge.net>
parents: 4360
diff changeset
5 import sys
0d9369d35483 fix up some pre-Python2.6 compatibility issues in the *dbm interface
Richard Jones <richard@users.sourceforge.net>
parents: 4360
diff changeset
6 if sys.version_info[:2] < (2, 6):
0d9369d35483 fix up some pre-Python2.6 compatibility issues in the *dbm interface
Richard Jones <richard@users.sourceforge.net>
parents: 4360
diff changeset
7 def key_in(db, key):
0d9369d35483 fix up some pre-Python2.6 compatibility issues in the *dbm interface
Richard Jones <richard@users.sourceforge.net>
parents: 4360
diff changeset
8 return db.has_key(key)
0d9369d35483 fix up some pre-Python2.6 compatibility issues in the *dbm interface
Richard Jones <richard@users.sourceforge.net>
parents: 4360
diff changeset
9 else:
0d9369d35483 fix up some pre-Python2.6 compatibility issues in the *dbm interface
Richard Jones <richard@users.sourceforge.net>
parents: 4360
diff changeset
10 def key_in(db, key):
0d9369d35483 fix up some pre-Python2.6 compatibility issues in the *dbm interface
Richard Jones <richard@users.sourceforge.net>
parents: 4360
diff changeset
11 return key in db
0d9369d35483 fix up some pre-Python2.6 compatibility issues in the *dbm interface
Richard Jones <richard@users.sourceforge.net>
parents: 4360
diff changeset
12
4360
661466ba19cd add missing file
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
13 try:
661466ba19cd add missing file
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
14 # old school first because <3 had a "dbm" module too...
661466ba19cd add missing file
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
15 import anydbm
661466ba19cd add missing file
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
16 from whichdb import whichdb
661466ba19cd add missing file
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
17 except ImportError:
661466ba19cd add missing file
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
18 # python 3+
661466ba19cd add missing file
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
19 import dbm as anydbm
661466ba19cd add missing file
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
20 whichdb = anydbm.whichdb

Roundup Issue Tracker: http://roundup-tracker.org/