def main(options, args): if options.CA: if options.port != None: runca(options.port) else: print("-p is required to run ca") exit(0) elif options.server: if (options.port != None) and (options.caIP != None) and (options.caPort != None): runServer(options.port, options.caIP, options.caPort) else: print("-p is required to run server") exit(0) elif options.client: if (options.serverIP != None) and (options.serverPort != None) and ( options.caIP != None) and (options.caPort != None): runClient(options.serverIP, options.serverPort, options.caIP, options.caPort) else: print("-i -j -k -l options are required to run client") exit(0)
def main(): type_of_host = sys.argv[1] # Port number that RxP's UDP-based socket will bind to (Odd for server, even for client) portNumber = int(sys.argv[2]) # IP of NetEmu netEmu_IP = sys.argv[3] # NetEmu's port number netEmu_Port = sys.argv[4] if type_of_host == "client": client.runClient(portNumber, netEmu_IP, netEmu_Port) elif type_of_host == "server": server.runServer(portNumber, netEmu_IP, netEmu_Port) else: print("Invalid request. Please try again.") sys.exit()
license which can be found in the file 'LICENSE.txt' in this package distribution or at 'https://spdx.org/licenses/BSD-3-Clause-Clear.html'. """ import sys from importConfig import runImported from server import runServer def printHelp(): print( "Need at list one argument (server or import): \nArgument `server` start the Odin server." ) print("Argument `import` import a config to Odin") if __name__ == '__main__': if len(sys.argv) >= 2: if sys.argv[1] == "server": runServer() elif sys.argv[1] == "import": runImported() else: printHelp() else: printHelp()
from dronekit import connect from status import getStatus from readfile import readFileParameters print '<<<<< UAV-S2DK >>>>' print '====Read File Parameters====' parameters = readFileParameters() param = parameters.split(' ') HOST_MAVPROXY = param[0] HOST_HTTP = param[1] PORT_MAVPROXY = param[2] PORT_HTTP = param[3] print 'host_mavp: %s port_mavp: %s host_http: %s port_http: %s' % ( HOST_MAVPROXY, PORT_MAVPROXY, HOST_HTTP, PORT_HTTP) conn = '%s:%s' % (HOST_MAVPROXY, PORT_MAVPROXY) print '========Connect Drone=======' vehicle = connect(conn, wait_ready=True) print '=========Get Status=========' getStatus(vehicle) print '=========Run Server=========' runServer(vehicle, HOST_HTTP, int(PORT_HTTP)) print '======Close Connection======' vehicle.close()
def startServer(): runServer()
from server import runServer from vehicleConnection import connectDrone, closeConnection from status import getStatus print 'connectDrone' vehicle = connectDrone() print 'getStatus' getStatus(vehicle) print 'runServer' runServer(vehicle) print 'closeConnection' closeConnection(vehicle)
import server import client s = server.runServer() c = client.runClient() s.startApp(c, 'weaver')
def main(): # updater.updateZones(serverData.WKimei, serverData.WKarray) # updater.updateZones(serverData.PJimei, serverData.PJarray) # updater.updateZones(serverData.POimei, serverData.POarray) server.runServer()
import training import server import config import sys import os if __name__ == '__main__': port = int(sys.argv[1]) if not os.path.exists(config.TRAINED_MODEL_PATH): training.trainModel(config.TRAINED_MODEL_PATH) try: server.runServer(port) except: print("digitchecker server killed. Bye!")
import server import pngconvert import inference import sys def checkDigit(raw_png_bytes: bytes) -> str: greyscale_28x28x8bit = pngconvert.pngToGreyscale28x28x8bit(raw_png_bytes) digit = inference.recognizeDigit(greyscale_28x28x8bit) return digit if __name__ == '__main__': port = int(sys.argv[1]) # stopping docker results in listening socket exception try: server.runServer(port, checkDigit) except: print("Digit recognition server killed. Bye!")