Merge lp:~cwayne/phablet-tools/phablet-backup into lp:phablet-tools

Proposed by Chris Wayne
Status: Needs review
Proposed branch: lp:~cwayne/phablet-tools/phablet-backup
Merge into: lp:phablet-tools
Diff against target: 62 lines (+46/-1)
2 files modified
phablet-backup (+44/-0)
setup.py (+2/-1)
To merge this branch: bzr merge lp:~cwayne/phablet-tools/phablet-backup
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+194053@code.launchpad.net

Commit message

Add in phablet-backup script

Description of the change

Add in phablet-backup script

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:224
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~cwayne18/phablet-tools/phablet-backup/+merge/194053/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/phablet-tools-ci/238/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-tools-trusty-amd64-ci/10
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-tools-trusty-armhf-ci/10
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-tools-trusty-i386-ci/10

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/phablet-tools-ci/238/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Chris Wayne (cwayne) wrote :

Tested with pep8/pyflakes, and backed up and restored a phone

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Unmerged revisions

224. By Chris Wayne

Adding in phablet-backup script. This is useful if a user has to keep switching between android and ubuntu

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'phablet-backup'
2--- phablet-backup 1970-01-01 00:00:00 +0000
3+++ phablet-backup 2013-11-06 02:59:34 +0000
4@@ -0,0 +1,44 @@
5+#!/usr/bin/python
6+
7+from phabletutils.device import AndroidBridge
8+from phabletutils import backup
9+import argparse
10+
11+
12+class UbuntuDevice(AndroidBridge):
13+
14+ def __init__(self, device=None):
15+ super(UbuntuDevice, self).__init__(device=device)
16+
17+
18+def parse_arguments():
19+ parser = argparse.ArgumentParser(
20+ description='''phablet backup tool. This is useful if
21+ the user is switching between
22+ android/ubuntu''')
23+ parser.add_argument('-s', '--serial',
24+ help='''Device serial. Use when more than
25+ one device is connected.''')
26+ parser.add_argument('-b', '--backup', help='Backup the device',
27+ action='store_true')
28+ parser.add_argument('backupfile',
29+ help='''File to save the backup to, or to restore
30+ from''')
31+ parser.add_argument('-r', '--restore', help='Restore the device',
32+ action='store_true')
33+ return parser.parse_args()
34+
35+
36+def main(args):
37+ args = parse_arguments()
38+ adb = UbuntuDevice(args.serial)
39+ adb.start()
40+ print args.backupfile
41+ if args.backup:
42+ backup.backup(adb, args.backupfile)
43+ elif args.restore:
44+ backup.restore(adb, args.backupfile)
45+
46+if __name__ == "__main__":
47+ args = parse_arguments()
48+ main(args)
49
50=== modified file 'setup.py'
51--- setup.py 2013-09-23 01:43:32 +0000
52+++ setup.py 2013-11-06 02:59:34 +0000
53@@ -9,7 +9,8 @@
54 'phablet-dev-bootstrap',
55 'phablet-flash',
56 'repo',
57- 'phablet-config'
58+ 'phablet-config',
59+ 'phablet-backup'
60 ]
61
62 SH_SCRIPTS = [

Subscribers

People subscribed via source and target branches