Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
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
schwede
openstructure
Commits
d607dbbb
Commit
d607dbbb
authored
14 years ago
by
Marco Biasini
Committed by
Ansgar Philippsen
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
added glob-style access to GfxNodes
parent
b2198605
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/gfx/pymod/__init__.py
+3
-8
3 additions, 8 deletions
modules/gfx/pymod/__init__.py
with
3 additions
and
8 deletions
modules/gfx/pymod/__init__.py
+
3
−
8
View file @
d607dbbb
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# This file is part of the OpenStructure project <www.openstructure.org>
# This file is part of the OpenStructure project <www.openstructure.org>
#
#
# Copyright (C) 2008-201
1
by the OpenStructure authors
# Copyright (C) 2008-201
0
by the OpenStructure authors
#
#
# This library is free software; you can redistribute it and/or modify it under
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# the terms of the GNU Lesser General Public License as published by the Free
...
@@ -141,7 +141,7 @@ def FitToScreen(gfx_ent, width=None, height=None, margin=0.01):
...
@@ -141,7 +141,7 @@ def FitToScreen(gfx_ent, width=None, height=None, margin=0.01):
scene
.
SetRTC
(
rtc
)
scene
.
SetRTC
(
rtc
)
class
GfxNodeListAttrProxy
(
object
)
:
class
GfxNodeListAttrProxy
:
def
__init__
(
self
,
node_list
,
name
):
def
__init__
(
self
,
node_list
,
name
):
self
.
_node_list
=
node_list
self
.
_node_list
=
node_list
self
.
_name
=
name
self
.
_name
=
name
...
@@ -164,11 +164,6 @@ class GfxNodeListProxy(object):
...
@@ -164,11 +164,6 @@ class GfxNodeListProxy(object):
return
super
(
GfxNodeListProxy
,
self
).
__getattr__
(
name
)
return
super
(
GfxNodeListProxy
,
self
).
__getattr__
(
name
)
return
GfxNodeListAttrProxy
(
self
.
_nodes
,
name
)
return
GfxNodeListAttrProxy
(
self
.
_nodes
,
name
)
def
__dir__
(
self
):
if
len
(
self
.
_nodes
)
==
0
:
return
dir
(
None
)
return
dir
(
self
.
_nodes
[
0
])
def
__setattr__
(
self
,
name
,
value
):
def
__setattr__
(
self
,
name
,
value
):
if
name
.
startswith
(
'
_
'
):
if
name
.
startswith
(
'
_
'
):
super
(
GfxNodeListProxy
,
self
).
__setattr__
(
name
,
value
)
super
(
GfxNodeListProxy
,
self
).
__setattr__
(
name
,
value
)
...
@@ -188,4 +183,4 @@ def _Match(scene, pattern="*"):
...
@@ -188,4 +183,4 @@ def _Match(scene, pattern="*"):
return
matches
return
matches
return
GfxNodeListProxy
(
_Recurse
(
""
,
Scene
().
root_node
,
pattern
))
return
GfxNodeListProxy
(
_Recurse
(
""
,
Scene
().
root_node
,
pattern
))
SceneSingleton
.
Match
=
_Match
SceneSingleton
.
__getitem__
=
_Match
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