Mercurial > p > roundup > code
changeset 3924:21d3d7eeea8c
assorted pyflakes fixes
I (re-)discovered pyflakes today and ran it over to roundup
code to see what it had to say. It reported a ton of "imported
module foo but you're not actually using it" warnings and a couple
of actual errors that this patch fixes.
The code was wrong but it was mostly stuff that never gets
executed...like hyperdb.Choice.
| author | Justus Pendleton <jpend@users.sourceforge.net> |
|---|---|
| date | Thu, 27 Sep 2007 06:12:57 +0000 |
| parents | d02aad94af5a |
| children | 603ec9630b08 |
| files | roundup/backends/back_postgresql.py roundup/backends/rdbms_common.py roundup/backends/sessions_dbm.py roundup/hyperdb.py |
| diffstat | 4 files changed, 12 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/roundup/backends/back_postgresql.py Wed Sep 26 14:09:59 2007 +0000 +++ b/roundup/backends/back_postgresql.py Thu Sep 27 06:12:57 2007 +0000 @@ -1,4 +1,4 @@ -#$Id: back_postgresql.py,v 1.41 2007-09-25 19:49:19 jpend Exp $ +#$Id: back_postgresql.py,v 1.42 2007-09-27 06:12:57 jpend Exp $ # # Copyright (c) 2003 Martynas Sklyzmantas, Andrey Lebedev <andrey@micro.lt> # @@ -108,7 +108,7 @@ return 0 class Sessions(sessions_rdbms.Sessions): - def set(*args, **kwargs): + def set(self, *args, **kwargs): try: sessions_rdbms.Sessions.set(*args, **kwargs) except ProgrammingError, err:
--- a/roundup/backends/rdbms_common.py Wed Sep 26 14:09:59 2007 +0000 +++ b/roundup/backends/rdbms_common.py Thu Sep 27 06:12:57 2007 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: rdbms_common.py,v 1.190 2007-09-16 06:51:48 jpend Exp $ +#$Id: rdbms_common.py,v 1.191 2007-09-27 06:12:57 jpend Exp $ """ Relational database (SQL) backend common code. Basics: @@ -637,7 +637,7 @@ properties = spec[1] # figure the multilinks mls = [] - for propanme, prop in properties: + for propname, prop in properties: if isinstance(prop, Multilink): mls.append(propname)
--- a/roundup/backends/sessions_dbm.py Wed Sep 26 14:09:59 2007 +0000 +++ b/roundup/backends/sessions_dbm.py Thu Sep 27 06:12:57 2007 +0000 @@ -1,4 +1,4 @@ -#$Id: sessions_dbm.py,v 1.7 2006-04-27 04:59:37 richard Exp $ +#$Id: sessions_dbm.py,v 1.8 2007-09-27 06:12:57 jpend Exp $ """This module defines a very basic store that's used by the CGI interface to store session and one-time-key information. @@ -8,6 +8,7 @@ __docformat__ = 'restructuredtext' import anydbm, whichdb, os, marshal, time +from roundup import hyperdb class BasicDatabase: ''' Provide a nice encapsulation of an anydbm store.
--- a/roundup/hyperdb.py Wed Sep 26 14:09:59 2007 +0000 +++ b/roundup/hyperdb.py Thu Sep 27 06:12:57 2007 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: hyperdb.py,v 1.129 2007-01-10 18:17:00 schlatterbeck Exp $ +# $Id: hyperdb.py,v 1.130 2007-09-27 06:12:56 jpend Exp $ """Hyperdatabase implementation, especially field types. """ @@ -81,7 +81,7 @@ try: value = password.Password(value) except password.PasswordValueError, message: - raise HyperdbValueError, 'property %s: %s'%(propname, message) + raise HyperdbValueError, 'property %s: %s'%(kw['propname'], message) return value def sort_repr (self, cls, val, name): if not val: @@ -487,7 +487,7 @@ else: self._val = val self.has_values = True - + val = property(lambda self: self._val, _set_val) def _sort(self, val): @@ -1136,7 +1136,7 @@ for all issues where a message was added by a certain user in the last week with a filterspec of {'messages.author' : '42', 'messages.creation' : '.-1w;'} - + Implementation note: This implements a non-optimized version of Transitive search using _filter implemented in a backend class. A more efficient @@ -1291,7 +1291,7 @@ property. ''' if not properties.has_key('content'): - properties['content'] = hyperdb.String(indexme='yes') + properties['content'] = String(indexme='yes') def export_propnames(self): ''' Don't export the "content" property @@ -1390,6 +1390,6 @@ cl = Class(db, name, name=String(), order=String()) for i in range(len(options)): cl.create(name=options[i], order=i) - return hyperdb.Link(name) + return Link(name) # vim: set filetype=python sts=4 sw=4 et si :
