Loading opds_catalog/__pycache__/settings.cpython-35.pyc +90 B (3 KiB) File changed.No diff preview for this file type. View original file View changed file opds_catalog/management/commands/__pycache__/sopds_server.cpython-35.pyc +464 B (4.55 KiB) File changed.No diff preview for this file type. View original file View changed file opds_catalog/management/commands/sopds_server.py +4 −36 Original line number Diff line number Diff line Loading @@ -3,11 +3,13 @@ import signal import sys import socket import errno import django from django.conf import settings from django.core.management.base import BaseCommand from django.core.servers.basehttp import get_internal_wsgi_application, run from django.utils.encoding import force_text from django.core.management import call_command from opds_catalog.settings import SERVER_LOG Loading Loading @@ -45,41 +47,7 @@ class Command(BaseCommand): def start(self): writepid(self.pidfile) quit_command = 'CTRL-BREAK' if sys.platform == 'win32' else 'CONTROL-C' self.stdout.write(( "Starting SOPDS server at http://%(addr)s:%(port)s/\n" "Quit the server with %(quit_command)s.\n" ) % { "addr": '[%s]' % self.addr, "port": self.port, "quit_command": quit_command, }) try: handler = get_internal_wsgi_application() run(self.addr, int(self.port), handler,ipv6=False, threading=True) except socket.error as e: # Use helpful error messages instead of ugly tracebacks. ERRORS = { errno.EACCES: "You don't have permission to access that port.", errno.EADDRINUSE: "That port is already in use.", errno.EADDRNOTAVAIL: "That IP address can't be assigned to.", } try: error_text = ERRORS[e.errno] except KeyError: error_text = force_text(e) self.stderr.write("Error: %s" % error_text) # Need to use an OS exit because sys.exit doesn't work in a thread os._exit(1) except KeyboardInterrupt: sys.exit(0) def stop(self, pid): try: os.kill(int(pid), signal.SIGTERM) except OSError as e: print(str(e)) call_command('runserver', '%s:%s'%(self.addr,int(self.port)), app_label='opds_catalog') def restart(self, pid): self.stop(pid) Loading sopds-server.pid +1 −1 Original line number Diff line number Diff line 9708 No newline at end of file 6112 No newline at end of file Loading
opds_catalog/__pycache__/settings.cpython-35.pyc +90 B (3 KiB) File changed.No diff preview for this file type. View original file View changed file
opds_catalog/management/commands/__pycache__/sopds_server.cpython-35.pyc +464 B (4.55 KiB) File changed.No diff preview for this file type. View original file View changed file
opds_catalog/management/commands/sopds_server.py +4 −36 Original line number Diff line number Diff line Loading @@ -3,11 +3,13 @@ import signal import sys import socket import errno import django from django.conf import settings from django.core.management.base import BaseCommand from django.core.servers.basehttp import get_internal_wsgi_application, run from django.utils.encoding import force_text from django.core.management import call_command from opds_catalog.settings import SERVER_LOG Loading Loading @@ -45,41 +47,7 @@ class Command(BaseCommand): def start(self): writepid(self.pidfile) quit_command = 'CTRL-BREAK' if sys.platform == 'win32' else 'CONTROL-C' self.stdout.write(( "Starting SOPDS server at http://%(addr)s:%(port)s/\n" "Quit the server with %(quit_command)s.\n" ) % { "addr": '[%s]' % self.addr, "port": self.port, "quit_command": quit_command, }) try: handler = get_internal_wsgi_application() run(self.addr, int(self.port), handler,ipv6=False, threading=True) except socket.error as e: # Use helpful error messages instead of ugly tracebacks. ERRORS = { errno.EACCES: "You don't have permission to access that port.", errno.EADDRINUSE: "That port is already in use.", errno.EADDRNOTAVAIL: "That IP address can't be assigned to.", } try: error_text = ERRORS[e.errno] except KeyError: error_text = force_text(e) self.stderr.write("Error: %s" % error_text) # Need to use an OS exit because sys.exit doesn't work in a thread os._exit(1) except KeyboardInterrupt: sys.exit(0) def stop(self, pid): try: os.kill(int(pid), signal.SIGTERM) except OSError as e: print(str(e)) call_command('runserver', '%s:%s'%(self.addr,int(self.port)), app_label='opds_catalog') def restart(self, pid): self.stop(pid) Loading
sopds-server.pid +1 −1 Original line number Diff line number Diff line 9708 No newline at end of file 6112 No newline at end of file