idl-parser 0.0.2__tar.gz → 0.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,65 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: idl_parser
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: OMG IDL Parser
5
+
6
+
7
+ """
8
+ idl_parser package example
9
+ """
10
+
11
+ from idl_parser import parser
12
+ parser_ = parser.IDLParser()
13
+ idl_str = """
14
+ module my_module {
15
+ struct Time {
16
+ long sec;
17
+ long usec;
18
+ };
19
+
20
+ typedef sequence<double> DoubleSeq;
21
+
22
+ struct TimedDoubleSeq {
23
+ Time tm;
24
+ DoubleSeq data;
25
+ };
26
+
27
+ enum RETURN_VALUE {
28
+ RETURN_OK,
29
+ RETURN_FAILED,
30
+ };
31
+
32
+ interface DataGetter {
33
+ RETURN_VALUE getData(out TimedDoubleSeq data);
34
+ };
35
+
36
+ };
37
+ """
38
+
39
+ global_module = parser_.load(idl_str)
40
+ my_module = global_module.module_by_name('my_module')
41
+ dataGetter = my_module.interface_by_name('DataGetter')
42
+ print 'DataGetter interface'
43
+ for m in dataGetter.methods:
44
+ print '- method:'
45
+ print ' name:', m.name
46
+ print ' returns:', m.returns.name
47
+ print ' arguments:'
48
+ for a in m.arguments:
49
+ print ' name:', a.name
50
+ print ' type:', a.type
51
+ print ' direction:', a.direction
52
+
53
+ doubleSeq = my_module.typedef_by_name('DoubleSeq')
54
+ print 'typedef %s %s' % (doubleSeq.type.name, doubleSeq.name)
55
+
56
+ timedDoubleSeq = my_module.struct_by_name('TimedDoubleSeq')
57
+ print 'TimedDoubleSeq'
58
+ for m in timedDoubleSeq.members:
59
+ print '- member:'
60
+ print ' name:', m.name
61
+ print ' type:', m.type.name
62
+
5
63
  Home-page: http://www.sugarsweetrobotics.com/
6
64
  Author: ysuga
7
65
  Author-email: ysuga@ysuga.net
@@ -1,7 +1,65 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: idl-parser
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: OMG IDL Parser
5
+
6
+
7
+ """
8
+ idl_parser package example
9
+ """
10
+
11
+ from idl_parser import parser
12
+ parser_ = parser.IDLParser()
13
+ idl_str = """
14
+ module my_module {
15
+ struct Time {
16
+ long sec;
17
+ long usec;
18
+ };
19
+
20
+ typedef sequence<double> DoubleSeq;
21
+
22
+ struct TimedDoubleSeq {
23
+ Time tm;
24
+ DoubleSeq data;
25
+ };
26
+
27
+ enum RETURN_VALUE {
28
+ RETURN_OK,
29
+ RETURN_FAILED,
30
+ };
31
+
32
+ interface DataGetter {
33
+ RETURN_VALUE getData(out TimedDoubleSeq data);
34
+ };
35
+
36
+ };
37
+ """
38
+
39
+ global_module = parser_.load(idl_str)
40
+ my_module = global_module.module_by_name('my_module')
41
+ dataGetter = my_module.interface_by_name('DataGetter')
42
+ print 'DataGetter interface'
43
+ for m in dataGetter.methods:
44
+ print '- method:'
45
+ print ' name:', m.name
46
+ print ' returns:', m.returns.name
47
+ print ' arguments:'
48
+ for a in m.arguments:
49
+ print ' name:', a.name
50
+ print ' type:', a.type
51
+ print ' direction:', a.direction
52
+
53
+ doubleSeq = my_module.typedef_by_name('DoubleSeq')
54
+ print 'typedef %s %s' % (doubleSeq.type.name, doubleSeq.name)
55
+
56
+ timedDoubleSeq = my_module.struct_by_name('TimedDoubleSeq')
57
+ print 'TimedDoubleSeq'
58
+ for m in timedDoubleSeq.members:
59
+ print '- member:'
60
+ print ' name:', m.name
61
+ print ' type:', m.type.name
62
+
5
63
  Home-page: http://www.sugarsweetrobotics.com/
6
64
  Author: ysuga
7
65
  Author-email: ysuga@ysuga.net
@@ -62,11 +62,11 @@ for m in timedDoubleSeq.members:
62
62
  '''
63
63
 
64
64
  setup(name='idl_parser',
65
- version='0.0.2',
65
+ version='0.0.3',
66
66
  url = 'http://www.sugarsweetrobotics.com/',
67
67
  author = 'ysuga',
68
68
  author_email = 'ysuga@ysuga.net',
69
- description = 'OMG IDL Parser',
69
+ description = 'OMG IDL Parser\n\n' + long_description,
70
70
  long_description = long_description,
71
71
  download_url = 'https://github.com/sugarsweetrobotics/idl_parser',
72
72
  packages = ["idl_parser"],
File without changes