diff options
| author | Manuel Traut <manut@mecka.net> | 2010-02-02 17:08:51 +0000 |
|---|---|---|
| committer | Manuel Traut <manut@mecka.net> | 2010-02-02 17:08:51 +0000 |
| commit | 5cdfa0ea1b2f941ad12e24fffe89314ee96c0d1c (patch) | |
| tree | 6482f88e490daf186d12cec391829c9fd0327753 /src/YalpClients/EflClient/corba_example/client.py | |
| parent | 397b8b455e29677ac6bcd21c2b59eac4592aef40 (diff) | |
EflClient: CORBA example
- added little corba client/server 'hello world'
Signed-off-by: Manuel Traut <manut@mecka.net>
Diffstat (limited to 'src/YalpClients/EflClient/corba_example/client.py')
| -rwxr-xr-x | src/YalpClients/EflClient/corba_example/client.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/YalpClients/EflClient/corba_example/client.py b/src/YalpClients/EflClient/corba_example/client.py new file mode 100755 index 0000000..b6eff0a --- /dev/null +++ b/src/YalpClients/EflClient/corba_example/client.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python + +import sys +from omniORB import CORBA +import HuhuItf, CosNaming + +orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID) + +obj = orb.resolve_initial_references("NameService") +root_context = obj._narrow(CosNaming.NamingContext) + +if root_context is None: + print "Failed to narrow the root naming context" + sys.exit(1) + +name = [CosNaming.NameComponent("huhu", "project"), + CosNaming.NameComponent("blubb", "object")] + +try: + obj = root_context.resolve(name) + +except CosNaming.NamingContext.NotFound, ex: + print "Name not found" + sys.exit(1) + +blubb = obj._narrow(HuhuItf.Blubb) + +if blubb is None: + print "obj ref is not an dbsfeditf::dependency" + sys.exit(1) + +pkg = HuhuItf.Package("e17-data","0.16.999.063-1","now","amd64"); +deps = blubb.get_something(pkg) + +for dep in deps: + print dep.name, dep.version |
