[X2Go-Commits] [x2gobroker] 02/02: UCCS API change for X2Go Sessions: Rename "SessionType" to "Command".

git-admin at x2go.org git-admin at x2go.org
Thu May 3 10:43:46 CEST 2018


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2gobroker.

commit 562c6513133513b575b4b8d2ee3bacc3563f0364
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Thu May 3 10:43:31 2018 +0200

    UCCS API change for X2Go Sessions: Rename "SessionType" to "Command".
---
 x2gobroker/uccsjson.py | 23 +++++++++++------------
 x2gobroker/web/uccs.py |  2 +-
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/x2gobroker/uccsjson.py b/x2gobroker/uccsjson.py
index cef28b9..e271019 100644
--- a/x2gobroker/uccsjson.py
+++ b/x2gobroker/uccsjson.py
@@ -217,26 +217,26 @@ class X2GoServer():
         self.URL = 'http://{url}/'.format(url=host)
         self.Name = name
         self.Protocol = 'x2go'
-        self.SessionTypeRequired = True
+        self.CommandRequired = True
         self.Username = username
         self.Password = password
 
-    def set_session_type(self, session_type):
+    def set_command(self, command):
         """\
-        Set the session type to be used with this X2Go Server.
+        Set the command to be used on this X2Go Server.
 
-        @param session_type: the session type to be set
-        @type session_type: C{unicode}
+        @param command: the session type to be set
+        @type command: C{unicode}
 
-        @raise TypeError: session_type has to be C{str} or C{unicode}
+        @raise TypeError: command has to be C{str}
 
         """
-        if isinstance(session_type, str):
-            self.SessionType = session_type
-        elif isinstance(session_type, str):
-            self.SessionType = session_type
+        if isinstance(command, str):
+            self.Command = command
+        elif isinstance(command, str):
+            self.Command = command
         else:
-            raise TypeError("set_session_type() expects a string or unicode argument")
+            raise TypeError("set_command() expects a string or unicode argument")
 
     def toJson(self):
         """\
@@ -244,4 +244,3 @@ class X2GoServer():
 
         """
         return json.dumps(self, default=convert_to_builtin_type, sort_keys=True, indent=2)
-
diff --git a/x2gobroker/web/uccs.py b/x2gobroker/web/uccs.py
index 86f9b32..0ce80b3 100644
--- a/x2gobroker/web/uccs.py
+++ b/x2gobroker/web/uccs.py
@@ -174,7 +174,7 @@ class X2GoBrokerWebAPI(tornado.web.RequestHandler):
                 _cmd = profile['command']
                 if _cmd.upper() in x2gobroker.defaults.X2GO_DESKTOP_SESSIONS:
                     _cmd = _cmd.upper()
-                ts.set_session_type(_cmd)
+                ts.set_command(_cmd)
             ms.add_terminalserver(ts)
             ms.set_default(ts.Name)
 

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git


More information about the x2go-commits mailing list