From 13f6f0bc6acbf9fd19f093d0fa171ef2b0769aae Mon Sep 17 00:00:00 2001 From: Omar Date: Fri, 22 Sep 2023 20:00:25 +0530 Subject: [PATCH] Some minute syntax changes and added doc strings Signed-off-by: Omar --- scripts/avogadro-remote.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/scripts/avogadro-remote.py b/scripts/avogadro-remote.py index fb078825..a2af3330 100755 --- a/scripts/avogadro-remote.py +++ b/scripts/avogadro-remote.py @@ -66,9 +66,10 @@ def recv_json(self): return json.loads(msg) except Exception as exception: print("error: " + str(exception)) - return {} - - def open_file(self,file): + return {} + + def open_file(self, file): + """Opens file""" self.send_json( { "jsonrpc": "2.0", @@ -77,7 +78,9 @@ def open_file(self,file): "params": {"fileName": file}, } ) - def save_graphic(self,file): + + def save_graphic(self, file): + """Save Graphic""" self.send_json( { "jsonrpc": "2.0", @@ -86,15 +89,17 @@ def save_graphic(self,file): "params": {"fileName": file}, } ) + def kill(self): + """To kill the current operation""" self.send_json( { - "jsonrpc": "2.0", - "id": 0, - "method": "kill" + "jsonrpc": "2.0", + "id": 0, + "method": "kill" } - ) - + ) + def close(self): '''Close the socket to the named pipe''' - self.sock.close() + self.sock.close() \ No newline at end of file