def __init__(self, fname, md5=""): assert isinstance(fname, unicode) """fname : 文件绝对路径, unicode""" self.fname = fname self.md5 = md5.lower() self.mtime = fileutils.mtime(fname) self.size = fileutils.size(fname) self.isFile = True
def __init__(self, fname, md5=''): assert isinstance(fname, unicode) '''fname : 文件绝对路径, unicode''' self.fname = fname self.md5 = md5.lower() self.mtime = fileutils.mtime(fname) self.size = fileutils.size(fname) self.isFile = True
def is_changed(self): return (self.mtime != fileutils.mtime(self.fname) and self.mtime >= 0) or self.size != fileutils.size( self.fname )
def is_changed(self): return (self.mtime != fileutils.mtime(self.fname) and self.mtime >= 0) or \ self.size != fileutils.size(self.fname)