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

def ubuntuone::syncdaemon::sync::SyncStateMachineRunner::client_moved (   self,
  event,
  params,
  path_from,
  path_to 
)

the client moved a file

Definition at line 504 of file sync.py.

00504                                                              :
        """the client moved a file"""
        parent_path = os.path.dirname(path_from)
        old_parent = FSKey(self.m.fs, path=parent_path)
        old_parent_id = old_parent['node_id']
        new_path = os.path.dirname(path_to)
        new_name = os.path.basename(path_to)
        new_parent = FSKey(self.m.fs, path=new_path)
        new_parent_id = new_parent['node_id']

        self.m.action_q.move(share_id=self.key['share_id'],
            node_id=self.key['node_id'], old_parent_id=old_parent_id,
            new_parent_id=new_parent_id, new_name=new_name)
        self.key.moved(self.key['share_id'], path_to)

        # this is cheating, we change the state of another node
        if not IMarker.providedBy(old_parent_id):
            share_id = self.key['share_id']
            self.m.action_q.cancel_download(share_id, old_parent_id)
            old_parent.remove_partial()
            self.m.fs.set_by_node_id(old_parent_id, share_id,
                                     server_hash="", local_hash="")
            self.m.action_q.query([(share_id, old_parent_id, "")])
        self.m.hash_q.insert(self.key['path'])


    def server_file_changed_back(self, event, params, hash):


Generated by  Doxygen 1.6.0   Back to index