Conditions | 2 |
Total Lines | 13 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | #!/usr/bin/env python3 |
||
34 | def main(): |
||
35 | """Run the app.""" |
||
36 | # kill possible zombie processes; can't use psutil in py2app context |
||
37 | system('lsof -nti:' + str(things3_api.PORT) + ' | xargs kill -9 ; sleep 1') |
||
38 | |||
39 | try: |
||
40 | httpd = things3_api.setup() |
||
41 | Thread(target=open_browser).start() |
||
42 | httpd.serve_forever() |
||
43 | except KeyboardInterrupt: |
||
44 | print("Shutting down...") |
||
45 | httpd.shutdown() |
||
46 | sys.exit(0) |
||
47 | |||
51 |