Changeset 1794
- Timestamp:
- 02/21/07 11:22:33 (22 months ago)
- Location:
- plugins/moto-sync
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
plugins/moto-sync/README
r1720 r1794 36 36 REQUIREMENTS 37 37 38 * OpenSync 0. 20 or later with the python bindings and python-module plugin38 * OpenSync 0.30 or later with the python bindings and python-module plugin 39 39 * Python 2.4 or newer 40 40 * The python-dateutil library (at least version 1.1), … … 77 77 msynctool --addmember phone file-sync 78 78 msynctool --configure phone 1 # configure moto-sync, as above 79 msynctool --configure phone 2 # configure file-sync, set the path 79 msynctool --configure phone 2 # configure file-sync, set the path(s) 80 msynctool --discover phone 1 81 msynctool --discover phone 2 80 82 msynctool --sync phone # cross your fingers! 81 82 NB: make sure your file-sync directory has only events and contacts in83 it, no TODO or other data. Otherwise OpenSync will mysteriously84 deadlock, because there were changes from the file-sync that couldn't be85 converted. I'm told that this bug is already fixed by the development86 branch of OpenSync.87 83 88 84 … … 91 87 Before doing anything with write enabled, it is probably a good idea to 92 88 backup the data from your phone. You can use the mototool script to 93 do this, to delete entries on the phone, or to examine the data that 94 moto-sync would send to opensync. Run 'mototool --help' for details 95 or, for the impatient, try: 89 do this, and to delete entries on the phone. Run 'mototool --help' for 90 details, or, for the impatient, try: 96 91 mototool -v -d (device string) -f myphone.backup --backup 97 92 -
plugins/moto-sync/mototool
r1608 r1794 16 16 libdir = child.fromchild.readline().rstrip('\n') 17 17 if child.wait() != 0 or not os.path.isdir(libdir): 18 sys.stderr.write("Error: couldn't locate OpenSync library directory\n") 19 sys.exit(1) 18 # no pkgconfig, try standard install path 19 libdir = '/usr/lib/opensync' 20 if not os.path.isdir(libdir): 21 sys.stderr.write("Error: couldn't locate OpenSync library directory\n") 22 sys.exit(1) 20 23 sys.path.append(os.path.join(libdir, 'opensync', 'python-plugins')) 21 24 import motosync … … 35 38 p.add_option('-f', '--file', dest='filename', 36 39 help='name of backup/restore data file') 37 p.add_option('--list', action='store_const', dest='mode', const='list',38 help='list data on the phone in OpenSync XML format')39 40 p.add_option('--backup', action='store_const', dest='mode', const='backup', 40 41 help='backup entries from the phone to a file') … … 47 48 options, args = p.parse_args() 48 49 if not options.mode: 49 p.error('one of the list, backup, restore,delete actions is required')50 p.error('one of the backup, restore, or delete actions is required') 50 51 if options.mode in ['backup', 'restore'] and not options.filename: 51 52 p.error('this action requires a --file argument') … … 110 111 prompt_user(options) 111 112 pc = motosync.PhoneComms(options.device) 112 113 if options.mode == 'list': 114 pa = motosync.PhoneAccess(pc) 115 for objtype in options.objtype: 116 for change in pa.list_changes(objtype): 117 print change.uid 118 print change.data 113 pc.connect() 119 114 120 115 if options.mode == 'delete' or options.mode == 'restore': … … 163 158 pc.write_contact(e) 164 159 160 pc.disconnect() 161 165 162 166 163 if __name__ == "__main__":
