コード例 #1
0
ファイル: shifty.py プロジェクト: electrikfreak/shiftspace
def runserver(argv):
    """
    Run the builtin webserver on the specified port (defaults to 8080).
    """
    try:
        fh = open("config/env/mydev.json")
    except:
        print
        print "ERROR: You have not specified the domain from which ShiftSpace will be served."
        print "You should run something like the following first:"
        print
        print "python shifty.py configure http://locahost:8080"
        print
        sys.exit(2)
    try:
        port = argv[1]
        server.start(port=int(port))
    except:
        server.start()
コード例 #2
0
ファイル: shifty.py プロジェクト: omunroe-com/shiftspace
def runserver(argv):
    """
    Run the builtin webserver on the specified port (defaults to 8080).
    """
    try:
        fh = open("config/env/mydev.json")
    except:
        print
        print "ERROR: You have not specified the domain from which ShiftSpace will be served."
        print "You should run something like the following first:"
        print
        print "python shifty.py configure http://locahost:8080"
        print
        sys.exit(2)
    try:
        port = argv[1]
        server.start(port=int(port))
    except:
        server.start()
コード例 #3
0
ファイル: cli.py プロジェクト: ciknight/ddns-for-python
def main():
    """Usage:
    cli.py getrecord [<domain_id>]
    cli.py run [<domain_id>] [<record_id>]
    cli.py stop
    cli.py (create|getdomain)
    cli.py [-h|-v]

Options:
  -h --help     show this help message
  -v --version  show version
  --watch       watch source files for changes

Commands:
  run           deploy ddns in current directory
  stop          stop ddns
  getrecord     get record list in current domain
  getdomain     get all domain
  create        create a record"""

    arguments = docopt(main.__doc__, version="dnspod ddns 1.0")
    if arguments['run']:
        domain_id = arguments['<domain_id>']
        record_id = arguments['<record_id>']
        server.start(domain_id, record_id)
    elif arguments['stop']:
        server.stop()
    elif arguments['getdomain']:
        server.dnspod.get_domains()
    elif arguments['create']:
        raise NotImplementedError
    elif arguments['getrecord']:
        domain_id = arguments['<domain_id>']
        server.dnspod.get_records(domain_id)
    else:
        exit(main.__doc__)
コード例 #4
0
from server import server


if __name__ == '__main__':
    server.start()
コード例 #5
0
ファイル: supercmd.py プロジェクト: muzilike/roubosys
 def server(self):
     server.start()
コード例 #6
0
ファイル: main.py プロジェクト: Henry440/Zeiterfassung
def as_server(ip, port):
    log.log(f"Starte als Server", 0)
    server.start(ip, port)
コード例 #7
0
from server import server
from server.analysis import Analysis
from server.application import gm

CUR_VERSION = "v1.01"
LEVEL = server.INFO

if __name__ == "__main__":
    server = server.Server(LEVEL)
    # server.active_rpc("rpc_host", 5672, "/", "username", "passwd")
    server.gen_http_process(8080, 1, Analysis(CUR_VERSION))
    server.start(False)
コード例 #8
0
@server.DELETE('/account/:id')
def delete_account(args):
    deleted_count = account.delete(args['params']['id'])

    if deleted_count == 0:
        return response.json({'message': 'nothing is deleted'})
    else:
        return response.json({'message': 'successfully delete account'})


'''
Nothing. Just. Hello :)
'''


@server.GET('/')
def hello(args):
    print(args)

    data = {'message': 'Hello!'}

    return response.json(data)


'''
Start server di port 3000.
'''
if __name__ == "__main__":
    print('Server listening on port 3500.')
    server.start(3500)
コード例 #9
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os.path
from command import factory
from server import server

if __name__ == '__main__':
    modelPath = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),
                             "model/")
    factory.loadModels(modelPath)
    try:
        started = server.start(
            sys.argv[1]) if len(sys.argv) > 1 else server.start()
        if not started:
            raise Exception("start failed, connection refused!")
        factory.create('prompt').cmdloop()
    except KeyboardInterrupt:
        pass
    except:
        import traceback
        print traceback.print_exc()
    try:
        server.stop()
        print 'bye!'
    except:
        pass
コード例 #10
0
ファイル: run_server.py プロジェクト: kamaal44/ludit
#!/usr/bin/env python3

from server.server import start

start()
コード例 #11
0
ファイル: waymoot.py プロジェクト: e1ven/Waymoot
 def post(self):
     self.getvars()
     server.load(subject=self.get_argument("subject"),emails=self.UserSettings['list'],exclude=self.UserSettings['optoutlist'],htmltemplate=self.UserSettings['htmltemplate'],txttemplate=self.UserSettings['texttemplate'])
     server.start()
コード例 #12
0
#!/usr/bin/env python3

from server import server


def dump(ax, ay, az, gx, gy, gz):
    print("A = ({}, {}, {}), G = ({}, {}, {})".format(ax, ay, az, gx, gy, gz))


server.start(callback=dump)
toto = input()
コード例 #13
0
ファイル: start.py プロジェクト: b1naryth1ef/Bunneh
import sys, os, time

if __name__ == '__main__':
	if len(sys.argv) != 2:
		print "Usage: ./start.py <server/client>"
		sys.exit()
	else:
		if sys.argv[1] == 'server':
			from server import server
			server.start()
		elif sys.argv[1] == "client":
			from client import main