|
|
@ -464,8 +464,7 @@ def test_notification(protocol, provider):
|
|
|
|
return '', 200
|
|
|
|
return '', 200
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Server(object):
|
|
|
|
class Server:
|
|
|
|
class __Server:
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
def __init__(self):
|
|
|
|
# Mute DeprecationWarning
|
|
|
|
# Mute DeprecationWarning
|
|
|
|
warnings.simplefilter("ignore", DeprecationWarning)
|
|
|
|
warnings.simplefilter("ignore", DeprecationWarning)
|
|
|
@ -527,20 +526,8 @@ class Server(object):
|
|
|
|
restart_file.close()
|
|
|
|
restart_file.close()
|
|
|
|
os._exit(0)
|
|
|
|
os._exit(0)
|
|
|
|
|
|
|
|
|
|
|
|
instance = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __new__(cls): # __new__ always a classmethod
|
|
|
|
|
|
|
|
if not Server.instance:
|
|
|
|
|
|
|
|
Server.instance = Server.__Server()
|
|
|
|
|
|
|
|
return Server.instance
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __getattr__(self, name):
|
|
|
|
|
|
|
|
return getattr(self.instance, name)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __setattr__(self, name):
|
|
|
|
|
|
|
|
return setattr(self.instance, name)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
global webserver
|
|
|
|
webserver = Server()
|
|
|
|
webserver = Server()
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
if __name__ == "__main__":
|
|
|
|