26 lines
739 B
Python
26 lines
739 B
Python
#!/usr/bin/env python3
|
|
|
|
import sys
|
|
import argparse
|
|
import fishbook_server.server as server
|
|
|
|
|
|
def run(arguments):
|
|
server.runserver(arguments.host, arguments.port)
|
|
|
|
|
|
def create_parser():
|
|
parser = argparse.ArgumentParser(description="Run fishbook dataserver")
|
|
parser.add_argument("-hs", "--host", type=str, default="", help="The host for which to listen. Use 127.0.0.1 for localhost or any other hosts simply leave it empty.")
|
|
parser.add_argument("-pr", "--port", type=int, default=65432, help="The port on which the server should be listening which to listen. Default 9000.")
|
|
return parser
|
|
|
|
|
|
def main():
|
|
parser = create_parser()
|
|
args = parser.parse_args()
|
|
run(args)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main() |