Logo Search packages:      
Sourcecode: ubuntuone-client version File versions

def ubuntuone::syncdaemon::filesystem_manager::FileSystemManager::create (   self,
  is_dir = False 

Creates a new md object.

Definition at line 282 of file filesystem_manager.py.

00282                                                   :
        '''Creates a new md object.'''
        if not path.strip():
            raise ValueError("Empty paths are not allowed (got %r)" % path)

        path = os.path.normpath(path)
        if path in self._idx_path:
            raise ValueError("The path %r is already created!" % path)

        # create it
        mdid = str(uuid.uuid4())
        # make path relative to the share_id
        relpath = self._share_relative_path(share_id, path)
        newobj = dict(path=relpath, node_id=None, share_id=share_id,
                      is_dir=is_dir, local_hash=None,
                      server_hash=None, mdid=mdid)
        newobj["info"] = dict(created=time.time(), is_partial=False)
        if os.path.exists(path):
            newobj["stat"] = os.stat(path)
            newobj["stat"] = None

        logger("create: path=%r mdid=%r share_id=%r node_id=%r is_dir=%r" % (
                                          path, mdid, share_id, None, is_dir))
        self.fs[mdid] = newobj

        # adjust the index
        self._idx_path[path] = mdid

        return mdid

    def set_node_id(self, path, node_id):

Generated by  Doxygen 1.6.0   Back to index