def main(): app = CmdlineApplication() portOption = Option("-p", "--port", type="int", dest="port", default=defaultPort, metavar="PORT", help="Set the port the RegistryPeer will use") app.AddCmdLineOption(portOption) urlOption = Option( "-u", "--peerListUrl", type="string", dest="peerListUrl", default=defaultPeerListUrl, metavar="URL", help= "The url to bootstrap the system. For the current design, this is a complete list of peers." ) app.AddCmdLineOption(urlOption) try: args = app.Initialize("RegistryPeer") except Exception, e: print "Toolkit Initialization failed, exiting." print " Initialization Error: ", e sys.exit(-1)
def main(): """ The main routine. """ # Instantiate the app app = CmdlineApplication() # Handle command-line arguments urlOption = Option("-u", "--url", dest="url", default=0, help="URL for the venue server to manage.") app.AddCmdLineOption(urlOption) # Initialize the application try: app.Initialize("VenueMgmt") except Exception, e: print "Exception: ", e sys.exit(0)
specified on the command line. This program assumes the file is a ConfigParser compatible file with the following format: files should be named with the .vv3d suffix, such as: <venueid>.vv3d, and should contain: [description] url = <url> There may be more information in the file, but this is the only information used by this program and so anything else is extraneous. """ # Initialize app = CmdlineApplication() urlOption = Option("-u", "--url", dest="url", default=None, help="Specify a venue url on the command line.") app.AddCmdLineOption(urlOption) fileOption = Option("-f", "--file", dest="file", default=None, help="Specify a file that contains a venue url.") app.AddCmdLineOption(fileOption) args = app.Initialize()
while self.running: time.sleep(1) def shutdown(self): log.debug('VNCServerAppObject.shutdown') # Stop while loop self.running = 0 # Stop and cleanup vnc server self.vncServer.destroy() # Stop application service and remove from venue. self.venueProxy.DestroyApplication(self.appDescription.id) if __name__ == "__main__": app = CmdlineApplication().instance() app.AddCmdLineOption( Option("-v", "--venueUrl", type="string", dest="venueUrl", default=None, metavar="VENUE_URL", help="Set the venue in which the VenueVNC application should be started.") ) app.AddCmdLineOption( Option("-n", "--name", type="string", dest="name", default=None, metavar="NAME", help="Set the name by which the server will be identified in the venue.") ) app.AddCmdLineOption( Option("--vncserverexe", type="string", dest="vncserverexe", default=None, metavar="VNC_SERVER_EXE", help="Set the VNC server executable to use") ) app.AddCmdLineOption( Option("--display", type="string", dest="display", default=":9", metavar="DISPLAY", help="Set the display the VNC server should run on. (linux only)") ) app.AddCmdLineOption( Option("-g", "--geometry", type="string", dest="geometry", default="1024x768", metavar="GEOMETRY",
def main(): """ The main routine. """ # Instantiate the app app = CmdlineApplication() caOption = Option( "-C", "--ca", action="store_true", dest="is_ca_mode", default=0, help="Use CA mode for this invocation of the certificate manager.") idOption = Option( "-I", "--id", action="store_false", dest="is_ca_mode", default=0, help="Use ID mode for this invocation of the certificate manager.") forceOption = Option("-f", "--force", action="store_true", dest="force_overwrite", default=0, help="Overwrite existing files.") app.AddCmdLineOption(caOption) app.AddCmdLineOption(idOption) app.AddCmdLineOption(forceOption) try: args = app.Initialize("CertificateManager") except Exception: sys.exit(0) cmd = CertMgrCmdProcessor(app.GetCertificateManager(), app.GetLog()) # # If no args were passed, start up the command-driver # cert mgr. # if app.GetOption("is_ca_mode"): cmd.setCAMode() if len(args) == 0: cmd.cmdloop() else: # # Otherwise, process a single command from teh command line. # cmd.setInteractive(0) cmd.setForceOverwrite(app.GetOption("force_overwrite")) mycmd = args[0] + " " + " ".join(map(lambda a: '"' + a + '"', args[1:])) print mycmd cmd.onecmd(mycmd)