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