From 23bc70aeb1f713f3525fc7f14c62a758c82b367f Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Thu, 7 Jan 2021 11:54:56 -0800 Subject: [PATCH] No issue: add main function to setup-startup-profiling. --- tools/setup-startup-profiling.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/tools/setup-startup-profiling.py b/tools/setup-startup-profiling.py index 0933b3ebd..6b2764bf9 100755 --- a/tools/setup-startup-profiling.py +++ b/tools/setup-startup-profiling.py @@ -48,17 +48,21 @@ def remove(filename): run(['adb', 'shell', 'rm', PATH_PREFIX + '/' + filename]) run(['adb', 'shell', 'am', 'clear-debug-app']) -try: - cmd = sys.argv[1] - id = sys.argv[2] -except IndexError as e: - print_usage_and_exit() +def main(): + try: + cmd = sys.argv[1] + id = sys.argv[2] + except IndexError as e: + print_usage_and_exit() + + filename = id + '-geckoview-config.yaml' -filename = id + '-geckoview-config.yaml' + if cmd == 'push': + push(id, filename) + elif cmd == 'remove': + remove(filename) + else: + print_usage_and_exit() -if cmd == 'push': - push(id, filename) -elif cmd == 'remove': - remove(filename) -else: - print_usage_and_exit() +if __name__ == '__main__': + main()