|
@@ -280,6 +280,29 @@ def model_list_full():
|
|
|
lst.append((m, mm, own, grp, perm))
|
|
|
return lst
|
|
|
|
|
|
+def verify(model):
|
|
|
+ """Verify if a model conforms to its metamodel."""
|
|
|
+ # return "verification_result"
|
|
|
+ # raises UnknownError
|
|
|
+ # raises UnknownModel
|
|
|
+ if mode != 2:
|
|
|
+ raise InvalidMode()
|
|
|
+ _input("verify")
|
|
|
+ _output("Which model to verify?")
|
|
|
+ _input(model)
|
|
|
+ if _output() == "Verifying model...":
|
|
|
+ result = _output()
|
|
|
+ _output("Ready for command...")
|
|
|
+ return result
|
|
|
+ elif _last_output() == "Permission denied":
|
|
|
+ _output("Ready for command...")
|
|
|
+ raise PermissionDenied()
|
|
|
+ elif _last_output() == "No such model":
|
|
|
+ _output("Ready for command...")
|
|
|
+ raise UnknownModel()
|
|
|
+ else:
|
|
|
+ raise InterfaceMismatch(_last_output())
|
|
|
+
|
|
|
def model_overwrite(model_name, new_model=None):
|
|
|
"""Upload a new model and overwrite an existing model."""
|
|
|
# return None
|