~ubuntu-branches/ubuntu/wily/libimobiledevice/wily

« back to all changes in this revision

Viewing changes to dev/msync.py

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2010-05-24 23:39:58 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100524233958-vljg2n4w7pqim0vj
* New upstream release.
* debian/watch: Update.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/bin/env python
2
 
 
3
 
from imobiledevice import *
4
 
from plist import *
5
 
 
6
 
# get msync client
7
 
def GetMobileSyncClient() :
8
 
    phone = idevice()
9
 
    if not phone.init_device() :
10
 
        print "Couldn't find device, is it connected ?\n"
11
 
        return None
12
 
    lckd = phone.get_lockdown_client()
13
 
    if not lckd :
14
 
        print "Failed to start lockdown service.\n"
15
 
        return None
16
 
    msync = lckd.get_mobilesync_client()
17
 
    if not msync :
18
 
        print "Failed to start mobilesync service.\n"
19
 
        return None
20
 
    return msync
21
 
 
22
 
 
23
 
msync = GetMobileSyncClient()
24
 
 
25
 
if not msync :
26
 
    exit(1)
27
 
 
28
 
a = Array()
29
 
a.append( String("SDMessageSyncDataClassWithDevice") )
30
 
a.append( String("") )
31
 
a.append( String("com.apple.Contacts") )
32
 
a.append( String("---") )
33
 
a.append( String("2009-01-13 22:25:58 +0100") )
34
 
a.append( Integer(106) )
35
 
a.append( String("___EmptyParameterString___") )
36
 
 
37
 
msync.send(a)
38
 
a = msync.receive()
39
 
print a.to_xml()
40
 
 
41
 
 
42