Read config data from pygo.cfg
This commit is contained in:
parent
16061abf0a
commit
da583678c1
4
pygo.cfg
Normal file
4
pygo.cfg
Normal file
|
@ -0,0 +1,4 @@
|
|||
[general]
|
||||
net_user=User
|
||||
net_server=pygoserver.example.com
|
||||
net_port=6859
|
13
pygo.py
13
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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user