X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=inline;f=daklib%2Fdbconn.py;h=aa71c180073f1986b764ffb9bf450158e1213dfe;hb=71565adc68c3eddfd5459a56a4259451bffb0ee8;hp=efe2d13761551a7f243c512a81cd779a33b35a0f;hpb=af4d6b256683e0e102b91a05649f97a81988f5b3;p=dak.git diff --git a/daklib/dbconn.py b/daklib/dbconn.py index efe2d137..aa71c180 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -1161,8 +1161,8 @@ class PoolFile(ORMObject): def fullpath(self): return os.path.join(self.location.path, self.filename) - def is_valid(self, filesize = -1, md5sum = None):\ - return self.filesize == filesize and self.md5sum == md5sum + def is_valid(self, filesize = -1, md5sum = None): + return self.filesize == long(filesize) and self.md5sum == md5sum def properties(self): return ['filename', 'file_id', 'filesize', 'md5sum', 'sha1sum', \ @@ -1575,8 +1575,6 @@ __all__.append('get_dbchange') ################################################################################ -# TODO: Why do we have a separate Location class? Can't it be fully integrated -# into class Component? class Location(ORMObject): def __init__(self, path = None, component = None): self.path = path @@ -1585,7 +1583,8 @@ class Location(ORMObject): self.archive_type = 'pool' def properties(self): - return ['path', 'archive_type', 'component', 'files_count'] + return ['path', 'location_id', 'archive_type', 'component', \ + 'files_count'] def not_null_constraints(self): return ['path', 'archive_type']