Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
finesse
pykat
Commits
01841b0f
Commit
01841b0f
authored
Apr 10, 2015
by
Daniel Brown
Browse files
adding in param weakref refreshing
parent
b70b028d
Changes
2
Hide whitespace changes
Inline
Side-by-side
pykat/components.py
View file @
01841b0f
...
...
@@ -198,7 +198,20 @@ class Component(object):
del
self
.
_params
[:]
self
.
__removed
=
True
def
__deepcopy__
(
self
,
memo
):
cls
=
self
.
__class__
result
=
cls
.
__new__
(
cls
)
memo
[
id
(
self
)]
=
result
for
k
,
v
in
self
.
__dict__
.
items
():
setattr
(
result
,
k
,
deepcopy
(
v
,
memo
))
for
p
in
result
.
_params
:
p
.
_updateOwner
(
result
)
return
result
class
AbstractMirrorComponent
(
Component
):
__metaclass__
=
abc
.
ABCMeta
...
...
pykat/param.py
View file @
01841b0f
...
...
@@ -87,6 +87,15 @@ class Param(putable, putter):
putter
.
__init__
(
self
,
var_name
,
isPutter
)
putable
.
__init__
(
self
,
owner
.
name
,
name
,
isPutable
)
def
_updateOwner
(
self
,
newOwner
):
"""
This updates the internal weak reference to link a parameter to who owns it.
Should only be called by the __deepcopy__ component method to ensure things
are kept up to date.
"""
del
self
.
_owner
self
.
_owner
=
weakref
.
ref
(
newOwner
)
@
property
def
canFsig
(
self
):
return
self
.
_canFsig
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment