-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.py
executable file
·41 lines (30 loc) · 877 Bytes
/
server.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python
#
# Copyright (C) Florian Denis - All Rights Reserved
# Unauthorized copying of this file, via any medium is strictly prohibited.
# Proprietary and confidential.
#
"""
Server for online simplified Belote game
"""
import argparse
import logging
import socket
import os
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
from belote.server import Server
def main():
# Logging
logging.basicConfig(format='%(name)16s - %(levelname)8s - %(message)s')
logging.getLogger('belote').setLevel(logging.DEBUG)
log = logging.getLogger('cli')
# Arguments
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('-p', '--port', default=4242,
help='Port')
args = parser.parse_args()
# Launch server instance
server = Server(int(args.port))
server.run()
if __name__ == '__main__':
main()