def __init__(self, name, description, version, mimeType, extension):
        '''
        Initiate the class.

        ** Arguments **

        * name * name of the service.
        * description * description of the service.
        * version * service version.
        '''
        self.name = name
        self.description = description
        self.version = version
        self.mimeType = mimeType
        self.extension = extension
        self.visible = 1
        self.id = GUID()
                
        # Defined in Start.
        self.venueProxies = {}
        self.url = None 
        self.log = None 
        self.app = None

        # Standard AG initialization for console apps.
        self.app = CmdlineApplication.instance()
        self.app.AddCmdLineOption(Option("-v", "--venueUrl",
                                         dest="venueUrl",
                                         help="Register with venue located at this url."))
        
        self.app.AddCmdLineOption(Option("-s", "--venueServerUrl",
                                         dest="venueServerUrl",
                                         help="Register with all venues at server located at this url."))
                                         
        self.capabilities = []
Ejemplo n.º 2
0
    def __init__(self, certMgr, log):
        """
        The constructor for the cert mgr command processor.
        """
        cmd.Cmd.__init__(self)

        self.log = log
        self.certMgr = certMgr
        try:
            self.certMgrUI = CmdlineApplication.instance().GetCertificateManagerUI()
        except CertificateManager.NoCertificates:
            pass
        self.certRepo = certMgr.GetCertificateRepository()
        self.interactive = 1
        self.forceOverwrite = 0

        self.setIdentityMode()
        
        self.certs = []
Ejemplo n.º 3
0
    def __init__(self, certMgr, log):
        """
        The constructor for the cert mgr command processor.
        """
        cmd.Cmd.__init__(self)

        self.log = log
        self.certMgr = certMgr
        try:
            self.certMgrUI = CmdlineApplication.instance(
            ).GetCertificateManagerUI()
        except CertificateManager.NoCertificates:
            pass
        self.certRepo = certMgr.GetCertificateRepository()
        self.interactive = 1
        self.forceOverwrite = 0

        self.setIdentityMode()

        self.certs = []
Ejemplo n.º 4
0
            if os.path.exists("/usr/local/bin/vncviewer") or os.path.exists("/usr/X11R6/bin/vncviewer"):
		execString='vncviewer -shared -passwd %s %s'%(self.passwdFilename,self.vncContact)
            else:
		execString='chmod +x ./vncviewer; ./vncviewer -shared -passwd %s %s'%(self.passwdFilename,self.vncContact)
        elif IsOSX():
            vncviewer='/Applications/Chicken\ of\ the\ VNC.app/Contents/MacOS/Chicken\ of\ the\ VNC'
            execString='%s --PasswordFile %s %s' % (vncviewer,self.passwdFilename,self.vncContact)
        else:
            raise Exception("Unsupported platform")
        print "About the execute: %s"%(execString)
        log.info("Starting vnc client: %s", execString)
        os.system(execString);
        os.unlink(self.passwdFilename);

if __name__ == "__main__":
    app = CmdlineApplication.instance()
    app.Initialize("VenueVNCClient")

    log = app.GetLog()

    if len(sys.argv) < 2:
        print "Usage: %s <appObjectUrl>" % sys.argv[0]
        sys.exit(1)

    appUrl = sys.argv[1]

    clientProfileFile = os.path.join(UserConfig.instance().GetConfigDir(),
                                     "profile")
    clientProfile = ClientProfile(clientProfileFile)
    sb = vncSharedAppClient( appUrl, clientProfile )
