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

def ubuntuone::syncdaemon::sync::SyncStateMachineRunner::new_dir (   self,
  event,
  params,
  share_id,
  node_id,
  parent_id,
  name 
)

create a local file.

Definition at line 311 of file sync.py.

00311                                                                         :
        """create a local file."""
        mdobj = self.m.fs.get_by_node_id(share_id, parent_id)
        path = os.path.join(self.m.fs.get_abspath(share_id, mdobj.path), name)
        self.m.fs.create(path=path, share_id=share_id, is_dir=True)
        self.m.fs.set_node_id(path, node_id)
        self.m.action_q.query([(share_id, node_id, "")])
        # pylint: disable-msg=W0704
        # this should be provided by FSM, fix!!
        try:
            with self.m.fs._enable_share_write(share_id, self.key['path']):
                os.mkdir(self.key['path'])
        except OSError, e:
            if not e.errno == 17: #already exists
                raise
        else:
            try:
                # just add the watch
                # we hope the user wont have time to add a file just after
                # *we* created the directory
                # this is until we can solve and issue with LR and
                # new dirs and fast downloads
                # see bug #373940
                self.m.event_q.inotify_add_watch(path)
                #self.m.lr.scan_dir(path)
            except ValueError:
                pass #it was gone when lr got it


    def new_dir_on_server_with_local(self, event, params, share_id,


Generated by  Doxygen 1.6.0   Back to index