From a044f397ab93e0337c59b97ef7d3f6a9f7e7a135 Mon Sep 17 00:00:00 2001 From: Nicole Vreden Date: Wed, 17 Feb 2010 22:43:45 +0100 Subject: Corba_Search --- src/YalpClients/EflClient/client.py | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 src/YalpClients/EflClient/client.py (limited to 'src/YalpClients/EflClient/client.py') diff --git a/src/YalpClients/EflClient/client.py b/src/YalpClients/EflClient/client.py new file mode 100755 index 0000000..073e6e2 --- /dev/null +++ b/src/YalpClients/EflClient/client.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python + +import sys +from omniORB import CORBA +import YalpInterfaces, CosNaming, YalpInterfaces__POA +import medialist +import media + +class Corba(object): + def __init__(self, win, c): + self.win = win + self.c = c + + self.orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID) + self.obj = self.orb.resolve_initial_references("NameService") + self.root_context = self.obj._narrow(CosNaming.NamingContextExt) + if self.root_context is None: + print "Failed to narrow the root naming context" + sys.exit(1) + + self.name = ("YALP_Server") + try: + self.obj = self.root_context.resolve_str(self.name) + + except CosNaming.NamingContext.NotFound, ex: + print "Name not found", ex + sys.exit(1) + + self.blubb = self.obj._narrow(YalpInterfaces.ServerControlInterface) + if self.blubb is None: + print "obj ref is not an dbsfeditf::dependency" + sys.exit(1) + + def corba_search(self,searchentry): + mlist = [] + mlist.append (YalpInterfaces.VIDEO) + mlist.append (YalpInterfaces.SOUND) + deps = self.blubb.search(searchentry, mlist) + m = medialist.Medias(self.win, self.c) + print deps[0] + for dep in deps[0]: + current = media.Media(dep, self.blubb, self.win, self.c) + m.add_media(current) + -- cgit v1.2.3