def main():
    """
    This is the function that does all the real work.
    """
    app = CmdlineApplication.instance()
    app.Initialize("CreateVenues")

    venueServerUri = "https://localhost:8000/VenueServer"

    if len(sys.argv) > 2:
        venueServerUri = sys.argv[2]

    configFile = sys.argv[1]

    venueServer = VenueServerIW(venueServerUri, tracefile=sys.stdout)
    #venueServer.SetEncryptAllMedia(0)

    config = ConfigParser.ConfigParser()
    config.read(configFile)
    venues = {}

    # Start up the logging
    log = Log.GetLogger("CreateVenues")
    hdlr = Log.StreamHandler()
    hdlr.setLevel(Log.INFO)
    Log.HandleLoggers(hdlr, Log.GetDefaultLoggers())

    # We do this in two iterations because we need valid URLs for connections
    for sec in config.sections():
        # Build Venue Descriptions
        vdesc = VenueDescription3(config.get(sec, 'name'),
                                  config.get(sec, 'description'))
        vdesc.streams = []

        # Static Video
        if config.has_option(sec, 'video'):
            (host, port) = string.split(config.get(sec, 'video'), ':')
            vcap = Capability3(Capability.PRODUCER, Capability.VIDEO)
            vsd = StreamDescription3(
                vdesc.name,
                MulticastNetworkLocation(host.strip(), int(port), 127), vcap,
                0, None, 1)
            vdesc.streams.append(vsd)

        # Static Audio
        if config.has_option(sec, 'audio'):
            (host, port) = string.split(config.get(sec, 'audio'), ':')
            acap = Capability3(Capability3.PRODUCER, Capability3.AUDIO)
            asd = StreamDescription3(
                vdesc.name,
                MulticastNetworkLocation(host.strip(), int(port), 127), acap,
                0, None, 1)
            vdesc.streams.append(asd)

        # Make the venue, then store the resulting URL
        print "VD #%s : %s" % (sec, vdesc.name)
        vdesc.uri = venueServer.AddVenue(vdesc)
        config.set(sec, 'uri', vdesc.uri)

        if config.has_option(sec, 'default'):
            venueServer.SetDefaultVenue(vdesc.id)

        venues[sec] = vdesc

    for sec in config.sections():
        # Build up connections
        exits = string.split(config.get(sec, 'exits'), ', ')
        for vexit in exits:
            if venues.has_key(vexit):
                toVenue = venues[vexit]
                uri = toVenue.uri
                conn = ConnectionDescription(toVenue.name, toVenue.description,
                                             toVenue.uri)
                venues[sec].connections.append(conn)
            else:
                print "Error making connection to venue: ", vexit

        # Set the connections on the given venue
        print "CD #%s/%s: %s" % (sec, venues[sec].name, config.get(
            sec, 'exits'))

        # venue = Client.Handle(venues[sec].uri).GetProxy()
        print "URL: %s" % venues[sec].uri
        venue = VenueIW(venues[sec].uri, tracefile=sys.stdout)
        venue.SetConnections(venues[sec].connections)
Ejemplo n.º 6
0
def main():
    """
    This is the function that does all the real work.
    """
    app = CmdlineApplication.instance()
    app.Initialize("CreateVenues")

    venueServerUri = "https://localhost:8000/VenueServer"

    if len(sys.argv) > 2:
        venueServerUri = sys.argv[2]

    configFile = sys.argv[1]

    venueServer = VenueServerIW(venueServerUri, tracefile=sys.stdout)
    #venueServer.SetEncryptAllMedia(0)

    config = ConfigParser.ConfigParser()
    config.read(configFile)
    venues = {}

    # Start up the logging
    log = Log.GetLogger("CreateVenues")
    hdlr = Log.StreamHandler()
    hdlr.setLevel(Log.INFO)
    Log.HandleLoggers(hdlr, Log.GetDefaultLoggers())

    # We do this in two iterations because we need valid URLs for connections
    for sec in config.sections():
        # Build Venue Descriptions
        vdesc = VenueDescription3(config.get(sec, 'name'),
                              config.get(sec, 'description'))
        vdesc.streams = []
    
        # Static Video
        if config.has_option(sec, 'video'):
            (host, port) = string.split(config.get(sec, 'video'), ':')
            vcap = Capability3(Capability.PRODUCER, Capability.VIDEO)
            vsd = StreamDescription3(vdesc.name, 
                                    MulticastNetworkLocation(host.strip(),
                                                             int(port), 
                                                             127),
                                    vcap, 0, None, 1)
            vdesc.streams.append(vsd)
        
        # Static Audio
        if config.has_option(sec, 'audio'):
            (host, port) = string.split(config.get(sec, 'audio'), ':')
            acap = Capability3(Capability3.PRODUCER, Capability3.AUDIO)
            asd = StreamDescription3(vdesc.name, 
                                    MulticastNetworkLocation(host.strip(),
                                                             int(port), 
                                                             127),
                                acap, 0, None, 1)
            vdesc.streams.append(asd)

        # Make the venue, then store the resulting URL
        print "VD #%s : %s" % (sec, vdesc.name)
        vdesc.uri = venueServer.AddVenue(vdesc)
        config.set(sec, 'uri', vdesc.uri)

        if config.has_option(sec, 'default'):
            venueServer.SetDefaultVenue(vdesc.id)
        
        venues[sec] = vdesc

    for sec in config.sections():
        # Build up connections
        exits = string.split(config.get(sec, 'exits'), ', ')
        for vexit in exits:
            if venues.has_key(vexit):
                toVenue = venues[vexit]
                uri = toVenue.uri
                conn = ConnectionDescription(toVenue.name, toVenue.description,
                                           toVenue.uri)
                venues[sec].connections.append(conn)
            else:
                print "Error making connection to venue: ", vexit

        # Set the connections on the given venue
        print "CD #%s/%s: %s" % (sec, venues[sec].name,
                                 config.get(sec, 'exits'))
	
        # venue = Client.Handle(venues[sec].uri).GetProxy()
        print "URL: %s" % venues[sec].uri
        venue = VenueIW(venues[sec].uri, tracefile=sys.stdout)
        venue.SetConnections(venues[sec].connections)