Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LabComm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Blomdell
LabComm
Commits
1301ffcd
Commit
1301ffcd
authored
11 years ago
by
Anders Blomdell
Browse files
Options
Downloads
Patches
Plain Diff
Simplified anonymous_object by inheriting dict.
parent
fc942c4d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/python/labcomm/LabComm.py
+3
-18
3 additions, 18 deletions
lib/python/labcomm/LabComm.py
with
3 additions
and
18 deletions
lib/python/labcomm/LabComm.py
+
3
−
18
View file @
1301ffcd
...
...
@@ -468,34 +468,19 @@ TYPEDEF = typedef(None, None)
ARRAY
=
array
(
None
,
None
)
STRUCT
=
struct
({})
class
anonymous_object
(
object
):
def
__init__
(
self
):
self
.
_attr
=
{}
class
anonymous_object
(
dict
):
def
__setattr__
(
self
,
name
,
value
):
if
name
.
startswith
(
"
_
"
):
super
(
anonymous_object
,
self
).
__setattr__
(
name
,
value
)
else
:
self
.
_attr
[
name
]
=
value
self
[
name
]
=
value
def
__getattr__
(
self
,
name
):
if
name
.
startswith
(
"
_
"
):
return
super
(
anonymous_object
,
self
).
__getattr__
(
name
)
else
:
return
self
.
_attr
[
name
]
def
__getattribute__
(
self
,
name
):
if
name
.
startswith
(
"
_
"
):
return
super
(
anonymous_object
,
self
).
__getattribute__
(
name
)
else
:
return
self
.
_attr
[
name
]
def
__iter__
(
self
):
return
self
.
_attr
.
iteritems
()
return
self
[
name
]
def
__repr__
(
self
):
return
self
.
_attr
.
__repr__
()
class
Codec
(
object
):
def
__init__
(
self
):
self
.
type_to_name
=
{}
...
...
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