revisit 0.0.7__tar.gz → 0.0.8__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {revisit-0.0.7 → revisit-0.0.8}/PKG-INFO +1 -1
- {revisit-0.0.7 → revisit-0.0.8}/pyproject.toml +1 -1
- {revisit-0.0.7 → revisit-0.0.8}/src/revisit/revisit.py +20 -3
- {revisit-0.0.7 → revisit-0.0.8}/.gitignore +0 -0
- {revisit-0.0.7 → revisit-0.0.8}/README.md +0 -0
- {revisit-0.0.7 → revisit-0.0.8}/src/revisit/__init__.py +0 -0
- {revisit-0.0.7 → revisit-0.0.8}/src/revisit/models.py +0 -0
- {revisit-0.0.7 → revisit-0.0.8}/src/revisit/static/widget.css +0 -0
- {revisit-0.0.7 → revisit-0.0.8}/src/revisit/static/widget.js +0 -0
- {revisit-0.0.7 → revisit-0.0.8}/src/revisit/widget.py +0 -0
@@ -58,6 +58,9 @@ class _WrappedResponse(_JSONableBaseModel):
|
|
58
58
|
self.root = _validate_response(self.root.__dict__)
|
59
59
|
return self
|
60
60
|
|
61
|
+
def clone(self):
|
62
|
+
return response(**self.root.__dict__)
|
63
|
+
|
61
64
|
|
62
65
|
# Private
|
63
66
|
class _WrappedComponent(_JSONableBaseModel):
|
@@ -85,9 +88,20 @@ class _WrappedComponent(_JSONableBaseModel):
|
|
85
88
|
return None
|
86
89
|
|
87
90
|
def edit_response(self, id: str, **kwargs) -> _WrappedComponent:
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
+
print(self.root.response)
|
92
|
+
for r in self.root.response:
|
93
|
+
if r.root.id == id:
|
94
|
+
# Get dict
|
95
|
+
response_dict = r.root.__dict__
|
96
|
+
# Create new response
|
97
|
+
new_response = response(**response_dict)
|
98
|
+
# Set with new values
|
99
|
+
new_response.set(**kwargs)
|
100
|
+
# Filter out old response
|
101
|
+
self.root.response = [_r for _r in self.root.response if _r.root.id != id]
|
102
|
+
# Add new response
|
103
|
+
self.root.response.append(new_response)
|
104
|
+
# Return component
|
91
105
|
return self
|
92
106
|
|
93
107
|
raise ValueError('No response with given ID found.')
|
@@ -105,6 +119,9 @@ class _WrappedComponent(_JSONableBaseModel):
|
|
105
119
|
|
106
120
|
return self
|
107
121
|
|
122
|
+
def clone(self, component_name__):
|
123
|
+
return component(**self.root.__dict__, component_name__=component_name__)
|
124
|
+
|
108
125
|
|
109
126
|
class _WrappedStudyMetadata(_JSONableBaseModel):
|
110
127
|
root: rvt_models.StudyMetadata
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|