Skip closing rpc client connection

This commit is contained in:
Gobinath 2017-10-12 15:54:00 -04:00
parent 443804c3d1
commit 80dee87ed0
1 changed files with 7 additions and 13 deletions

View File

@ -66,46 +66,40 @@ class RPCClient(object):
""" """
def __init__(self, port): def __init__(self, port):
self.port = port self.port = port
self.proxy = ServerProxy('http://localhost:%d/' % self.port, allow_none=True)
def show_settings(self): def show_settings(self):
""" """
Show the settings dialog. Show the settings dialog.
""" """
with ServerProxy('http://localhost:%d/' % self.port, allow_none=True) as proxy: self.proxy.show_settings()
proxy.show_settings()
def show_about(self): def show_about(self):
""" """
Show the about dialog. Show the about dialog.
""" """
with ServerProxy('http://localhost:%d/' % self.port, allow_none=True) as proxy: self.proxy.show_about()
return proxy.show_about()
def enable_safeeyes(self): def enable_safeeyes(self):
""" """
Enable Safe Eyes. Enable Safe Eyes.
""" """
with ServerProxy('http://localhost:%d/' % self.port, allow_none=True) as proxy: self.proxy.enable_safeeyes()
return proxy.enable_safeeyes()
def disable_safeeyes(self): def disable_safeeyes(self):
""" """
Disable Safe Eyes. Disable Safe Eyes.
""" """
with ServerProxy('http://localhost:%d/' % self.port, allow_none=True) as proxy: self.proxy.disable_safeeyes()
return proxy.disable_safeeyes()
def take_break(self): def take_break(self):
""" """
Take a break now. Take a break now.
""" """
with ServerProxy('http://localhost:%d/' % self.port, allow_none=True) as proxy: self.proxy.take_break()
return proxy.take_break()
def quit(self): def quit(self):
""" """
Quit Safe Eyes. Quit Safe Eyes.
""" """
with ServerProxy('http://localhost:%d/' % self.port, allow_none=True) as proxy: self.proxy.quit()
return proxy.quit()