Skip to content

Add feature to define findings manually in the model, similar to over… #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Code cleanup, removed unnecessary condition.
  • Loading branch information
nozmore-vera committed Oct 12, 2021
commit 34959b68ce51d5771d1caae26a08ed6e975b8c0f
11 changes: 4 additions & 7 deletions pytm/pytm.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,12 @@ def __set__(self, instance, value):
# called when x.d = val
# instance = x
# value = val

if instance in self.data:
if (not isinstance(instance, Finding)):
raise ValueError(
"cannot overwrite {}.{} value with {}, already set to {}".format(
instance, self.__class__.__name__, value, self.data[instance]
)
raise ValueError(
"cannot overwrite {}.{} value with {}, already set to {}".format(
instance, self.__class__.__name__, value, self.data[instance]
)

)
self.data[instance] = value
if self.onSet is not None:
self.onSet(instance, value)
Expand Down