From 106a4ceacdbdc0936b740993af334c95cd27ff26 Mon Sep 17 00:00:00 2001 From: Jake Wharton Date: Wed, 19 Jun 2013 11:05:43 -0700 Subject: [PATCH] Code style tweaks. --- pidcat.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pidcat.py b/pidcat.py index f59e6d2..4ee9922 100755 --- a/pidcat.py +++ b/pidcat.py @@ -39,8 +39,7 @@ parser.add_argument('--color-gc', dest='color_gc', action='store_true', help='Co parser.add_argument('-s', '--serial', dest='device_serial', help='Device serial number (adb -s option)') args = parser.parse_args() -min_level=LOG_LEVELS_MAP[args.min_level] -serial=args.device_serial +min_level = LOG_LEVELS_MAP[args.min_level] header_size = args.tag_width + 1 + 3 + 1 # space, level, space @@ -135,10 +134,11 @@ PID_DEATH = re.compile(r'^Process ([a-zA-Z0-9._]+) \(pid (\d+)\) has died.?\r$') LOG_LINE = re.compile(r'^([A-Z])/([^\(]+)\( *(\d+)\): (.*?)\r?$') BUG_LINE = re.compile(r'^(?!.*(nativeGetEnabledTags)).*$') -adb_command = ['adb', 'logcat'] -if serial != None: - adb_command.insert(1, '-s') - adb_command.insert(2, serial) +adb_command = ['adb'] +if args.device_serial: + adb_command.extend(['-s', args.device_serial]) +adb_command.append('logcat') + adb = subprocess.Popen(adb_command, stdin=PIPE, stdout=PIPE, stderr=PIPE) pids = set() last_tag = None