예제 #1
0
파일: fixity.py 프로젝트: LouisK130/oii
 def fix(self):
     """compute fixity based on pathname"""
     now = secs2utcdatetime()
     stat = os.stat(self.pathname)
     self.length = stat.st_size
     self.fix_time = now
     self.create_time = secs2utcdatetime(stat.st_ctime)
     self.mod_time = secs2utcdatetime(stat.st_mtime)
     if self.checksum_type=='md5':
         self.checksum = md5_file(self.pathname)
     elif self.checksum_type=='sha1':
         self.checksum = sha1_file(self.pathname)
예제 #2
0
파일: product.py 프로젝트: LouisK130/oii
 def changed(self, event=None, state=None, ts=None):
     if event is None: event = 'create'
     if state is None: state = 'new'
     if ts is None:
         ts = secs2utcdatetime() # now
     self.state = state
     self.event = event
     self.ts = ts