Ejemplo n.º 1
0
 def path_to_oid(self, path):
     try:
         if path == '':
             # This is a special case where repr_to_oid converts '' to the
             # OID z64.
             raise TypeError()
         return utils.repr_to_oid(path)
     except TypeError:
         raise ValueError('Not a valid OID path: `%s`' % path)
Ejemplo n.º 2
0
 def path_to_oid(self, path):
     try:
         if path == '':
             # This is a special case where repr_to_oid converts '' to the
             # OID z64.
             raise TypeError()
         return utils.repr_to_oid(path)
     except TypeError:
         raise ValueError('Not a valid OID path: `%s`' % path)
Ejemplo n.º 3
0
    def splitBlobFilename(self, filename):
        """Returns the oid and tid for a given blob filename.

        If the filename cannot be recognized as a blob filename, (None, None)
        is returned.

        """
        if not filename.endswith(BLOB_SUFFIX):
            return None, None
        path, filename = os.path.split(filename)
        oid = self.getOIDForPath(path)

        serial = filename[:-len(BLOB_SUFFIX)]
        serial = utils.repr_to_oid(serial)
        return oid, serial
Ejemplo n.º 4
0
    def splitBlobFilename(self, filename):
        """Returns the oid and tid for a given blob filename.

        If the filename cannot be recognized as a blob filename, (None, None)
        is returned.

        """
        if not filename.endswith(BLOB_SUFFIX):
            return None, None
        path, filename = os.path.split(filename)
        oid = self.getOIDForPath(path)

        serial = filename[:-len(BLOB_SUFFIX)]
        serial = utils.repr_to_oid(serial)
        return oid, serial
Ejemplo n.º 5
0
def oid(o):
    repr = '%016x' % o
    return repr_to_oid(repr)
Ejemplo n.º 6
0
def oid(o):
    repr = '%016x' % o
    return repr_to_oid(repr)