This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository x2gobroker. from 0bfc365 UCCS: Start working on API version 5. new e1368e5 x2gobroker/uccsjson.py: Hide private Python class properties from JSON dict (like <obj>._api_version). The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: x2gobroker/uccsjson.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2gobroker. commit e1368e579119824a9239ef7d4d00208cc1c2bcc6 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri May 4 11:25:50 2018 +0200 x2gobroker/uccsjson.py: Hide private Python class properties from JSON dict (like <obj>._api_version). --- x2gobroker/uccsjson.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/x2gobroker/uccsjson.py b/x2gobroker/uccsjson.py index e582e29..102cebd 100644 --- a/x2gobroker/uccsjson.py +++ b/x2gobroker/uccsjson.py @@ -19,6 +19,8 @@ try: import simplejson as json except ImportError: import json +import re +import copy from x2gobroker.defaults import X2GOBROKER_LATEST_UCCS_API_VERSION as latest_api_version @@ -28,9 +30,16 @@ def convert_to_builtin_type(obj): Used for doing JSON dumps. """ - d = { } - d.update(obj.__dict__) - return d + d_obj = { } + d_obj.update(obj.__dict__) + + d_obj_res = copy.deepcopy(d_obj) + # hide private object items (starting with "_") from the resulting dict + for key, val in d_obj.items(): + if re.match("^_[a-zA-Z]{1}.*", key): + del d_obj_res[key] + + return d_obj_res class ManagementServer(): """\ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git