This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Unit] | |
| Description=uWSGI | |
| After=syslog.target | |
| [Service] | |
| ExecStart=/usr/bin/uwsgi /opt/ns/app/uwsgi.yml | |
| RuntimeDirectory=/opt/ns/app | |
| Restart=always | |
| KillSignal=SIGQUIT | |
| Type=notify |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| uwsgi: | |
| master: 1 | |
| processes: 16 | |
| need-app: 1 | |
| buffer-size: 32768 | |
| post-buffering: 8192 | |
| chmod-socket: 660 | |
| harakiri: 60 | |
| reload-on-rss: 1024 | |
| umask: 002 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask | |
| app = Flask(__name__) | |
| @app.route('/') | |
| def hello_world(): | |
| return 'Hello, World!' | |
| @app.route('/health') | |
| def health(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >> print table( | |
| sorted(team.special_events.values(), key=lambda e:(e.period, e.time)), | |
| ["period","time","type","player_in","player_out"], | |
| { | |
| 'period':{'align':'rjust'}, | |
| 'time':{'format':toTime, 'align':'rjust'} | |
| } | |
| ) | |
| PERIOD TIME TYPE PLAYER_IN PLAYER_OUT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from collections import Counter | |
| def table(data, fields, user_config={}, debug=False): | |
| """Nicely formatted table, for printing to stdout | |
| Required: | |
| @param data: list, objects instances | |
| @param fields: list, object properties/fields to display | |
| Optional: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| run_list = [run | |
| for run in run_list | |
| if playermatch_id in [player.id for player in run.players]] |