Exemplo n.º 1
0
 def __init__(self, workspace, content):
     '''
     Constructor
     '''
     self.content = zlib.compress(content)
     self.sha1 = cal_sha1(content)
     self.path = os.path.join(workspace, '.git', 'objects', self.sha1[:2], self.sha1[2:])
Exemplo n.º 2
0
 def __init__(self, final_content=None, sha1=None):
     '''
     Constructor
     '''
     if sha1:
         self.sha1 = sha1
         self.path = os.path.join(OBJECT_DIR, self.sha1[:2], self.sha1[2:])
         self.content = read_file(self.path)
     else:
         self.content = zlib.compress(final_content)
         self.sha1 = cal_sha1(final_content)
         self.path = os.path.join(OBJECT_DIR, self.sha1[:2], self.sha1[2:])
Exemplo n.º 3
0
 def __init__(self, final_content=None, sha1=None):
     '''
     Constructor
     '''
     if sha1:
         self.sha1 = sha1
         self.path = os.path.join(OBJECT_DIR, self.sha1[:2], self.sha1[2:])
         self.content = read_file(self.path)
     else:
         self.content = zlib.compress(final_content)
         self.sha1 = cal_sha1(final_content)
         self.path = os.path.join(OBJECT_DIR, self.sha1[:2], self.sha1[2:])
Exemplo n.º 4
0
 def __init__(self, workspace, final_content=None, sha1=None):
     '''
     Constructor
     '''
     if sha1:
         self.sha1 = sha1
         self.path = os.path.join(workspace, '.git', 'objects', self.sha1[:2], self.sha1[2:])
         self.content = read_file(self.path)
     else:
         self.content = zlib.compress(final_content)
         self.sha1 = cal_sha1(final_content)
         self.path = os.path.join(workspace, '.git', 'objects', self.sha1[:2], self.sha1[2:])