Skip to content

Commit e1890a2

Browse files
author
Richard Jones
committed
Ran it through pychecker, made fixes
1 parent ce5cb2d commit e1890a2

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

roundup/hyperdb.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: hyperdb.py,v 1.57 2002-02-20 05:23:24 richard Exp $
18+
# $Id: hyperdb.py,v 1.58 2002-02-27 03:23:16 richard Exp $
1919

2020
__doc__ = """
2121
Hyperdatabase implementation, especially field types.
2222
"""
2323

2424
# standard python modules
25-
import cPickle, re, string, weakref, os
25+
import re, string, weakref, os
2626

2727
# roundup modules
2828
import date, password
@@ -490,7 +490,6 @@ class or a KeyError is raised.
490490
if node.has_key(self.db.RETIRED_FLAG):
491491
raise IndexError
492492
num_re = re.compile('^\d+$')
493-
set = {}
494493
for key, value in propvalues.items():
495494
# check to make sure we're not duplicating an existing key
496495
if key == self.key and node[key] != value:
@@ -1075,14 +1074,19 @@ def retire(self):
10751074
return self.cl.retire(self.nodeid)
10761075

10771076

1078-
def Choice(name, *options):
1079-
cl = Class(db, name, name=hyperdb.String(), order=hyperdb.String())
1077+
def Choice(name, db, *options):
1078+
'''Quick helper to create a simple class with choices
1079+
'''
1080+
cl = Class(db, name, name=String(), order=String())
10801081
for i in range(len(options)):
1081-
cl.create(name=option[i], order=i)
1082+
cl.create(name=options[i], order=i)
10821083
return hyperdb.Link(name)
10831084

10841085
#
10851086
# $Log: not supported by cvs2svn $
1087+
# Revision 1.57 2002/02/20 05:23:24 richard
1088+
# Didn't accomodate new values for new properties
1089+
#
10861090
# Revision 1.56 2002/02/20 05:05:28 richard
10871091
# . Added simple editing for classes that don't define a templated interface.
10881092
# - access using the admin "class list" interface

0 commit comments

Comments
 (0)