|
|
@ -1,5 +1,6 @@
|
|
|
|
class Editable:
|
|
|
|
class Editable:
|
|
|
|
def make_copy(self):
|
|
|
|
def make_copy(self):
|
|
|
|
|
|
|
|
# makes an internal copy of self
|
|
|
|
# delete old copy
|
|
|
|
# delete old copy
|
|
|
|
if hasattr(self, "_copy"):
|
|
|
|
if hasattr(self, "_copy"):
|
|
|
|
if self._copy is not None:
|
|
|
|
if self._copy is not None:
|
|
|
@ -9,6 +10,7 @@ class Editable:
|
|
|
|
self._copy = JSON.parse(JSON.stringify(self))
|
|
|
|
self._copy = JSON.parse(JSON.stringify(self))
|
|
|
|
|
|
|
|
|
|
|
|
def copy(self):
|
|
|
|
def copy(self):
|
|
|
|
|
|
|
|
# return internal copy of self
|
|
|
|
# check if even initialized
|
|
|
|
# check if even initialized
|
|
|
|
if hasattr(self, "_copy"):
|
|
|
|
if hasattr(self, "_copy"):
|
|
|
|
return self._copy
|
|
|
|
return self._copy
|
|
|
|