def server(frame_buffers, admin_queue, inf_ready_queue, api_results): # Start running the server to listen the requests from the frontend from server import app, init init(api_results, ALL_MODELS, frame_buffers, admin_queue, inf_ready_queue) inf_ready_queue.get() while True: app.run(debug=False, host="0.0.0.0")
def init(ims=[], oms=[]): server.init() for m in ims: inmodules[m.name()] = m for m in oms: outmodules[m.name()] = m if __name__ == '__main__': loop()
def create_app(args): app = server.app server.init(args) #app = Flask("app") #app.register_blueprint(pg_raw) #init_db(args) app.config["JSON_SORT_KEYS"] = False app.config['TESTING'] = True return app
def main(): print(sm64net.VERSION_STR + "\n" "Copyright (C) 2019 - 2022 devwizard\n" "This project is licensed under the terms of the GNU General Public " "License\n" "version 2. See LICENSE for more information.") server.init() ui.init() try: while ui.update(): server.update() time.sleep(1.0 / 60) finally: ui.exit() server.exit() return 0
def main(): resource.path.append('data') resource.reindex() font.add_directory('data/font') log.init() audio.init() client.init() server.init() options.init() director.init() clt = client.GameClient() clt.start() clt.stop()
def setUpClass(self): app = init(self.database_url, self.database_name) self.mongo = app.mongo self.database = app.database self.app = app.test_client() self.app.testing = True
def init(): db.init() yield server.init() yield channel.init() yield filter_.init() var.init_vars() var.init_ivars() yield list_.init_lists() yield speed_variant.init()
def main(): parser = createParser() args = parser.parse_args() # args = vars(args) if args.type == 'ui': import server server.CONFIG_FILE_ADDR = f"{args.database}/{args.config_db}/{args.config_file}" server.CONFIG_DOC = server.get_config_doc() rev = server.CONFIG_DOC[ '_rev'] if args.config_rev is None else args.config_rev server.init(rev) server.create_and_run_heartbeat() server.run() elif args.type == "monitor": import monitor pass else: raise ValueError(f"Unsupported server type {args.type}")
def main(my_ip, my_port): if not server.init(my_ip, my_port, functions): print " - Not able to initiate server!" return print " Listening on %s:%s" % (my_ip, my_port) print " <CTRL-C> to quit." try: server.start_listen() except KeyboardInterrupt: server.close()
def test_post_hook__with_task_data__should_invoke_task_handler(on_task_update): server.init() with boddle( json={ 'triggers': [{ 'phid': 'PHID-USER-4mhnzzmliamzna2ybxoq' }], 'object': { 'phid': 'PHID-TASK-djleagj2aiegvb7kzivn', 'type': 'TASK' }, 'action': { 'secure': False, 'silent': False, 'epoch': 1518723688, 'test': True }, 'transactions': [{ 'phid': 'PHID-XACT-TASK-yw2uq4kcw6xoly3' }, { 'phid': 'PHID-XACT-TASK-vur4yo7rbjgav3m' }, { 'phid': 'PHID-XACT-TASK-3oreybprcelj4yi' }, { 'phid': 'PHID-XACT-TASK-yzncx4yjf4xu27v' }, { 'phid': 'PHID-XACT-TASK-gokjdxv26og6fcx' }, { 'phid': 'PHID-XACT-TASK-bx5c6o56rcrsqol' }, { 'phid': 'PHID-XACT-TASK-4sijbzxe4zwas6v' }, { 'phid': 'PHID-XACT-TASK-ma5huuuk4df4fz7' }, { 'phid': 'PHID-XACT-TASK-lwscf4bkcmpnrus' }, { 'phid': 'PHID-XACT-TASK-4otbxttzngta6pd' }] }): server.receive_hook() on_task_update.assert_called_once_with( ANY, phid="PHID-TASK-djleagj2aiegvb7kzivn", tag_map=ANY)
def main(my_ip, my_port): try: if not server.init(my_ip, my_port, functions): print " - Not able to initiate server. Exiting." return except socket.error as err: print err print " - Not able to initiate server. Exiting." return print " Oxide server listening on %s:%s" % (my_ip, my_port) print " <CTRL-C> to quit." try: server.start_listen() except KeyboardInterrupt: print " - Caught <CTRL-C> closing server" server.close()
def test_import_server_init(): resp = server.init() assert_true(resp == None)
configs = { 'SCREEN_WIDTH': width, 'SCREEN_HEIGHT': height, 'CARLA_HOST': servername, 'CARLA_PORT': carlaport, 'AUTO_PILOT': autopilot, 'ROLENAME': car_name, 'FILTER': car_type, 'WORLD_NAME': world, 'RCNN_MODEL_PATH': rcc_model_path, 'RCNN_MAP_PATH': rcnn_map_path, 'RCNN_NET_DIM': rcnn_net_dim, 'RCNN_MAX_PROPOSALS': rcnn_max_proposals, 'RCNN_POSITIVE_CLASS': rcc_positive_class, 'RCNN_THRESHOLD': rcnn_threshold, 'RCNN_LOOP_COUNTER': rcnn_loop_counter, } create_app(width,height,debug) init(configs) loop() stop() print("Service started") except Exception as e: show_traceback(override=True) print("Service failed: " + str(e))
# -*- coding: utf-8 -*- from server import app,init init() #app.run(debug=True, use_reloader=False)
import server class ClientProxy(object): def __init__(self, app): self.app = app def __call__(self, environ, start_response): environ["wsgi.url_scheme"] = server.app.config['URL_SCHEME'] environ["HTTP_HOST"] = server.app.config['SERVER_URL'] return self.app(environ, start_response) application = server.init(server.make_app()) application = server.init_web(application) application.wsgi_app = ClientProxy(application.wsgi_app) if __name__ == '__main__': application.run('0.0.0.0', 9090, use_debugger=True, use_reloader=True)
import logging import numpy as np import server from vartypes import csc_float from seq import Sequenceur from projet import ProjetCascada server_scheme = {"X": csc_float, "Y": csc_float, "Z": csc_float} client_scheme = {"mE": csc_float} range_scheme = { "X": (-9, 9, 10, np.linspace), "Y": (-9, 9, 10, np.linspace), "Z": (-9, 9, 10, np.linspace) } logging.basicConfig(filename='cascada.log', level=logging.INFO, format='%(levelname)s %(asctime)s %(message)s') sequencer = Sequenceur(server_scheme, range_scheme) my_project = ProjetCascada("Demo", sequencer, client_scheme, server_scheme, "mE", 3, 0.04, 1, "mdp", "aVeryEfficientAlgorithm") server.init(my_project) server.launch()
# -*- coding: utf-8 -*- import os import sys # 设置系统编码为 utf8 default_encoding = 'utf-8' if sys.getdefaultencoding() != default_encoding: reload(sys) sys.setdefaultencoding(default_encoding) # 加入根目录 sys.path.append(os.path.join(os.path.dirname(__file__), 'app')) # 加入第三方类库搜索路径 sys.path.append(os.path.join(os.path.dirname(__file__), 'modules')) if __name__ == "__main__": import server server.init()
def server(frameBuffers, api_results): from server import app, init init(api_results, MODELS_IN_USE, frameBuffers) while True: app.run(debug=False, host="0.0.0.0")
app = [] try: t = threading.Thread(target=application1) app.append(t) t = threading.Thread(target=application2) app.append(t) for th in app: th.start() for th in app: if th.isAlive(): th.join() except: print 'start application error!' SERVER = server.init() TB = tokenBucket.init(SERVER) threads = [] if __name__ == "__main__": serverlog = open('serverlog.log', 'w') try: tc = threading.Thread(target=controlplane) threads.append(tc) except Exception, e: print e print 'start contralplane error!' try: td = threading.Thread(target=dataplane) threads.append(td) except:
import pickle import os import server import client choice = int(input('HOST (1) or CONNECT (2) (1/2)>>>')) if choice == 1: print('starting server...') print('') server.init(5050) elif choice == 2: IP = str(input('IP: >>>')) #25.122.134.57 print('starting client...') print('') client.connect(IP, 5050) else: print('Invalid Choice')
except Exception: pass return port def get_secure(): type = input('Establecer conexion segura? S/N: ') return True if type in ['s', 'S'] else False if __name__ == '__main__': os.system('clear') while True: print('1. Servidor') print('2. Cliente') type = input('Opcion: ') if type in ['1', '2']: break else: os.system('clear') os.system('clear') if type == '1': # Servidor print('Servidor') from server import init init(get_port()) else: # Cliente ip = input('Ip del Servidor: ') from client import init init(ip, get_port(), get_secure())
app = QtWidgets.QApplication(sys.argv) app.processEvents() renderingScreen = vidgenUI.renderingScreen() renderingScreen.show() Thread(target=vidGen.renderThread, args=(renderingScreen, )).start() Thread(target=server.sendThread).start() sys.exit(app.exec_()) if __name__ == "__main__": current_directory = os.path.dirname(os.path.realpath(__file__)) os.chdir(current_directory) settings.generateConfigFile() if not os.path.exists(settings.asset_file_path): os.mkdir(settings.asset_file_path) os.mkdir(f"{settings.asset_file_path}/Music") if not os.path.exists(settings.temp_path): os.mkdir(f"{settings.temp_path}") if not os.path.exists(settings.final_video_path): os.mkdir(f"{settings.final_video_path}") if not os.path.exists(settings.vid_finishedvids): os.mkdir(f"{settings.vid_finishedvids}") vidGen.deleteAllFilesInPath(settings.vid_finishedvids) server.init() App()
def start(ssid, password): server.init(ssid, password, handle_request)
def test_get_root__should_return_200(): server.init() eq_(server.index(), "{}")
def startServer(): print('starting server...') print('') server.init(5050)
from server import init if __name__ == "__main__": init()
os.system("g++ /tmp/otfoutput.cpp -O3 -o /tmp/otfexec") os.system("chmod +x /tmp/otfexec") print("> Running executable ...") result = subprocess.check_output("/tmp/otfexec", shell=True) print("> Deleting OTF files ...") os.system("rm -rf /tmp/otfoutput.cpp /tmp/otfexec") print("> Casting result") return float(result) port = 10008 pwd = input("Please enter a password to stop the server > ") serv = server.init(port, 1) callmethod = "python" print("Server Name/IP: '" + server.socket.gethostname() + "'") print("On port: '" + str(port) + "'") print() try: while True: print("Waiting for a connection...") connection = server.acceptConnections(serv) try: print() while True:
import server application = server.init() if __name__ == "__main__": application.run()
def server(frameBuffers, admin_queue, inf_ready_queue, api_results): from server import app, init init(api_results, ALL_MODELS, frameBuffers, admin_queue, inf_ready_queue) inf_ready_queue.get() while True: app.run(debug=False, host="0.0.0.0")