def do(self): argv = [self.model.history_browser()] if self.revision: argv.append(self.revision) if self.paths: argv.append('--') argv.extend(self.paths) utils.fork(argv)
def do(self): filename = self.filenames[0] if not os.path.exists(filename): return editor = self.model.editor() if editor == 'gvim' and self.line_number: utils.fork([editor, filename, '+'+self.line_number]) else: utils.fork([editor, filename])
def ret(): utils.fork(loop=True)(r.listen) @functools.wraps(r.f) def call_from_python(client, *args): escaped = [utils.single_quoted(arg) for arg in args] pipe(r.session, ' '.join([r._f_name()] + escaped), client, sync=sync_python_calls) return call_from_python
def hook(self_or_session, scope, name, group=None, filter='.*', sync_setup=False, client=None): r = Remote._resolve(self_or_session) r.sync_setup = sync_setup group = ' -group ' + group if group else '' filter = utils.single_quoted(filter) cmd = 'hook' + group + ' ' + scope + ' ' + name + ' ' + filter + ' %(' r_pre = r.pre r.pre = lambda f: cmd + r_pre(f) r.post = ')' + r.post r.ret = lambda: utils.fork(loop=True)(r.listen) if client: r.onclient(r, client) return r
def do(self): utils.fork(self.argv)
def do(self): browser = self.model.history_browser() utils.fork([browser, self.model.currentbranch])
def do(self): browser = self.model.history_browser() utils.fork([browser, '--all'])
def do(self): self.model.git.clone(self.url, self.new_directory, with_stderr=True, with_status=True) if self.spawn: utils.fork(['python', sys.argv[0], '--repo', self.new_directory])
def do(self): self.model.set_directory(self.new_directory) utils.fork([sys.executable, sys.argv[0], '--repo', self.new_directory])
def do(self): if not self.paths: return utils.fork(['git', 'mergetool', '--no-prompt', '--'] + self.paths)
def asynchronous(self_or_session): r = Remote._resolve(self_or_session) r_ret = r.ret r.ret = lambda: utils.fork()(r_ret) return r
#!/usr/bin/env python import network import subprocess import utils def connect(): matcher = network.NetworkMatcher() host = matcher.match() if host != None: print "Spawning client for host '{0}'...".format(host) subprocess.call(['synergyc', host]) def disconnect(): subprocess.call(['killall', 'synergyc']) def reconnect(): disconnect() connect() utils.init() network.NetworkManager().registerConnectHandler(reconnect) reconnect() utils.fork()
def __call__(self, **kwargs): self.task = fork(self.run(**kwargs))
#!/usr/bin/env python import network import subprocess import utils def connect (): matcher = network.NetworkMatcher() host = matcher.match() if host != None: print "Spawning client for host '{0}'...".format(host) subprocess.call(['synergyc', host]) def disconnect (): subprocess.call(['killall', 'synergyc']) def reconnect (): disconnect() connect() utils.init() network.NetworkManager().registerConnectHandler(reconnect) reconnect() utils.fork()