diff --git a/pygo.cfg b/pygo.cfg new file mode 100644 index 0000000..525600d --- /dev/null +++ b/pygo.cfg @@ -0,0 +1,4 @@ +[general] +net_user=User +net_server=pygoserver.example.com +net_port=6859 diff --git a/pygo.py b/pygo.py index d351636..ace1ec5 100755 --- a/pygo.py +++ b/pygo.py @@ -6,11 +6,15 @@ import sys sys.path.append('lib/') +import ConfigParser import goban import pygogui def main(): + # Read config file + settings = read_config_file() + # Data gb = goban.Goban() network_mode = False @@ -20,8 +24,15 @@ def main(): gui.update(gb) while True: - event = gui.do_event(gb, network_mode, our_color) + gui.do_event(gb, network_mode, our_color) gui.update(gb) + +def read_config_file(): + ret = ConfigParser.ConfigParser() + ret.read('pygo.cfg') + return ret + + if __name__ == '__main__': main()