Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic-graph-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Olivier Stasse
dynamic-graph-python
Commits
2caff345
Commit
2caff345
authored
14 years ago
by
florent
Browse files
Options
Downloads
Patches
Plain Diff
Implement a function that creates a python class for for each entity C++ class
* src/dynamic_graph/entity.py.
parent
9ba9c957
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
src/dynamic_graph/entity.py
+26
-0
26 additions, 0 deletions
src/dynamic_graph/entity.py
with
26 additions
and
0 deletions
src/dynamic_graph/entity.py
+
26
−
0
View file @
2caff345
...
...
@@ -5,6 +5,32 @@
"""
import
wrap
,
signal_base
entityList
=
[]
def
initEntity
(
self
,
name
):
"""
Common constructor of Entity classes
"""
Entity
.
__init__
(
self
,
self
.
class_name
,
name
)
def
updateEntityClasses
():
entityTypeList
=
wrap
.
factory_get_entity_class_list
()
for
e
in
entityTypeList
:
class
metacls
(
type
):
def
__new__
(
mcs
,
name
,
bases
,
dict
):
return
type
.
__new__
(
mcs
,
name
,
bases
,
dict
)
# Create new class
a
=
metacls
(
e
,
(
Entity
,),
{})
# Store class name in class member
a
.
class_name
=
e
print
(
"
new class %s
"
%
e
)
# set class constructor
setattr
(
a
,
'
__init__
'
,
initEntity
)
# Store new class in dictionary with class name
globals
()[
e
]
=
a
class
Entity
(
object
)
:
"""
This class binds dynamicgraph::Entity C++ class
...
...
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