@@ -460,7 +460,7 @@ def __init__(self, client, db):
460460 # would include too many actions that do not make sense in the
461461 # REST-API context, so for now we only permit the retire and
462462 # restore actions.
463- self .actions = dict ( retire = actions .Retire , restore = actions .Restore )
463+ self .actions = { " retire" : actions .Retire , " restore" : actions .Restore }
464464
465465 # note TRACKER_WEB ends in a /
466466 self .base_path = '%srest' % (self .db .config .TRACKER_WEB )
@@ -731,14 +731,15 @@ def format_item(self, node, item_id, props=None, verbose=1):
731731 if isinstance (v , type ([])):
732732 r = []
733733 for working_id in v :
734- d = dict (id = working_id , link = cp + working_id )
734+ d = {"id" : working_id ,
735+ "link" : cp + working_id }
735736 if verbose > 1 :
736737 label = linkcls .labelprop ()
737738 d [label ] = linkcls .get (working_id , label )
738739 r .append (d )
739740 result [pn ] = r
740741 else :
741- result [pn ] = dict ( id = v , link = cp + v )
742+ result [pn ] = { "id" : v , " link" : cp + v }
742743 if verbose > 1 :
743744 label = linkcls .labelprop ()
744745 result [pn ][label ] = linkcls .get (v , label )
@@ -751,7 +752,7 @@ def format_item(self, node, item_id, props=None, verbose=1):
751752 if verbose < 3 :
752753 u = self .db .config .TRACKER_WEB
753754 p = u + '%s%s/' % (class_name , node .id )
754- result [pn ] = dict ( link = p )
755+ result [pn ] = { " link" : p }
755756 else :
756757 result [pn ] = v
757758 elif isinstance (prop , hyperdb .Password ):
@@ -2028,7 +2029,7 @@ def data(self, input_payload):
20282029 uid = self .db .getuid ()
20292030 for cls in sorted (self .db .classes ):
20302031 if self .db .security .hasPermission ('View' , uid , cls ):
2031- result [cls ] = dict ( link = self .base_path + '/data/' + cls )
2032+ result [cls ] = { " link" : self .base_path + '/data/' + cls }
20322033 return 200 , result
20332034
20342035 @Routing .route ("/data" , 'OPTIONS' )
0 commit comments