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

def ubuntuone::syncdaemon::filesystem_manager::FileSystemManager::remove_partial (   self,

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

Definition at line 661 of file filesystem_manager.py.

00661                                                :
        '''Removes a .partial in disk and set the flag in metadata.'''
        mdid = self._idx_node_id[(share_id, node_id)]

        # delete the .partial, and set the md info
        mdobj = self.fs[mdid]
        path = self.get_abspath(mdobj['share_id'], mdobj['path'])
        logger("remove_partial: path=%r mdid=%r share_id=%r node_id=%r" %
                                            (path, mdid, share_id, node_id))
        if self.is_dir(path=path):
            partial_path = os.path.join(path, ".partial")
            partial_path = path + ".partial"
        with self._enable_share_write(share_id, partial_path):
            #pylint: disable-msg=W0704
            except OSError, e:
                # we only remove it if its there.
                m = "OSError %s when trying to remove partial_path %r"
                log_warning(m, e, partial_path)
        mdobj["info"]["last_partial_removed"] = time.time()
        mdobj["info"]["is_partial"] = False
        self.fs[mdid] = mdobj

    def upload_finished(self, mdid, server_hash):

Generated by  Doxygen 1.6.0   Back to index