OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # This file is part of the Adblock Plus web scripts, | 3 # This file is part of the Adblock Plus web scripts, |
4 # Copyright (C) 2006-2016 Eyeo GmbH | 4 # Copyright (C) 2006-2016 Eyeo GmbH |
5 # | 5 # |
6 # Adblock Plus is free software: you can redistribute it and/or modify | 6 # Adblock Plus is free software: you can redistribute it and/or modify |
7 # it under the terms of the GNU General Public License version 3 as | 7 # it under the terms of the GNU General Public License version 3 as |
8 # published by the Free Software Foundation. | 8 # published by the Free Software Foundation. |
9 # | 9 # |
10 # Adblock Plus is distributed in the hope that it will be useful, | 10 # Adblock Plus is distributed in the hope that it will be useful, |
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 # GNU General Public License for more details. | 13 # GNU General Public License for more details. |
14 # | 14 # |
15 # You should have received a copy of the GNU General Public License | 15 # You should have received a copy of the GNU General Public License |
16 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 16 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 |
18 from sitescripts.web import multiplex | 18 from sitescripts.web import multiplex |
19 | 19 |
20 try: | 20 try: |
21 from werkzeug.serving import run_simple | 21 from werkzeug.serving import run_simple |
22 except ImportError: | 22 except ImportError: |
23 from wsgiref.simple_server import make_server | 23 from wsgiref.simple_server import make_server |
24 | 24 |
25 def run_simple(host, port, app, **kwargs): | 25 def run_simple(host, port, app, **kwargs): |
26 server = make_server(host, port, app) | 26 server = make_server(host, port, app) |
27 print " * Running on http://%s:%i/" % server.server_address | 27 print ' * Running on http://%s:%i/' % server.server_address |
28 server.serve_forever() | 28 server.serve_forever() |
29 | 29 |
30 if __name__ == "__main__": | 30 if __name__ == '__main__': |
31 run_simple("localhost", 5000, multiplex, use_reloader=True, use_debugger=Tru
e) | 31 run_simple('localhost', 5000, multiplex, use_reloader=True, use_debugger=Tru
e) |
OLD | NEW |