@@ -460,7 +460,7 @@ def __init__(self, client, db):
460
460
# would include too many actions that do not make sense in the
461
461
# REST-API context, so for now we only permit the retire and
462
462
# restore actions.
463
- self .actions = dict ( retire = actions .Retire , restore = actions .Restore )
463
+ self .actions = { " retire" : actions .Retire , " restore" : actions .Restore }
464
464
465
465
# note TRACKER_WEB ends in a /
466
466
self .base_path = '%srest' % (self .db .config .TRACKER_WEB )
@@ -731,14 +731,15 @@ def format_item(self, node, item_id, props=None, verbose=1):
731
731
if isinstance (v , type ([])):
732
732
r = []
733
733
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 }
735
736
if verbose > 1 :
736
737
label = linkcls .labelprop ()
737
738
d [label ] = linkcls .get (working_id , label )
738
739
r .append (d )
739
740
result [pn ] = r
740
741
else :
741
- result [pn ] = dict ( id = v , link = cp + v )
742
+ result [pn ] = { "id" : v , " link" : cp + v }
742
743
if verbose > 1 :
743
744
label = linkcls .labelprop ()
744
745
result [pn ][label ] = linkcls .get (v , label )
@@ -751,7 +752,7 @@ def format_item(self, node, item_id, props=None, verbose=1):
751
752
if verbose < 3 :
752
753
u = self .db .config .TRACKER_WEB
753
754
p = u + '%s%s/' % (class_name , node .id )
754
- result [pn ] = dict ( link = p )
755
+ result [pn ] = { " link" : p }
755
756
else :
756
757
result [pn ] = v
757
758
elif isinstance (prop , hyperdb .Password ):
@@ -2028,7 +2029,7 @@ def data(self, input_payload):
2028
2029
uid = self .db .getuid ()
2029
2030
for cls in sorted (self .db .classes ):
2030
2031
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 }
2032
2033
return 200 , result
2033
2034
2034
2035
@Routing .route ("/data" , 'OPTIONS' )
0 commit comments