PyObjectInterface 0.0.1__py3-none-any.whl → 0.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,9 +58,11 @@ def create_WebController(obj, name, flask_app, recursion_depth = 5, create_priva
58
58
  @flask_app.route(baseurl + '/call_method/<stack>', endpoint=baseurl + '_call_method')
59
59
  def call_method(stack):
60
60
  kwargs = {argname: int(arg) for argname, arg in flask.request.args.items()} #TODO - better kwarg handling
61
- poi.call_method(stack, kwargs)
62
- # TODO - handle return value
63
- return "OK"
61
+ retval = poi.call_method(stack, kwargs)
62
+ if retval is None:
63
+ return "OK"
64
+ else:
65
+ return retval
64
66
 
65
67
  @flask_app.route(baseurl + '/get_attributes', endpoint=baseurl + '_get_attributes')
66
68
  def get_attributes():
@@ -72,7 +72,7 @@ class PyObjectInterface:
72
72
  if not method_stack.startswith(self.base_obj_name + '.'):
73
73
  raise Exception(f"Attempted to call {self.base_obj_name=} with {method_stack=}")
74
74
 
75
- method_name = method_stack.removeprefix(self.base_obj_name + '.')
75
+ method_name = method_stack[len(self.base_obj_name + '.'):] #rm prefix
76
76
  if '.' in method_name:
77
77
  obj_name = method_name.split('.')[0]
78
78
  return self.subobj_dict[obj_name].call_method(method_stack, kwargs)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyObjectInterface
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Summary: Create a web interface to interact with a class
5
5
  Home-page: https://github.com/RobertJN64/PyObjectInterface
6
6
  Author: Robert Nies
@@ -18,6 +18,7 @@ Requires-Python: >=3.8
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
20
  Requires-Dist: typing-extensions
21
+ Requires-Dist: flask
21
22
 
22
23
  # PyObjectInterface
23
24
 
@@ -0,0 +1,8 @@
1
+ PyObjectInterface/WebController.py,sha256=_7J3iHyEvG4sttKYkr1w9pGcLDk8PI15MM7IGCWXeDA,3154
2
+ PyObjectInterface/__init__.py,sha256=4524Z5al5Bwx4EsmPW7UldGaexNUMGCv0cldb3uobuQ,3674
3
+ PyObjectInterface/web_controller.tpl.html,sha256=hc77J32kMO3S9EQ3VofI9bCO_0m8yCavROxWc1MmHmw,2361
4
+ PyObjectInterface-0.0.2.dist-info/LICENSE,sha256=_UXYaTVmtWrJCpKEgCz66EUsoFfLfn0CY4mEmuI5_zA,1054
5
+ PyObjectInterface-0.0.2.dist-info/METADATA,sha256=lyl0iU6MlOqCHNjuAHgwv973_ucVFa3KvgeB98ERCA8,1097
6
+ PyObjectInterface-0.0.2.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
7
+ PyObjectInterface-0.0.2.dist-info/top_level.txt,sha256=5kOSl8l5D5IGWoWz9nkn_lQispA3D8qyPM9SvIC4LSU,18
8
+ PyObjectInterface-0.0.2.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- PyObjectInterface/WebController.py,sha256=lQ10M9BO57Z0Lei-p_LkASKqQr1X1AHlN-ehg1Peow4,3104
2
- PyObjectInterface/__init__.py,sha256=Vr6AS1-cGjrqeJATqgMxVWTfFxWedJeshx1eH6T938A,3670
3
- PyObjectInterface/web_controller.tpl.html,sha256=hc77J32kMO3S9EQ3VofI9bCO_0m8yCavROxWc1MmHmw,2361
4
- PyObjectInterface-0.0.1.dist-info/LICENSE,sha256=_UXYaTVmtWrJCpKEgCz66EUsoFfLfn0CY4mEmuI5_zA,1054
5
- PyObjectInterface-0.0.1.dist-info/METADATA,sha256=GcCUadpjePspLye0_6z7wckKVL_MufVX7Z7btvHvokI,1076
6
- PyObjectInterface-0.0.1.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
7
- PyObjectInterface-0.0.1.dist-info/top_level.txt,sha256=5kOSl8l5D5IGWoWz9nkn_lQispA3D8qyPM9SvIC4LSU,18
8
- PyObjectInterface-0.0.1.dist-info/RECORD,,