Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Side by Side Diff: build/android/adb_reverse_forwarder.py

Issue 727543003: [Android] Fix new pylint errors in build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/android/adb_logcat_monitor.py ('k') | build/android/avd.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Command line tool for forwarding ports from a device to the host. 7 """Command line tool for forwarding ports from a device to the host.
8 8
9 Allows an Android device to connect to services running on the host machine, 9 Allows an Android device to connect to services running on the host machine,
10 i.e., "adb forward" in reverse. Requires |host_forwarder| and |device_forwarder| 10 i.e., "adb forward" in reverse. Requires |host_forwarder| and |device_forwarder|
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 devices = android_commands.GetAttachedDevices() 54 devices = android_commands.GetAttachedDevices()
55 55
56 if options.device: 56 if options.device:
57 if options.device not in devices: 57 if options.device not in devices:
58 raise Exception('Error: %s not in attached devices %s' % (options.device, 58 raise Exception('Error: %s not in attached devices %s' % (options.device,
59 ','.join(devices))) 59 ','.join(devices)))
60 devices = [options.device] 60 devices = [options.device]
61 else: 61 else:
62 if not devices: 62 if not devices:
63 raise Exception('Error: no connected devices') 63 raise Exception('Error: no connected devices')
64 print("No device specified. Defaulting to " + devices[0]) 64 print "No device specified. Defaulting to " + devices[0]
65 65
66 device = device_utils.DeviceUtils(devices[0]) 66 device = device_utils.DeviceUtils(devices[0])
67 constants.SetBuildType(options.build_type) 67 constants.SetBuildType(options.build_type)
68 try: 68 try:
69 forwarder.Forwarder.Map(port_pairs, device) 69 forwarder.Forwarder.Map(port_pairs, device)
70 while True: 70 while True:
71 time.sleep(60) 71 time.sleep(60)
72 except KeyboardInterrupt: 72 except KeyboardInterrupt:
73 sys.exit(0) 73 sys.exit(0)
74 finally: 74 finally:
75 forwarder.Forwarder.UnmapAllDevicePorts(device) 75 forwarder.Forwarder.UnmapAllDevicePorts(device)
76 76
77 if __name__ == '__main__': 77 if __name__ == '__main__':
78 main(sys.argv) 78 main(sys.argv)
OLDNEW
« no previous file with comments | « build/android/adb_logcat_monitor.py ('k') | build/android/avd.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698