Пример #1
0
 def __init__(self, path, content, file_id, user):
     BaseFile.__init__(self, path)
     self.file_id = file_id
     self.content = content
     self.last_modified_in_revision = None
     self.last_modified_by = user
     self.last_modified_date = datetime.utcnow()
     self.file_type = self._get_filetype()
Пример #2
0
 def __init__(self, filestore, path, file_id):
     BaseFile.__init__(self, path)
     self.file_id = file_id
     self.filestore = filestore
     # This isn't entirely necessary.
     self.tree = self.filestore.tree
     self.file_type = self._get_filetype()
     bt = self.filestore.basis_tree()
     bt.lock_read()
     try:
         inv_file = bt.inventory[self.file_id]
         self.last_modified_in_revision = inv_file.revision
     finally:
         bt.unlock()