forked from martinjlowm/Voix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·56 lines (45 loc) · 1018 Bytes
/
main.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Start the client.
"""
import logging
import argparse
import wx
from voix.client import Client
from voix.interface.cli import CLI
from voix.interface.gui import GUI
parser = argparse.ArgumentParser(
description='A voice communication and chat client.'
)
parser.add_argument(
'-v',
'--verbose',
dest='verbose',
action='store_true',
help='prints detailed steps to stdout.'
)
parser.add_argument(
'-c',
'--cli',
dest='cli',
action='store_true',
help='uses CLI instead of GUI.'
)
options = parser.parse_args()
def main():
if options.verbose:
logging.basicConfig(
level=logging.DEBUG,
format="%(levelname)s %(asctime)s %(funcName)s %(lineno)d %(message)s"
)
client = Client()
if options.cli:
cli = CLI(client)
cli.main_loop()
else:
app = wx.App()
GUI(None, -1, 'Voix')
app.MainLoop()
if __name__ == "__main__":
main()