rustorb-omniorb-compat 0.1.0__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.
@@ -0,0 +1,8 @@
1
+ """``CORBA``, as omniORBpy installs it at the top level: the module of
2
+ rustorb itself (``rustorb.CORBA``)."""
3
+
4
+ import sys
5
+
6
+ import rustorb.CORBA
7
+
8
+ sys.modules[__name__] = rustorb.CORBA
@@ -0,0 +1,17 @@
1
+ # Generated by rustorb-idl. Do not edit.
2
+ #
3
+ # This file is not covered by the license of rustorb-idl.
4
+
5
+ """IDL module CosNaming."""
6
+
7
+ import importlib as _0_importlib
8
+ import sys as _0_sys
9
+
10
+ import rustorb._rt as _0_rt
11
+
12
+ _0_rt.bind_package(_0_sys.modules[__name__])
13
+
14
+ # rustorb-idl: sub-modules
15
+ # rustorb-idl: files
16
+ import CosNaming_idl
17
+ # rustorb-idl: end
@@ -0,0 +1,110 @@
1
+ # Generated by rustorb-idl. Do not edit.
2
+ #
3
+ # This file is not covered by the license of rustorb-idl.
4
+
5
+ # rustorb-idl: begin CosNaming.idl
6
+ from typing import Any, List, Optional, Tuple
7
+
8
+ from rustorb import CORBA, PortableServer
9
+ from rustorb._types import Enum as _Enum, EnumItem as _EnumItem, Struct as _Struct, Union as _Union
10
+
11
+ class Istring:
12
+ _NP_RepositoryId: str
13
+ _tc_Istring: CORBA.TypeCode
14
+ class NameComponent(_Struct):
15
+ _NP_RepositoryId: str
16
+ id: str
17
+ kind: str
18
+ def __init__(self, id: str, kind: str) -> None: ...
19
+ _tc_NameComponent: CORBA.TypeCode
20
+ class Name:
21
+ _NP_RepositoryId: str
22
+ _tc_Name: CORBA.TypeCode
23
+ BindingType: _Enum
24
+ nobject: _EnumItem
25
+ ncontext: _EnumItem
26
+ _tc_BindingType: CORBA.TypeCode
27
+ class Binding(_Struct):
28
+ _NP_RepositoryId: str
29
+ binding_name: List[NameComponent]
30
+ binding_type: _EnumItem
31
+ def __init__(self, binding_name: List[NameComponent], binding_type: _EnumItem) -> None: ...
32
+ _tc_Binding: CORBA.TypeCode
33
+ class BindingList:
34
+ _NP_RepositoryId: str
35
+ _tc_BindingList: CORBA.TypeCode
36
+ class NamingContext:
37
+ _NP_RepositoryId: str
38
+ _nil: None
39
+ NotFoundReason: _Enum
40
+ missing_node: _EnumItem
41
+ not_context: _EnumItem
42
+ not_object: _EnumItem
43
+ _tc_NotFoundReason: CORBA.TypeCode
44
+ class NotFound(CORBA.UserException):
45
+ _NP_RepositoryId: str
46
+ why: _EnumItem
47
+ rest_of_name: List[NameComponent]
48
+ def __init__(self, why: _EnumItem, rest_of_name: List[NameComponent]) -> None: ...
49
+ _tc_NotFound: CORBA.TypeCode
50
+ class CannotProceed(CORBA.UserException):
51
+ _NP_RepositoryId: str
52
+ cxt: Optional[NamingContext]
53
+ rest_of_name: List[NameComponent]
54
+ def __init__(self, cxt: Optional[NamingContext], rest_of_name: List[NameComponent]) -> None: ...
55
+ _tc_CannotProceed: CORBA.TypeCode
56
+ class InvalidName(CORBA.UserException):
57
+ _NP_RepositoryId: str
58
+ def __init__(self) -> None: ...
59
+ _tc_InvalidName: CORBA.TypeCode
60
+ class AlreadyBound(CORBA.UserException):
61
+ _NP_RepositoryId: str
62
+ def __init__(self) -> None: ...
63
+ _tc_AlreadyBound: CORBA.TypeCode
64
+ class NotEmpty(CORBA.UserException):
65
+ _NP_RepositoryId: str
66
+ def __init__(self) -> None: ...
67
+ _tc_NotEmpty: CORBA.TypeCode
68
+ def bind(self, n: List[NameComponent], obj: Optional[CORBA.Object]) -> None: ...
69
+ def rebind(self, n: List[NameComponent], obj: Optional[CORBA.Object]) -> None: ...
70
+ def bind_context(self, n: List[NameComponent], nc: Optional[NamingContext]) -> None: ...
71
+ def rebind_context(self, n: List[NameComponent], nc: Optional[NamingContext]) -> None: ...
72
+ def resolve(self, n: List[NameComponent]) -> Optional[CORBA.Object]: ...
73
+ def unbind(self, n: List[NameComponent]) -> None: ...
74
+ def new_context(self) -> Optional[NamingContext]: ...
75
+ def bind_new_context(self, n: List[NameComponent]) -> Optional[NamingContext]: ...
76
+ def destroy(self) -> None: ...
77
+ def list(self, how_many: int) -> Tuple[List[Binding], Optional[BindingIterator]]: ...
78
+ class _objref_NamingContext(NamingContext, CORBA.Object): ...
79
+ _tc_NamingContext: CORBA.TypeCode
80
+ class BindingIterator:
81
+ _NP_RepositoryId: str
82
+ _nil: None
83
+ def next_one(self) -> Tuple[bool, Binding]: ...
84
+ def next_n(self, how_many: int) -> Tuple[bool, List[Binding]]: ...
85
+ def destroy(self) -> None: ...
86
+ class _objref_BindingIterator(BindingIterator, CORBA.Object): ...
87
+ _tc_BindingIterator: CORBA.TypeCode
88
+ class NamingContextExt(NamingContext):
89
+ _NP_RepositoryId: str
90
+ _nil: None
91
+ class StringName:
92
+ _NP_RepositoryId: str
93
+ _tc_StringName: CORBA.TypeCode
94
+ class Address:
95
+ _NP_RepositoryId: str
96
+ _tc_Address: CORBA.TypeCode
97
+ class URLString:
98
+ _NP_RepositoryId: str
99
+ _tc_URLString: CORBA.TypeCode
100
+ class InvalidAddress(CORBA.UserException):
101
+ _NP_RepositoryId: str
102
+ def __init__(self) -> None: ...
103
+ _tc_InvalidAddress: CORBA.TypeCode
104
+ def to_string(self, n: List[NameComponent]) -> str: ...
105
+ def to_name(self, sn: str) -> List[NameComponent]: ...
106
+ def to_url(self, addr: str, sn: str) -> str: ...
107
+ def resolve_str(self, n: str) -> Optional[CORBA.Object]: ...
108
+ class _objref_NamingContextExt(NamingContextExt, _objref_NamingContext, CORBA.Object): ...
109
+ _tc_NamingContextExt: CORBA.TypeCode
110
+ # rustorb-idl: end CosNaming.idl
@@ -0,0 +1,17 @@
1
+ # Generated by rustorb-idl. Do not edit.
2
+ #
3
+ # This file is not covered by the license of rustorb-idl.
4
+
5
+ """IDL module CosNaming."""
6
+
7
+ import importlib as _0_importlib
8
+ import sys as _0_sys
9
+
10
+ import rustorb._rt as _0_rt
11
+
12
+ _0_rt.bind_package(_0_sys.modules[__name__])
13
+
14
+ # rustorb-idl: sub-modules
15
+ # rustorb-idl: files
16
+ import CosNaming_idl
17
+ # rustorb-idl: end
@@ -0,0 +1,35 @@
1
+ # Generated by rustorb-idl. Do not edit.
2
+ #
3
+ # This file is not covered by the license of rustorb-idl.
4
+
5
+ # rustorb-idl: begin CosNaming.idl
6
+ from typing import Any, List, Optional, Tuple
7
+
8
+ from rustorb import CORBA, PortableServer
9
+ from rustorb._types import Enum as _Enum, EnumItem as _EnumItem, Struct as _Struct, Union as _Union
10
+ import CosNaming
11
+
12
+ class NamingContext(PortableServer.Servant):
13
+ _NP_RepositoryId: str
14
+ def bind(self, n: List[CosNaming.NameComponent], obj: Optional[CORBA.Object]) -> None: ...
15
+ def rebind(self, n: List[CosNaming.NameComponent], obj: Optional[CORBA.Object]) -> None: ...
16
+ def bind_context(self, n: List[CosNaming.NameComponent], nc: Optional[CosNaming.NamingContext]) -> None: ...
17
+ def rebind_context(self, n: List[CosNaming.NameComponent], nc: Optional[CosNaming.NamingContext]) -> None: ...
18
+ def resolve(self, n: List[CosNaming.NameComponent]) -> Optional[CORBA.Object]: ...
19
+ def unbind(self, n: List[CosNaming.NameComponent]) -> None: ...
20
+ def new_context(self) -> Optional[CosNaming.NamingContext]: ...
21
+ def bind_new_context(self, n: List[CosNaming.NameComponent]) -> Optional[CosNaming.NamingContext]: ...
22
+ def destroy(self) -> None: ...
23
+ def list(self, how_many: int) -> Tuple[List[CosNaming.Binding], Optional[CosNaming.BindingIterator]]: ...
24
+ class BindingIterator(PortableServer.Servant):
25
+ _NP_RepositoryId: str
26
+ def next_one(self) -> Tuple[bool, CosNaming.Binding]: ...
27
+ def next_n(self, how_many: int) -> Tuple[bool, List[CosNaming.Binding]]: ...
28
+ def destroy(self) -> None: ...
29
+ class NamingContextExt(NamingContext):
30
+ _NP_RepositoryId: str
31
+ def to_string(self, n: List[CosNaming.NameComponent]) -> str: ...
32
+ def to_name(self, sn: str) -> List[CosNaming.NameComponent]: ...
33
+ def to_url(self, addr: str, sn: str) -> str: ...
34
+ def resolve_str(self, n: str) -> Optional[CORBA.Object]: ...
35
+ # rustorb-idl: end CosNaming.idl
@@ -0,0 +1,409 @@
1
+ # Generated by rustorb-idl from CosNaming.idl. Do not edit.
2
+ #
3
+ # This file is not covered by the license of rustorb-idl.
4
+
5
+ """Definitions of CosNaming.idl."""
6
+
7
+ import rustorb._rt as _0_rt
8
+ from rustorb import CORBA as _0_CORBA
9
+ from rustorb import PortableServer as _0_PortableServer
10
+
11
+ _0_rt.check_version(1)
12
+
13
+ _0_CosNaming = _0_rt.open_module("CosNaming", __file__)
14
+ _0_CosNaming__POA = _0_rt.open_module("CosNaming__POA", __file__)
15
+
16
+ # typedef Istring
17
+ class Istring(_0_rt.Typedef):
18
+ __module__ = "CosNaming"
19
+ __qualname__ = "Istring"
20
+ _NP_RepositoryId = "IDL:omg.org/CosNaming/Istring:1.0"
21
+
22
+ _0_CosNaming.Istring = Istring
23
+ del Istring
24
+ _0_CosNaming._tc_Istring = _0_rt.tc_alias("IDL:omg.org/CosNaming/Istring:1.0", "Istring", _0_CORBA.TC_string)
25
+
26
+ # struct NameComponent
27
+ _0_CosNaming._tc_NameComponent = _0_rt.declare_struct("IDL:omg.org/CosNaming/NameComponent:1.0", "NameComponent")
28
+ class NameComponent(_0_rt.Struct):
29
+ __module__ = "CosNaming"
30
+ __qualname__ = "NameComponent"
31
+ _NP_RepositoryId = "IDL:omg.org/CosNaming/NameComponent:1.0"
32
+ _NP_members = ("id", "kind")
33
+
34
+ def __init__(self, id, kind):
35
+ self.id = id
36
+ self.kind = kind
37
+
38
+ _0_CosNaming.NameComponent = NameComponent
39
+ del NameComponent
40
+
41
+ _0_rt.define_struct(_0_CosNaming._tc_NameComponent, _0_CosNaming.NameComponent, [("id", _0_CosNaming._tc_Istring), ("kind", _0_CosNaming._tc_Istring)])
42
+
43
+ # typedef Name
44
+ class Name(_0_rt.Typedef):
45
+ __module__ = "CosNaming"
46
+ __qualname__ = "Name"
47
+ _NP_RepositoryId = "IDL:omg.org/CosNaming/Name:1.0"
48
+
49
+ _0_CosNaming.Name = Name
50
+ del Name
51
+ _0_CosNaming._tc_Name = _0_rt.tc_alias("IDL:omg.org/CosNaming/Name:1.0", "Name", _0_rt.tc_sequence(_0_CosNaming._tc_NameComponent, 0))
52
+
53
+ # enum BindingType
54
+ _0_CosNaming.BindingType = _0_rt.Enum("IDL:omg.org/CosNaming/BindingType:1.0", ("nobject", "ncontext"))
55
+ _0_CosNaming.nobject = _0_CosNaming.BindingType._item(0)
56
+ _0_CosNaming.ncontext = _0_CosNaming.BindingType._item(1)
57
+ _0_CosNaming._tc_BindingType = _0_rt.tc_enum("IDL:omg.org/CosNaming/BindingType:1.0", "BindingType", _0_CosNaming.BindingType)
58
+
59
+ # struct Binding
60
+ _0_CosNaming._tc_Binding = _0_rt.declare_struct("IDL:omg.org/CosNaming/Binding:1.0", "Binding")
61
+ class Binding(_0_rt.Struct):
62
+ __module__ = "CosNaming"
63
+ __qualname__ = "Binding"
64
+ _NP_RepositoryId = "IDL:omg.org/CosNaming/Binding:1.0"
65
+ _NP_members = ("binding_name", "binding_type")
66
+
67
+ def __init__(self, binding_name, binding_type):
68
+ self.binding_name = binding_name
69
+ self.binding_type = binding_type
70
+
71
+ _0_CosNaming.Binding = Binding
72
+ del Binding
73
+
74
+ _0_rt.define_struct(_0_CosNaming._tc_Binding, _0_CosNaming.Binding, [("binding_name", _0_CosNaming._tc_Name), ("binding_type", _0_CosNaming._tc_BindingType)])
75
+
76
+ # typedef BindingList
77
+ class BindingList(_0_rt.Typedef):
78
+ __module__ = "CosNaming"
79
+ __qualname__ = "BindingList"
80
+ _NP_RepositoryId = "IDL:omg.org/CosNaming/BindingList:1.0"
81
+
82
+ _0_CosNaming.BindingList = BindingList
83
+ del BindingList
84
+ _0_CosNaming._tc_BindingList = _0_rt.tc_alias("IDL:omg.org/CosNaming/BindingList:1.0", "BindingList", _0_rt.tc_sequence(_0_CosNaming._tc_Binding, 0))
85
+
86
+ # forward declaration of interface BindingIterator
87
+ _0_CosNaming._tc_BindingIterator = _0_rt.tc_objref("IDL:omg.org/CosNaming/BindingIterator:1.0", "BindingIterator")
88
+
89
+ # interface NamingContext
90
+ _0_CosNaming._tc_NamingContext = _0_rt.tc_objref("IDL:omg.org/CosNaming/NamingContext:1.0", "NamingContext")
91
+ class NamingContext(object):
92
+ __module__ = "CosNaming"
93
+ __qualname__ = "NamingContext"
94
+ _NP_RepositoryId = "IDL:omg.org/CosNaming/NamingContext:1.0"
95
+ _nil = None
96
+
97
+ def __init__(self, *args, **kw):
98
+ raise RuntimeError("Cannot construct objects of this type.")
99
+
100
+ _0_CosNaming.NamingContext = NamingContext
101
+ del NamingContext
102
+
103
+ # enum NotFoundReason
104
+ _0_CosNaming.NamingContext.NotFoundReason = _0_rt.Enum("IDL:omg.org/CosNaming/NamingContext/NotFoundReason:1.0", ("missing_node", "not_context", "not_object"))
105
+ _0_CosNaming.NamingContext.missing_node = _0_CosNaming.NamingContext.NotFoundReason._item(0)
106
+ _0_CosNaming.NamingContext.not_context = _0_CosNaming.NamingContext.NotFoundReason._item(1)
107
+ _0_CosNaming.NamingContext.not_object = _0_CosNaming.NamingContext.NotFoundReason._item(2)
108
+ _0_CosNaming.NamingContext._tc_NotFoundReason = _0_rt.tc_enum("IDL:omg.org/CosNaming/NamingContext/NotFoundReason:1.0", "NotFoundReason", _0_CosNaming.NamingContext.NotFoundReason)
109
+
110
+ # exception NotFound
111
+ _0_CosNaming.NamingContext._tc_NotFound = _0_rt.declare_except("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0", "NotFound")
112
+ class NotFound(_0_CORBA.UserException):
113
+ __module__ = "CosNaming"
114
+ __qualname__ = "NamingContext.NotFound"
115
+ _NP_RepositoryId = "IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"
116
+ _NP_members = ("why", "rest_of_name")
117
+
118
+ def __init__(self, why, rest_of_name):
119
+ _0_CORBA.UserException.__init__(self, why, rest_of_name)
120
+
121
+ _0_CosNaming.NamingContext.NotFound = NotFound
122
+ del NotFound
123
+
124
+ _0_rt.define_except(_0_CosNaming.NamingContext._tc_NotFound, _0_CosNaming.NamingContext.NotFound, [("why", _0_CosNaming.NamingContext._tc_NotFoundReason), ("rest_of_name", _0_CosNaming._tc_Name)])
125
+
126
+ # exception CannotProceed
127
+ _0_CosNaming.NamingContext._tc_CannotProceed = _0_rt.declare_except("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0", "CannotProceed")
128
+ class CannotProceed(_0_CORBA.UserException):
129
+ __module__ = "CosNaming"
130
+ __qualname__ = "NamingContext.CannotProceed"
131
+ _NP_RepositoryId = "IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0"
132
+ _NP_members = ("cxt", "rest_of_name")
133
+
134
+ def __init__(self, cxt, rest_of_name):
135
+ _0_CORBA.UserException.__init__(self, cxt, rest_of_name)
136
+
137
+ _0_CosNaming.NamingContext.CannotProceed = CannotProceed
138
+ del CannotProceed
139
+
140
+ _0_rt.define_except(_0_CosNaming.NamingContext._tc_CannotProceed, _0_CosNaming.NamingContext.CannotProceed, [("cxt", _0_CosNaming._tc_NamingContext), ("rest_of_name", _0_CosNaming._tc_Name)])
141
+
142
+ # exception InvalidName
143
+ _0_CosNaming.NamingContext._tc_InvalidName = _0_rt.declare_except("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0", "InvalidName")
144
+ class InvalidName(_0_CORBA.UserException):
145
+ __module__ = "CosNaming"
146
+ __qualname__ = "NamingContext.InvalidName"
147
+ _NP_RepositoryId = "IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0"
148
+ _NP_members = ()
149
+
150
+ def __init__(self):
151
+ _0_CORBA.UserException.__init__(self)
152
+
153
+ _0_CosNaming.NamingContext.InvalidName = InvalidName
154
+ del InvalidName
155
+
156
+ _0_rt.define_except(_0_CosNaming.NamingContext._tc_InvalidName, _0_CosNaming.NamingContext.InvalidName, [])
157
+
158
+ # exception AlreadyBound
159
+ _0_CosNaming.NamingContext._tc_AlreadyBound = _0_rt.declare_except("IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0", "AlreadyBound")
160
+ class AlreadyBound(_0_CORBA.UserException):
161
+ __module__ = "CosNaming"
162
+ __qualname__ = "NamingContext.AlreadyBound"
163
+ _NP_RepositoryId = "IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0"
164
+ _NP_members = ()
165
+
166
+ def __init__(self):
167
+ _0_CORBA.UserException.__init__(self)
168
+
169
+ _0_CosNaming.NamingContext.AlreadyBound = AlreadyBound
170
+ del AlreadyBound
171
+
172
+ _0_rt.define_except(_0_CosNaming.NamingContext._tc_AlreadyBound, _0_CosNaming.NamingContext.AlreadyBound, [])
173
+
174
+ # exception NotEmpty
175
+ _0_CosNaming.NamingContext._tc_NotEmpty = _0_rt.declare_except("IDL:omg.org/CosNaming/NamingContext/NotEmpty:1.0", "NotEmpty")
176
+ class NotEmpty(_0_CORBA.UserException):
177
+ __module__ = "CosNaming"
178
+ __qualname__ = "NamingContext.NotEmpty"
179
+ _NP_RepositoryId = "IDL:omg.org/CosNaming/NamingContext/NotEmpty:1.0"
180
+ _NP_members = ()
181
+
182
+ def __init__(self):
183
+ _0_CORBA.UserException.__init__(self)
184
+
185
+ _0_CosNaming.NamingContext.NotEmpty = NotEmpty
186
+ del NotEmpty
187
+
188
+ _0_rt.define_except(_0_CosNaming.NamingContext._tc_NotEmpty, _0_CosNaming.NamingContext.NotEmpty, [])
189
+
190
+ _0_CosNaming.NamingContext._NP_operations = {
191
+ "bind": _0_rt.Operation("bind", (_0_CosNaming._tc_Name, _0_CORBA.TC_Object), (), (_0_CosNaming.NamingContext._tc_NotFound, _0_CosNaming.NamingContext._tc_CannotProceed, _0_CosNaming.NamingContext._tc_InvalidName, _0_CosNaming.NamingContext._tc_AlreadyBound)),
192
+ "rebind": _0_rt.Operation("rebind", (_0_CosNaming._tc_Name, _0_CORBA.TC_Object), (), (_0_CosNaming.NamingContext._tc_NotFound, _0_CosNaming.NamingContext._tc_CannotProceed, _0_CosNaming.NamingContext._tc_InvalidName)),
193
+ "bind_context": _0_rt.Operation("bind_context", (_0_CosNaming._tc_Name, _0_CosNaming._tc_NamingContext), (), (_0_CosNaming.NamingContext._tc_NotFound, _0_CosNaming.NamingContext._tc_CannotProceed, _0_CosNaming.NamingContext._tc_InvalidName, _0_CosNaming.NamingContext._tc_AlreadyBound)),
194
+ "rebind_context": _0_rt.Operation("rebind_context", (_0_CosNaming._tc_Name, _0_CosNaming._tc_NamingContext), (), (_0_CosNaming.NamingContext._tc_NotFound, _0_CosNaming.NamingContext._tc_CannotProceed, _0_CosNaming.NamingContext._tc_InvalidName)),
195
+ "resolve": _0_rt.Operation("resolve", (_0_CosNaming._tc_Name,), (_0_CORBA.TC_Object,), (_0_CosNaming.NamingContext._tc_NotFound, _0_CosNaming.NamingContext._tc_CannotProceed, _0_CosNaming.NamingContext._tc_InvalidName)),
196
+ "unbind": _0_rt.Operation("unbind", (_0_CosNaming._tc_Name,), (), (_0_CosNaming.NamingContext._tc_NotFound, _0_CosNaming.NamingContext._tc_CannotProceed, _0_CosNaming.NamingContext._tc_InvalidName)),
197
+ "new_context": _0_rt.Operation("new_context", (), (_0_CosNaming._tc_NamingContext,), ()),
198
+ "bind_new_context": _0_rt.Operation("bind_new_context", (_0_CosNaming._tc_Name,), (_0_CosNaming._tc_NamingContext,), (_0_CosNaming.NamingContext._tc_NotFound, _0_CosNaming.NamingContext._tc_AlreadyBound, _0_CosNaming.NamingContext._tc_CannotProceed, _0_CosNaming.NamingContext._tc_InvalidName)),
199
+ "destroy": _0_rt.Operation("destroy", (), (), (_0_CosNaming.NamingContext._tc_NotEmpty,)),
200
+ "list": _0_rt.Operation("list", (_0_CORBA.TC_ulong,), (_0_CosNaming._tc_BindingList, _0_CosNaming._tc_BindingIterator), ()),
201
+ }
202
+
203
+ class _objref_NamingContext(_0_CORBA.Object):
204
+ __module__ = "CosNaming"
205
+ __qualname__ = "_objref_NamingContext"
206
+ _NP_RepositoryId = _0_CosNaming.NamingContext._NP_RepositoryId
207
+ _NP_operations = _0_CosNaming.NamingContext._NP_operations
208
+
209
+ def __init__(self, obj):
210
+ _0_CORBA.Object.__init__(self, obj)
211
+
212
+ def bind(self, n, obj):
213
+ return self._invoke(_0_CosNaming.NamingContext._NP_operations["bind"], (n, obj))
214
+
215
+ def rebind(self, n, obj):
216
+ return self._invoke(_0_CosNaming.NamingContext._NP_operations["rebind"], (n, obj))
217
+
218
+ def bind_context(self, n, nc):
219
+ return self._invoke(_0_CosNaming.NamingContext._NP_operations["bind_context"], (n, nc))
220
+
221
+ def rebind_context(self, n, nc):
222
+ return self._invoke(_0_CosNaming.NamingContext._NP_operations["rebind_context"], (n, nc))
223
+
224
+ def resolve(self, n):
225
+ return self._invoke(_0_CosNaming.NamingContext._NP_operations["resolve"], (n,))
226
+
227
+ def unbind(self, n):
228
+ return self._invoke(_0_CosNaming.NamingContext._NP_operations["unbind"], (n,))
229
+
230
+ def new_context(self):
231
+ return self._invoke(_0_CosNaming.NamingContext._NP_operations["new_context"], ())
232
+
233
+ def bind_new_context(self, n):
234
+ return self._invoke(_0_CosNaming.NamingContext._NP_operations["bind_new_context"], (n,))
235
+
236
+ def destroy(self):
237
+ return self._invoke(_0_CosNaming.NamingContext._NP_operations["destroy"], ())
238
+
239
+ def list(self, how_many):
240
+ return self._invoke(_0_CosNaming.NamingContext._NP_operations["list"], (how_many,))
241
+
242
+ _0_CosNaming._objref_NamingContext = _objref_NamingContext
243
+ _0_rt.register_interface(_0_CosNaming.NamingContext, _objref_NamingContext)
244
+ del _objref_NamingContext
245
+
246
+ class NamingContext(_0_PortableServer.Servant):
247
+ __module__ = "CosNaming__POA"
248
+ __qualname__ = "NamingContext"
249
+ _NP_RepositoryId = _0_CosNaming.NamingContext._NP_RepositoryId
250
+ _NP_operations = _0_CosNaming.NamingContext._NP_operations
251
+
252
+ _0_CosNaming__POA.NamingContext = NamingContext
253
+ _0_rt.register_skeleton(NamingContext)
254
+ del NamingContext
255
+
256
+ # interface BindingIterator
257
+ _0_CosNaming._tc_BindingIterator = _0_rt.tc_objref("IDL:omg.org/CosNaming/BindingIterator:1.0", "BindingIterator")
258
+ class BindingIterator(object):
259
+ __module__ = "CosNaming"
260
+ __qualname__ = "BindingIterator"
261
+ _NP_RepositoryId = "IDL:omg.org/CosNaming/BindingIterator:1.0"
262
+ _nil = None
263
+
264
+ def __init__(self, *args, **kw):
265
+ raise RuntimeError("Cannot construct objects of this type.")
266
+
267
+ _0_CosNaming.BindingIterator = BindingIterator
268
+ del BindingIterator
269
+
270
+ _0_CosNaming.BindingIterator._NP_operations = {
271
+ "next_one": _0_rt.Operation("next_one", (), (_0_CORBA.TC_boolean, _0_CosNaming._tc_Binding), ()),
272
+ "next_n": _0_rt.Operation("next_n", (_0_CORBA.TC_ulong,), (_0_CORBA.TC_boolean, _0_CosNaming._tc_BindingList), ()),
273
+ "destroy": _0_rt.Operation("destroy", (), (), ()),
274
+ }
275
+
276
+ class _objref_BindingIterator(_0_CORBA.Object):
277
+ __module__ = "CosNaming"
278
+ __qualname__ = "_objref_BindingIterator"
279
+ _NP_RepositoryId = _0_CosNaming.BindingIterator._NP_RepositoryId
280
+ _NP_operations = _0_CosNaming.BindingIterator._NP_operations
281
+
282
+ def __init__(self, obj):
283
+ _0_CORBA.Object.__init__(self, obj)
284
+
285
+ def next_one(self):
286
+ return self._invoke(_0_CosNaming.BindingIterator._NP_operations["next_one"], ())
287
+
288
+ def next_n(self, how_many):
289
+ return self._invoke(_0_CosNaming.BindingIterator._NP_operations["next_n"], (how_many,))
290
+
291
+ def destroy(self):
292
+ return self._invoke(_0_CosNaming.BindingIterator._NP_operations["destroy"], ())
293
+
294
+ _0_CosNaming._objref_BindingIterator = _objref_BindingIterator
295
+ _0_rt.register_interface(_0_CosNaming.BindingIterator, _objref_BindingIterator)
296
+ del _objref_BindingIterator
297
+
298
+ class BindingIterator(_0_PortableServer.Servant):
299
+ __module__ = "CosNaming__POA"
300
+ __qualname__ = "BindingIterator"
301
+ _NP_RepositoryId = _0_CosNaming.BindingIterator._NP_RepositoryId
302
+ _NP_operations = _0_CosNaming.BindingIterator._NP_operations
303
+
304
+ _0_CosNaming__POA.BindingIterator = BindingIterator
305
+ _0_rt.register_skeleton(BindingIterator)
306
+ del BindingIterator
307
+
308
+ # interface NamingContextExt
309
+ _0_CosNaming._tc_NamingContextExt = _0_rt.tc_objref("IDL:omg.org/CosNaming/NamingContextExt:1.0", "NamingContextExt")
310
+ class NamingContextExt(_0_CosNaming.NamingContext):
311
+ __module__ = "CosNaming"
312
+ __qualname__ = "NamingContextExt"
313
+ _NP_RepositoryId = "IDL:omg.org/CosNaming/NamingContextExt:1.0"
314
+ _nil = None
315
+
316
+ def __init__(self, *args, **kw):
317
+ raise RuntimeError("Cannot construct objects of this type.")
318
+
319
+ _0_CosNaming.NamingContextExt = NamingContextExt
320
+ del NamingContextExt
321
+
322
+ # typedef StringName
323
+ class StringName(_0_rt.Typedef):
324
+ __module__ = "CosNaming"
325
+ __qualname__ = "NamingContextExt.StringName"
326
+ _NP_RepositoryId = "IDL:omg.org/CosNaming/NamingContextExt/StringName:1.0"
327
+
328
+ _0_CosNaming.NamingContextExt.StringName = StringName
329
+ del StringName
330
+ _0_CosNaming.NamingContextExt._tc_StringName = _0_rt.tc_alias("IDL:omg.org/CosNaming/NamingContextExt/StringName:1.0", "StringName", _0_CORBA.TC_string)
331
+
332
+ # typedef Address
333
+ class Address(_0_rt.Typedef):
334
+ __module__ = "CosNaming"
335
+ __qualname__ = "NamingContextExt.Address"
336
+ _NP_RepositoryId = "IDL:omg.org/CosNaming/NamingContextExt/Address:1.0"
337
+
338
+ _0_CosNaming.NamingContextExt.Address = Address
339
+ del Address
340
+ _0_CosNaming.NamingContextExt._tc_Address = _0_rt.tc_alias("IDL:omg.org/CosNaming/NamingContextExt/Address:1.0", "Address", _0_CORBA.TC_string)
341
+
342
+ # typedef URLString
343
+ class URLString(_0_rt.Typedef):
344
+ __module__ = "CosNaming"
345
+ __qualname__ = "NamingContextExt.URLString"
346
+ _NP_RepositoryId = "IDL:omg.org/CosNaming/NamingContextExt/URLString:1.0"
347
+
348
+ _0_CosNaming.NamingContextExt.URLString = URLString
349
+ del URLString
350
+ _0_CosNaming.NamingContextExt._tc_URLString = _0_rt.tc_alias("IDL:omg.org/CosNaming/NamingContextExt/URLString:1.0", "URLString", _0_CORBA.TC_string)
351
+
352
+ # exception InvalidAddress
353
+ _0_CosNaming.NamingContextExt._tc_InvalidAddress = _0_rt.declare_except("IDL:omg.org/CosNaming/NamingContextExt/InvalidAddress:1.0", "InvalidAddress")
354
+ class InvalidAddress(_0_CORBA.UserException):
355
+ __module__ = "CosNaming"
356
+ __qualname__ = "NamingContextExt.InvalidAddress"
357
+ _NP_RepositoryId = "IDL:omg.org/CosNaming/NamingContextExt/InvalidAddress:1.0"
358
+ _NP_members = ()
359
+
360
+ def __init__(self):
361
+ _0_CORBA.UserException.__init__(self)
362
+
363
+ _0_CosNaming.NamingContextExt.InvalidAddress = InvalidAddress
364
+ del InvalidAddress
365
+
366
+ _0_rt.define_except(_0_CosNaming.NamingContextExt._tc_InvalidAddress, _0_CosNaming.NamingContextExt.InvalidAddress, [])
367
+
368
+ _0_CosNaming.NamingContextExt._NP_operations = {
369
+ "to_string": _0_rt.Operation("to_string", (_0_CosNaming._tc_Name,), (_0_CosNaming.NamingContextExt._tc_StringName,), (_0_CosNaming.NamingContext._tc_InvalidName,)),
370
+ "to_name": _0_rt.Operation("to_name", (_0_CosNaming.NamingContextExt._tc_StringName,), (_0_CosNaming._tc_Name,), (_0_CosNaming.NamingContext._tc_InvalidName,)),
371
+ "to_url": _0_rt.Operation("to_url", (_0_CosNaming.NamingContextExt._tc_Address, _0_CosNaming.NamingContextExt._tc_StringName), (_0_CosNaming.NamingContextExt._tc_URLString,), (_0_CosNaming.NamingContextExt._tc_InvalidAddress, _0_CosNaming.NamingContext._tc_InvalidName)),
372
+ "resolve_str": _0_rt.Operation("resolve_str", (_0_CosNaming.NamingContextExt._tc_StringName,), (_0_CORBA.TC_Object,), (_0_CosNaming.NamingContext._tc_NotFound, _0_CosNaming.NamingContext._tc_CannotProceed, _0_CosNaming.NamingContext._tc_InvalidName)),
373
+ }
374
+
375
+ class _objref_NamingContextExt(_0_CosNaming._objref_NamingContext):
376
+ __module__ = "CosNaming"
377
+ __qualname__ = "_objref_NamingContextExt"
378
+ _NP_RepositoryId = _0_CosNaming.NamingContextExt._NP_RepositoryId
379
+ _NP_operations = _0_CosNaming.NamingContextExt._NP_operations
380
+
381
+ def __init__(self, obj):
382
+ _0_CORBA.Object.__init__(self, obj)
383
+
384
+ def to_string(self, n):
385
+ return self._invoke(_0_CosNaming.NamingContextExt._NP_operations["to_string"], (n,))
386
+
387
+ def to_name(self, sn):
388
+ return self._invoke(_0_CosNaming.NamingContextExt._NP_operations["to_name"], (sn,))
389
+
390
+ def to_url(self, addr, sn):
391
+ return self._invoke(_0_CosNaming.NamingContextExt._NP_operations["to_url"], (addr, sn))
392
+
393
+ def resolve_str(self, n):
394
+ return self._invoke(_0_CosNaming.NamingContextExt._NP_operations["resolve_str"], (n,))
395
+
396
+ _0_CosNaming._objref_NamingContextExt = _objref_NamingContextExt
397
+ _0_rt.register_interface(_0_CosNaming.NamingContextExt, _objref_NamingContextExt)
398
+ del _objref_NamingContextExt
399
+
400
+ class NamingContextExt(_0_CosNaming__POA.NamingContext):
401
+ __module__ = "CosNaming__POA"
402
+ __qualname__ = "NamingContextExt"
403
+ _NP_RepositoryId = _0_CosNaming.NamingContextExt._NP_RepositoryId
404
+ _NP_operations = _0_CosNaming.NamingContextExt._NP_operations
405
+
406
+ _0_CosNaming__POA.NamingContextExt = NamingContextExt
407
+ _0_rt.register_skeleton(NamingContextExt)
408
+ del NamingContextExt
409
+
@@ -0,0 +1,32 @@
1
+ Metadata-Version: 2.4
2
+ Name: rustorb-omniorb-compat
3
+ Version: 0.1.0
4
+ Summary: omniORBpy compatibility layer for rustorb: `from omniORB import CORBA` on rustorb
5
+ License: MIT OR Apache-2.0
6
+ Project-URL: Homepage, https://github.com/rustorb/rustorb
7
+ Project-URL: Documentation, https://github.com/rustorb/rustorb/blob/main/docs/getting-started.md
8
+ Project-URL: Changelog, https://github.com/rustorb/rustorb/blob/main/CHANGELOG.md
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Topic :: System :: Networking
11
+ Classifier: Topic :: Software Development :: Object Brokering
12
+ Requires-Python: >=3.9
13
+ Description-Content-Type: text/markdown
14
+ Requires-Dist: rustorb
15
+
16
+ # rustorb-omniorb-compat
17
+
18
+ Runs applications written for omniORBpy on
19
+ [rustorb](https://github.com/rustorb/rustorb): it provides the `omniORB`
20
+ package (`from omniORB import CORBA, PortableServer`), the top-level
21
+ `CORBA` / `PortableServer` modules and the `CosNaming` stubs, on the
22
+ `rustorb` package. OpenRTM-aist-Python and rtshell run on it.
23
+
24
+ ```sh
25
+ pip install rustorb rustorb-omniorb-compat
26
+ ```
27
+
28
+ Install it instead of omniORBpy, not next to it. The omniORBpy extensions
29
+ it covers, and the differences, are listed in
30
+ [docs/omniorb-compat.md](https://github.com/rustorb/rustorb/blob/main/docs/omniorb-compat.md).
31
+
32
+ Licensed under MIT OR Apache-2.0.
@@ -0,0 +1,8 @@
1
+ """``PortableServer``, as omniORBpy installs it at the top level: the module of
2
+ rustorb itself (``rustorb.PortableServer``)."""
3
+
4
+ import sys
5
+
6
+ import rustorb.PortableServer
7
+
8
+ sys.modules[__name__] = rustorb.PortableServer
@@ -0,0 +1,8 @@
1
+ """``PortableServer__POA``, as omniORBpy installs it at the top level: the module of
2
+ rustorb itself (``rustorb.PortableServer__POA``)."""
3
+
4
+ import sys
5
+
6
+ import rustorb.PortableServer__POA
7
+
8
+ sys.modules[__name__] = rustorb.PortableServer__POA
@@ -0,0 +1,17 @@
1
+ # rustorb-omniorb-compat
2
+
3
+ Runs applications written for omniORBpy on
4
+ [rustorb](https://github.com/rustorb/rustorb): it provides the `omniORB`
5
+ package (`from omniORB import CORBA, PortableServer`), the top-level
6
+ `CORBA` / `PortableServer` modules and the `CosNaming` stubs, on the
7
+ `rustorb` package. OpenRTM-aist-Python and rtshell run on it.
8
+
9
+ ```sh
10
+ pip install rustorb rustorb-omniorb-compat
11
+ ```
12
+
13
+ Install it instead of omniORBpy, not next to it. The omniORBpy extensions
14
+ it covers, and the differences, are listed in
15
+ [docs/omniorb-compat.md](https://github.com/rustorb/rustorb/blob/main/docs/omniorb-compat.md).
16
+
17
+ Licensed under MIT OR Apache-2.0.
@@ -0,0 +1,169 @@
1
+ """omniORBpy compatibility for rustorb.
2
+
3
+ Existing omniORBpy applications import ``omniORB``; with this package they
4
+ run on rustorb unchanged. ``omniORB.CORBA`` and ``omniORB.PortableServer``
5
+ are the rustorb modules themselves, so the code that ``rustorb-idl
6
+ -bpython`` generates and the application share their classes.
7
+
8
+ Besides the standard mapping, the package has the omniORBpy extensions
9
+ that applications use, chosen from what OpenRTM-aist-Python calls (see
10
+ docs/omniorb-compat.md):
11
+
12
+ - :func:`cdrMarshal` / :func:`cdrUnmarshal`: a value as CDR bytes
13
+ - :mod:`omniORB.any`: ``to_any`` / ``from_any``
14
+ - :func:`findType` and :mod:`omniORB.tcInternal`: type descriptors
15
+ - the ``omniINSPOA`` initial reference (in rustorb itself)
16
+ - :func:`setClientCallTimeout`, :func:`setClientThreadCallTimeout`,
17
+ :func:`setClientConnectTimeout`: client timeouts
18
+ - minor code constants that applications compare
19
+ """
20
+
21
+ import sys as _sys
22
+
23
+ from rustorb import CORBA, PortableServer, PortableServer__POA
24
+
25
+ for _m in (CORBA, PortableServer, PortableServer__POA):
26
+ _sys.modules[__name__ + "." + _m.__name__.rsplit(".", 1)[1]] = _m
27
+ del _m
28
+
29
+ from . import tcInternal # noqa: E402
30
+
31
+ #: omniORB's minor code of a ``COMM_FAILURE`` while waiting for a reply.
32
+ #: rustorb raises its own minor codes, so comparisons with it are false and
33
+ #: the application takes its general path.
34
+ COMM_FAILURE_WaitingForReply = 0x41540007
35
+
36
+ #: The minor code of the ``TRANSIENT`` raised when no connection to the
37
+ #: target could be made. omniORB has its own code (0x41540002); rustorb
38
+ #: raises minor 0, so that applications that check for it (rtctree marks
39
+ #: such an object as a zombie) see the failure.
40
+ TRANSIENT_ConnectFailed = 0
41
+
42
+ #: The minor code of the ``TIMEOUT`` raised when a client timeout expires.
43
+ #: omniORB has its own code (0x41540008); rustorb raises minor 0.
44
+ TIMEOUT_CallTimedOutOnClient = 0
45
+
46
+ #: ``UNKNOWN``: the target raised a user exception the operation does not
47
+ #: declare (the standard minor code, which rustorb also raises).
48
+ UNKNOWN_UserException = 0x4F4D0001
49
+
50
+
51
+ def _orb():
52
+ # The first ORB initialised, as for omniORBpy's single ORB:
53
+ # BAD_INV_ORDER before ORB_init.
54
+ return CORBA._default_orb()._native
55
+
56
+
57
+ def _endian(endian):
58
+ if endian == -1 or endian is None:
59
+ return None
60
+ return bool(endian)
61
+
62
+
63
+ def _seconds(millisecs):
64
+ if millisecs < 0:
65
+ raise TypeError("timeout must be an unsigned long")
66
+ return millisecs / 1000.0
67
+
68
+
69
+ def setClientCallTimeout(*args):
70
+ """setClientCallTimeout(millisecs)
71
+ setClientCallTimeout(objref, millisecs)
72
+
73
+ Set the global client call timeout, or set the timeout for a specific
74
+ object reference. 0 means no global timeout, and unsets the timeout
75
+ of a reference. A reference's timeout overrides the thread's, which
76
+ overrides the global one. A call that times out raises
77
+ ``CORBA.TIMEOUT`` (minor :data:`TIMEOUT_CallTimedOutOnClient`)."""
78
+ if len(args) == 1:
79
+ _orb().set_call_timeout(_seconds(args[0]) or None)
80
+ elif len(args) == 2:
81
+ obj, millisecs = args
82
+ if not isinstance(obj, CORBA.Object) or getattr(obj, "_obj", None) is None:
83
+ raise CORBA.BAD_PARAM(0, CORBA.COMPLETED_NO)
84
+ obj._obj.set_call_timeout(_seconds(millisecs) or None)
85
+ else:
86
+ raise TypeError("setClientCallTimeout takes 1 or 2 arguments (%d given)" % len(args))
87
+
88
+
89
+ def setClientThreadCallTimeout(millisecs):
90
+ """Set the client call timeout for the calling thread; 0 unsets it.
91
+ rustorb honours it without ``-ORBsupportPerThreadTimeOut 1``, which
92
+ omniORB needs."""
93
+ from rustorb import _native
94
+
95
+ _native.set_thread_call_timeout(_seconds(millisecs) or None)
96
+
97
+
98
+ def setClientConnectTimeout(millisecs):
99
+ """Set the client connection timeout; 0 means none (connecting is then
100
+ bounded by the call timeout)."""
101
+ _orb().set_connect_timeout(_seconds(millisecs) or None)
102
+
103
+
104
+ def cdrMarshal(tc, data, endian=-1):
105
+ """Marshal ``data`` of the type ``tc`` into bytes. With the default
106
+ ``endian`` the bytes are a CDR encapsulation (a byte order octet, then
107
+ the value in the byte order of the host); with ``endian`` true or
108
+ false, the value alone in little or big endian. Strings are ISO
109
+ 8859-1 and wide strings UTF-16, like omniORB."""
110
+ return _orb().cdr_marshal(tc, data, _endian(endian))
111
+
112
+
113
+ def cdrUnmarshal(tc, encap, endian=-1):
114
+ """Read what :func:`cdrMarshal` writes. ``MARSHAL`` when ``encap`` is
115
+ too short or longer than the value."""
116
+ if not isinstance(encap, bytes):
117
+ raise TypeError("a bytes-like object is required, not %r" % type(encap).__name__)
118
+ return _orb().cdr_unmarshal(tc, encap, _endian(endian))
119
+
120
+
121
+ def findType(repoId):
122
+ """The type descriptor of the type with the repository ID ``repoId``
123
+ that the generated code defines, or None.
124
+
125
+ A descriptor is the kind number (:mod:`omniORB.tcInternal`) for a
126
+ basic type, or a tuple that starts with it: ``(tv_struct, class,
127
+ repoId, name, member name, member descriptor, ...)`` (and the same
128
+ for exceptions), ``(tv_union, class, repoId, name)``, ``(tv_enum,
129
+ repoId, name, items)``, ``(tv_alias, repoId, name, content)``,
130
+ ``(tv_objref, repoId, name)``, ``(tv_string, bound)``,
131
+ ``(tv_wstring, bound)``, ``(tv_sequence, content, bound)``,
132
+ ``(tv_array, content, length)``, ``(tv_fixed, digits, scale)``.
133
+ """
134
+ from rustorb import _rt
135
+
136
+ tc = _rt.typecodes.get(repoId)
137
+ if tc is None:
138
+ return None
139
+ return _descriptor(tc, set())
140
+
141
+
142
+ def _descriptor(tc, seen):
143
+ k = tc.kind()
144
+ v = int(k)
145
+ if k in (CORBA.tk_struct, CORBA.tk_except, CORBA.tk_union):
146
+ if id(tc) in seen:
147
+ return (tcInternal.tv__indirect, tc.id())
148
+ seen = seen | {id(tc)}
149
+ if k is CORBA.tk_union:
150
+ return (v, tc._class, tc.id(), tc.name())
151
+ desc = [v, tc._class, tc.id(), tc.name()]
152
+ for i in range(tc.member_count()):
153
+ desc.append(tc.member_name(i))
154
+ desc.append(_descriptor(tc.member_type(i), seen))
155
+ return tuple(desc)
156
+ if k is CORBA.tk_enum:
157
+ return (v, tc.id(), tc.name(), tuple(tc._class._items))
158
+ if k is CORBA.tk_alias:
159
+ return (v, tc.id(), tc.name(), _descriptor(tc.content_type(), seen))
160
+ if k in (CORBA.tk_objref, CORBA.tk_abstract_interface, CORBA.tk_local_interface,
161
+ CORBA.tk_native):
162
+ return (v, tc.id(), tc.name())
163
+ if k in (CORBA.tk_string, CORBA.tk_wstring):
164
+ return (v, tc.length())
165
+ if k in (CORBA.tk_sequence, CORBA.tk_array):
166
+ return (v, _descriptor(tc.content_type(), seen), tc.length())
167
+ if k is CORBA.tk_fixed:
168
+ return (v, tc.fixed_digits(), tc.fixed_scale())
169
+ return v
@@ -0,0 +1,151 @@
1
+ """``omniORB.any``: Python values to and from ``CORBA.Any`` without
2
+ writing the TypeCode.
3
+
4
+ :func:`to_any` chooses the TypeCode from the value: ``long`` for an int
5
+ that fits (else ``long long``, then ``unsigned long long``), ``double``,
6
+ ``boolean``, ``string``, ``CORBA::OctetSeq`` for bytes, the type of a
7
+ struct, union, exception, enum item or object reference of the generated
8
+ code, a sequence of the items' type when they all have the same one (else
9
+ a sequence of ``any``), and a struct made for the occasion for a dict.
10
+ """
11
+
12
+ from rustorb import CORBA, _rt, _types
13
+
14
+ _INT_KINDS = (
15
+ (CORBA.TC_long, -(2**31), 2**31 - 1),
16
+ (CORBA.TC_longlong, -(2**63), 2**63 - 1),
17
+ (CORBA.TC_ulonglong, 0, 2**64 - 1),
18
+ )
19
+
20
+ _OCTET_SEQ = CORBA.TypeCode(
21
+ CORBA.tk_alias,
22
+ "IDL:omg.org/CORBA/OctetSeq:1.0",
23
+ "OctetSeq",
24
+ content=CORBA.TypeCode(CORBA.tk_sequence, content=CORBA.TC_octet, length=0),
25
+ )
26
+
27
+ _anonymous = [0]
28
+
29
+
30
+ def _bad_param():
31
+ return CORBA.BAD_PARAM(0, CORBA.COMPLETED_NO)
32
+
33
+
34
+ def _named_tc(repoId):
35
+ tc = _rt.typecodes.get(repoId) or _rt.dynamic_types.get(repoId)
36
+ if tc is None:
37
+ raise _bad_param()
38
+ return tc
39
+
40
+
41
+ def _objref_tc(obj):
42
+ repoId = getattr(obj, "_NP_RepositoryId", None) or CORBA.Object._NP_RepositoryId
43
+ tc = _rt.typecodes.get(repoId)
44
+ if tc is not None and tc.kind() is CORBA.tk_objref:
45
+ return tc
46
+ name = repoId.split(":")[1].rsplit("/", 1)[-1] if repoId.count(":") >= 2 else ""
47
+ return CORBA.TypeCode(CORBA.tk_objref, repoId, name)
48
+
49
+
50
+ def _typed(data):
51
+ """(TypeCode, value) for ``data``."""
52
+ if isinstance(data, CORBA.Any):
53
+ return data.typecode(), data.value()
54
+ if data is None:
55
+ return CORBA.TC_null, None
56
+ if isinstance(data, bool):
57
+ return CORBA.TC_boolean, data
58
+ if isinstance(data, int):
59
+ for tc, lo, hi in _INT_KINDS:
60
+ if lo <= data <= hi:
61
+ return tc, data
62
+ raise _bad_param()
63
+ if isinstance(data, float):
64
+ return CORBA.TC_double, data
65
+ if isinstance(data, str):
66
+ return CORBA.TC_string, data
67
+ if isinstance(data, bytes):
68
+ return _OCTET_SEQ, data
69
+ if isinstance(data, _types.EnumItem):
70
+ return _named_tc(data._parent_id), data
71
+ if isinstance(data, CORBA.Object):
72
+ return _objref_tc(data), data
73
+ if isinstance(data, (list, tuple)):
74
+ return _sequence(list(data))
75
+ if isinstance(data, dict):
76
+ return _struct(data)
77
+ repoId = getattr(type(data), "_NP_RepositoryId", None)
78
+ if repoId is not None and not isinstance(data, CORBA.TypeCode):
79
+ return _named_tc(repoId), data
80
+ raise _bad_param()
81
+
82
+
83
+ def _sequence(items):
84
+ typed = [_typed(item) for item in items]
85
+ if typed and all(tc.equal(typed[0][0]) for tc, _ in typed[1:]):
86
+ content = typed[0][0]
87
+ return CORBA.TypeCode(CORBA.tk_sequence, content=content, length=0), [
88
+ v for _, v in typed
89
+ ]
90
+ return CORBA.TypeCode(CORBA.tk_sequence, content=CORBA.TC_any, length=0), [
91
+ CORBA.Any(tc, v) for tc, v in typed
92
+ ]
93
+
94
+
95
+ def _struct(data):
96
+ _anonymous[0] += 1
97
+ members = []
98
+ values = []
99
+ for name, value in data.items():
100
+ if not isinstance(name, str) or not name.isidentifier():
101
+ raise _bad_param()
102
+ tc, v = _typed(value)
103
+ members.append((name, tc))
104
+ values.append(v)
105
+ tc = CORBA.TypeCode(
106
+ CORBA.tk_struct, "rustorb:UnknownStruct:%d" % _anonymous[0], "", members=members
107
+ )
108
+ cls = _rt.make_class(tc)
109
+ return tc, cls(*values)
110
+
111
+
112
+ def to_any(data):
113
+ """``data`` as a ``CORBA.Any`` (``BAD_PARAM`` for a value without a
114
+ CORBA type, such as a complex number)."""
115
+ tc, value = _typed(data)
116
+ return CORBA.Any(tc, value)
117
+
118
+
119
+ def from_any(any, keep_structs=0):
120
+ """The value of ``any``, with nested ``any`` values unpacked and
121
+ sequences converted item by item. Structs and exceptions become dicts
122
+ of their members, unless ``keep_structs`` is true."""
123
+ if not isinstance(any, CORBA.Any):
124
+ raise _bad_param()
125
+ return _convert(any.typecode(), any.value(), keep_structs)
126
+
127
+
128
+ def _unalias(tc):
129
+ while tc.kind() is CORBA.tk_alias:
130
+ tc = tc.content_type()
131
+ return tc
132
+
133
+
134
+ def _convert(tc, value, keep_structs):
135
+ tc = _unalias(tc)
136
+ k = tc.kind()
137
+ if k is CORBA.tk_any:
138
+ return _convert(value.typecode(), value.value(), keep_structs)
139
+ if k in (CORBA.tk_sequence, CORBA.tk_array):
140
+ if isinstance(value, (bytes, str)):
141
+ return value
142
+ content = tc.content_type()
143
+ return [_convert(content, v, keep_structs) for v in value]
144
+ if k in (CORBA.tk_struct, CORBA.tk_except) and not keep_structs:
145
+ return {
146
+ tc.member_name(i): _convert(
147
+ tc.member_type(i), getattr(value, _rt._py_name(tc.member_name(i))), keep_structs
148
+ )
149
+ for i in range(tc.member_count())
150
+ }
151
+ return value
@@ -0,0 +1,39 @@
1
+ """``omniORB.tcInternal``: the kind numbers of the type descriptors that
2
+ :func:`omniORB.findType` returns. They are the ``TCKind`` values, with
3
+ ``tv__indirect`` for a reference back to an enclosing recursive type."""
4
+
5
+ tv_null = 0
6
+ tv_void = 1
7
+ tv_short = 2
8
+ tv_long = 3
9
+ tv_ushort = 4
10
+ tv_ulong = 5
11
+ tv_float = 6
12
+ tv_double = 7
13
+ tv_boolean = 8
14
+ tv_char = 9
15
+ tv_octet = 10
16
+ tv_any = 11
17
+ tv_TypeCode = 12
18
+ tv_Principal = 13
19
+ tv_objref = 14
20
+ tv_struct = 15
21
+ tv_union = 16
22
+ tv_enum = 17
23
+ tv_string = 18
24
+ tv_sequence = 19
25
+ tv_array = 20
26
+ tv_alias = 21
27
+ tv_except = 22
28
+ tv_longlong = 23
29
+ tv_ulonglong = 24
30
+ tv_longdouble = 25
31
+ tv_wchar = 26
32
+ tv_wstring = 27
33
+ tv_fixed = 28
34
+ tv_value = 29
35
+ tv_value_box = 30
36
+ tv_native = 31
37
+ tv_abstract_interface = 32
38
+ tv_local_interface = 33
39
+ tv__indirect = -1
@@ -0,0 +1,33 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "rustorb-omniorb-compat"
7
+ version = "0.1.0"
8
+ description = "omniORBpy compatibility layer for rustorb: `from omniORB import CORBA` on rustorb"
9
+ readme = "README.md"
10
+ license = { text = "MIT OR Apache-2.0" }
11
+ requires-python = ">=3.9"
12
+ classifiers = [
13
+ "Programming Language :: Python :: 3",
14
+ "Topic :: System :: Networking",
15
+ "Topic :: Software Development :: Object Brokering",
16
+ ]
17
+ dependencies = ["rustorb"]
18
+
19
+ [project.urls]
20
+ Homepage = "https://github.com/rustorb/rustorb"
21
+ Documentation = "https://github.com/rustorb/rustorb/blob/main/docs/getting-started.md"
22
+ Changelog = "https://github.com/rustorb/rustorb/blob/main/CHANGELOG.md"
23
+
24
+ [tool.setuptools]
25
+ # omniORBpy's layout: the omniORB package, the standard mapping modules at
26
+ # the top level and the CosNaming stubs (generated by rustorb-idl from
27
+ # crates/rustorb-codegen/tests/idl/CosNaming.idl, see generate-stubs.sh).
28
+ packages = ["omniORB", "CosNaming", "CosNaming__POA"]
29
+ py-modules = ["CORBA", "PortableServer", "PortableServer__POA", "CosNaming_idl"]
30
+
31
+ [tool.setuptools.package-data]
32
+ CosNaming = ["*.pyi"]
33
+ CosNaming__POA = ["*.pyi"]
@@ -0,0 +1,32 @@
1
+ Metadata-Version: 2.4
2
+ Name: rustorb-omniorb-compat
3
+ Version: 0.1.0
4
+ Summary: omniORBpy compatibility layer for rustorb: `from omniORB import CORBA` on rustorb
5
+ License: MIT OR Apache-2.0
6
+ Project-URL: Homepage, https://github.com/rustorb/rustorb
7
+ Project-URL: Documentation, https://github.com/rustorb/rustorb/blob/main/docs/getting-started.md
8
+ Project-URL: Changelog, https://github.com/rustorb/rustorb/blob/main/CHANGELOG.md
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Topic :: System :: Networking
11
+ Classifier: Topic :: Software Development :: Object Brokering
12
+ Requires-Python: >=3.9
13
+ Description-Content-Type: text/markdown
14
+ Requires-Dist: rustorb
15
+
16
+ # rustorb-omniorb-compat
17
+
18
+ Runs applications written for omniORBpy on
19
+ [rustorb](https://github.com/rustorb/rustorb): it provides the `omniORB`
20
+ package (`from omniORB import CORBA, PortableServer`), the top-level
21
+ `CORBA` / `PortableServer` modules and the `CosNaming` stubs, on the
22
+ `rustorb` package. OpenRTM-aist-Python and rtshell run on it.
23
+
24
+ ```sh
25
+ pip install rustorb rustorb-omniorb-compat
26
+ ```
27
+
28
+ Install it instead of omniORBpy, not next to it. The omniORBpy extensions
29
+ it covers, and the differences, are listed in
30
+ [docs/omniorb-compat.md](https://github.com/rustorb/rustorb/blob/main/docs/omniorb-compat.md).
31
+
32
+ Licensed under MIT OR Apache-2.0.
@@ -0,0 +1,18 @@
1
+ CORBA.py
2
+ CosNaming_idl.py
3
+ PortableServer.py
4
+ PortableServer__POA.py
5
+ README.md
6
+ pyproject.toml
7
+ CosNaming/__init__.py
8
+ CosNaming/__init__.pyi
9
+ CosNaming__POA/__init__.py
10
+ CosNaming__POA/__init__.pyi
11
+ omniORB/__init__.py
12
+ omniORB/any.py
13
+ omniORB/tcInternal.py
14
+ rustorb_omniorb_compat.egg-info/PKG-INFO
15
+ rustorb_omniorb_compat.egg-info/SOURCES.txt
16
+ rustorb_omniorb_compat.egg-info/dependency_links.txt
17
+ rustorb_omniorb_compat.egg-info/requires.txt
18
+ rustorb_omniorb_compat.egg-info/top_level.txt
@@ -0,0 +1,7 @@
1
+ CORBA
2
+ CosNaming
3
+ CosNaming__POA
4
+ CosNaming_idl
5
+ PortableServer
6
+ PortableServer__POA
7
+ omniORB
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+