X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fdbconn.py;h=8ee9076874d09a0d785924cb4bf3eb891e9b41b9;hb=afcbb2072c3ef26a12aac62aeae6bd1b898aecd9;hp=ee057d5c9cdff40d4ec905500fac286df5368bf6;hpb=4f37b4b9e868c29b538c90bf51c5bc4aaa84ba53;p=dak.git diff --git a/daklib/dbconn.py b/daklib/dbconn.py index ee057d5c..8ee90768 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -48,7 +48,6 @@ from sqlalchemy.orm.exc import NoResultFound # Only import Config until Queue stuff is changed to store its config # in the database -import utils from config import Config from singleton import Singleton from textutils import fix_maintainer @@ -65,7 +64,7 @@ def session_wrapper(fn): session = kwargs.get('session') # No session specified as last argument or in kwargs, create one. - if session is None and len(args) == len(getargspec(fn)[0]) - 1: + if session is None and len(args) <= len(getargspec(fn)[0]) - 1: private_transaction = True kwargs['session'] = DBConn().session() @@ -76,6 +75,9 @@ def session_wrapper(fn): # We created a session; close it. kwargs['session'].close() + wrapped.__doc__ = fn.__doc__ + wrapped.func_name = fn.func_name + return wrapped ################################################################################ @@ -166,7 +168,7 @@ __all__.append('Archive') @session_wrapper def get_archive(archive, session=None): """ - returns database id for given c{archive}. + returns database id for given C{archive}. @type archive: string @param archive: the name of the arhive @@ -1427,6 +1429,7 @@ class Queue(object): # TODO: Move into database as above if conf.FindB("Dinstall::SecurityQueueBuild"): # Copy it since the original won't be readable by www-data + import utils utils.copy(src, dest) else: # Create a symlink to it @@ -1901,7 +1904,7 @@ def get_suite(suite, session=None): generated if not supplied) @rtype: Suite - @return: Suite object for the requested suite name (None if not presenT) + @return: Suite object for the requested suite name (None if not present) """ q = session.query(Suite).filter_by(suite_name=suite)