File tree Expand file tree Collapse file tree 4 files changed +184
-112
lines changed Expand file tree Collapse file tree 4 files changed +184
-112
lines changed Original file line number Diff line number Diff line change
1
+ # TODO(eacousineau): Move all symbols from `.xml_reflection` into here.
2
+ from urdf_parser_py .xml_reflection .basics import *
3
+ from urdf_parser_py .xml_reflection .core import *
Original file line number Diff line number Diff line change
1
+ # TODO(eacousineau): Deprecate public access.
1
2
from urdf_parser_py .xml_reflection .core import *
Original file line number Diff line number Diff line change 1
- import string
2
- import yaml
1
+ # TODO(eacousineau): Deprecate public access.
3
2
import collections
3
+ import string
4
+ # TODO(eacousineau): Leverage tfoote's PR.
5
+ from xml .etree .ElementTree import ElementTree
6
+
4
7
from lxml import etree
8
+ import yaml
9
+
10
+ from urdf_parser_py import _now_private_property
11
+
12
+ __all__ = [
13
+ "xml_string" ,
14
+ "dict_sub" ,
15
+ "node_add" ,
16
+ "pfloat" ,
17
+ "xml_children" ,
18
+ "isstring" ,
19
+ "to_yaml" ,
20
+ "SelectiveReflection" ,
21
+ "YamlReflection" ,
22
+ # Backwards compatibility.
23
+ "etree" ,
24
+ ]
25
+
5
26
6
27
def xml_string (rootXml , addHeader = True ):
7
28
# Meh
@@ -74,13 +95,15 @@ def to_yaml(obj):
74
95
75
96
76
97
class SelectiveReflection (object ):
77
- def get_refl_vars (self ):
98
+ def _get_refl_vars (self ):
78
99
return list (vars (self ).keys ())
79
100
101
+ get_refl_vars = _now_private_property ('_get_refl_vars' )
102
+
80
103
81
104
class YamlReflection (SelectiveReflection ):
82
105
def to_yaml (self ):
83
- raw = dict ((var , getattr (self , var )) for var in self .get_refl_vars ())
106
+ raw = dict ((var , getattr (self , var )) for var in self ._get_refl_vars ())
84
107
return to_yaml (raw )
85
108
86
109
def __str__ (self ):
You can’t perform that action at this time.
0 commit comments