def on_deleted(this, event): path = event.src_path logger.debug("Handling %s" % event) if utils.normalize_local_suffix(path) == root_path: self.settings.set_localfs_enabled(False) msg = messaging.LocalfsSyncDisabled(logger=logger) self.settings.messager.put(msg) return handle_path(path, rec=utils.iswin())
def create_local_dirs(self): self.create_dir(self.local_root_path) self.create_dir(self.cache_path) if utils.iswin(): win_hide_file(self.cache_path) self.create_dir(self.cache_hide_path) self.create_dir(self.cache_stage_path) self.create_dir(self.cache_fetch_path) self.set_mtime_lag() self.set_case_insensitive()
def link_file(src, dest): cmd = os.rename if utils.iswin() else os.link try: cmd(src, dest) except OSError as e: if e.errno == errno.EEXIST: raise common.ConflictError("Cannot link, '%s' exists." % dest) if e.errno in [errno.ENOTDIR, errno.EINVAL]: raise common.ConflictError("Cannot link, missing path for '%s'." % dest) if e.errno == errno.ENOENT: raise DirMissing()
def launch_server(callback, debug): """Launch the server in a separate process""" LOGGER.info('Start SessionHelper session') opts = ["start", "daemon"] if debug: opts.append('-d') if utils.iswin(): command = [] if ISFROZEN else ["pythonw.exe"] command.append(callback) command += opts subprocess.Popen(command, close_fds=True) else: command = [callback, callback] command += opts daemonize(command)