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

def ubuntuone::syncdaemon::filesystem_manager::FileSystemManager::create_partial (   self,
  node_id,
  share_id 
)

Creates a .partial in disk and set the flag in metadata.

Definition at line 589 of file filesystem_manager.py.

00589                                                :
        '''Creates a .partial in disk and set the flag in metadata.'''
        mdid = self._idx_node_id[(share_id, node_id)]
        if self._check_partial(mdid):
            raise ValueError("The object with share_id %r and node_id %r is "
                             "already partial!" % (share_id, node_id))

        # create an empty partial and set the flag
        mdobj = self.fs[mdid]
        is_dir = mdobj["is_dir"]
        path = self.get_abspath(mdobj['share_id'], mdobj['path'])
        partial_path = self.get_partial_path(mdobj)
        with self._enable_share_write(share_id, partial_path):
            # if we don't have the dir yet, create it
            if is_dir and not os.path.exists(path):
                os.mkdir(path)
            open(partial_path, "w").close()

        mdobj["info"]["last_partial_created"] = time.time()
        mdobj["info"]["is_partial"] = True
        self.fs[mdid] = mdobj

    def get_partial_for_writing(self, node_id, share_id):


Generated by  Doxygen 1.6.0   Back to index