Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
ipaaca
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ramin Yaghoubzadeh Torky
ipaaca
Commits
6b753ba4
Commit
6b753ba4
authored
12 years ago
by
Hendrik Buschmeier
Browse files
Options
Downloads
Patches
Plain Diff
IU_uids are now created upon IU creation (for local IUs).
parent
7d534472
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/src/ipaaca.py
+14
-11
14 additions, 11 deletions
python/src/ipaaca.py
with
14 additions
and
11 deletions
python/src/ipaaca.py
+
14
−
11
View file @
6b753ba4
...
@@ -295,6 +295,7 @@ class IU(IUInterface):#{{{
...
@@ -295,6 +295,7 @@ class IU(IUInterface):#{{{
def
__init__
(
self
,
category
=
'
undef
'
,
access_mode
=
IUAccessMode
.
PUSH
,
read_only
=
False
,
_payload_type
=
'
MAP
'
):
def
__init__
(
self
,
category
=
'
undef
'
,
access_mode
=
IUAccessMode
.
PUSH
,
read_only
=
False
,
_payload_type
=
'
MAP
'
):
super
(
IU
,
self
).
__init__
(
uid
=
None
,
access_mode
=
access_mode
,
read_only
=
read_only
)
super
(
IU
,
self
).
__init__
(
uid
=
None
,
access_mode
=
access_mode
,
read_only
=
read_only
)
self
.
_revision
=
1
self
.
_revision
=
1
self
.
uid
=
str
(
uuid
.
uuid4
())
self
.
_category
=
category
self
.
_category
=
category
self
.
_payload_type
=
_payload_type
self
.
_payload_type
=
_payload_type
self
.
revision_lock
=
threading
.
RLock
()
self
.
revision_lock
=
threading
.
RLock
()
...
@@ -391,7 +392,7 @@ class IU(IUInterface):#{{{
...
@@ -391,7 +392,7 @@ class IU(IUInterface):#{{{
uid
=
property
(
uid
=
property
(
fget
=
IUInterface
.
_get_uid
,
fget
=
IUInterface
.
_get_uid
,
fset
=
_set_uid
,
fset
=
_set_uid
,
doc
=
'
Unique ID of theIU.
'
)
doc
=
'
Unique ID of the
IU.
'
)
#}}}
#}}}
...
@@ -939,7 +940,7 @@ class OutputBuffer(Buffer):
...
@@ -939,7 +940,7 @@ class OutputBuffer(Buffer):
self
.
_informer_store
=
{}
self
.
_informer_store
=
{}
self
.
_id_prefix
=
str
(
owning_component_name
)
+
'
-
'
+
str
(
self
.
_uuid
)
+
'
-IU-
'
self
.
_id_prefix
=
str
(
owning_component_name
)
+
'
-
'
+
str
(
self
.
_uuid
)
+
'
-IU-
'
self
.
__iu_id_counter_lock
=
threading
.
Lock
()
self
.
__iu_id_counter_lock
=
threading
.
Lock
()
self
.
__iu_id_counter
=
0
#
self.__iu_id_counter = 0
# hbuschme: IUs now have their Ids assigned on creation
def
_create_own_name_listener
(
self
,
iu_category
):
def
_create_own_name_listener
(
self
,
iu_category
):
# FIXME replace this
# FIXME replace this
...
@@ -952,12 +953,13 @@ class OutputBuffer(Buffer):
...
@@ -952,12 +953,13 @@ class OutputBuffer(Buffer):
#logger.info("Added category listener for "+iu_category)
#logger.info("Added category listener for "+iu_category)
#return cat_listener
#return cat_listener
def
_generate_iu_uid
(
self
):
# hbuschme: IUs now have their Ids assigned on creation
'''
Generate a unique IU id of the form
'''
#def _generate_iu_uid(self):
with
self
.
__iu_id_counter_lock
:
# '''Generate a unique IU id of the form ????'''
self
.
__iu_id_counter
+=
1
# with self.__iu_id_counter_lock:
number
=
self
.
__iu_id_counter
# self.__iu_id_counter += 1
return
self
.
_id_prefix
+
str
(
number
)
# number = self.__iu_id_counter
# return self._id_prefix + str(number)
def
_remote_update_links
(
self
,
update
):
def
_remote_update_links
(
self
,
update
):
'''
Apply a remotely requested update to one of the stored IU
'
s links.
'''
'''
Apply a remotely requested update to one of the stored IU
'
s links.
'''
...
@@ -1032,9 +1034,10 @@ class OutputBuffer(Buffer):
...
@@ -1032,9 +1034,10 @@ class OutputBuffer(Buffer):
def
add
(
self
,
iu
):
def
add
(
self
,
iu
):
'''
Add an IU to the IU store, assign an ID and publish it.
'''
'''
Add an IU to the IU store, assign an ID and publish it.
'''
if
iu
.
_uid
is
not
None
:
# hbuschme: IUs now have their Ids assigned on creation
raise
IUPublishedError
(
iu
)
#if iu._uid is not None:
iu
.
uid
=
self
.
_generate_iu_uid
()
# raise IUPublishedError(iu)
#iu.uid = self._generate_iu_uid()
self
.
_iu_store
[
iu
.
_uid
]
=
iu
self
.
_iu_store
[
iu
.
_uid
]
=
iu
iu
.
buffer
=
self
iu
.
buffer
=
self
self
.
_publish_iu
(
iu
)
self
.
_publish_iu
(
iu
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment