Mercurial > hg > silvermirror
view silvermirror/unison.py @ 13:584a847d2491
note on FF sync
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sat, 09 Apr 2011 12:10:19 -0700 |
parents | 9b139702a8f9 |
children | 743c920bc041 |
line wrap: on
line source
""" unison backend for silvermirror """ import pexpect from interface import Reflector class unison(Reflector): def sync(self, host, resource, ignore=(), password=None, test=False): command = ['unison', '-auto', '-batch', resource, 'ssh://%s/%s' % (host, resource)] for i in ignore: command.extend(('-ignore', "'Name %s'" % i)) command = ' '.join(command) print command # XXX debug -- should go to logging if not test: child = pexpect.spawn(command, timeout=36000, maxread=1) child.expect('password: ') child.sendline(password[host]) print child.read() # XXX -> logging