2012-04-08 05:06:10 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
|
|
# A GTK Python GO client
|
|
|
|
|
2012-04-13 20:53:57 +00:00
|
|
|
import sys
|
|
|
|
sys.path.append('lib/')
|
|
|
|
|
2012-04-15 05:00:36 +00:00
|
|
|
import ConfigParser
|
2012-04-15 20:54:50 +00:00
|
|
|
|
2012-04-13 20:53:57 +00:00
|
|
|
import goban
|
2012-04-15 04:20:39 +00:00
|
|
|
import pygogui
|
2012-04-14 21:10:12 +00:00
|
|
|
|
2012-04-08 05:06:10 +00:00
|
|
|
|
|
|
|
def main():
|
2012-04-15 05:00:36 +00:00
|
|
|
# Read config file
|
|
|
|
settings = read_config_file()
|
|
|
|
|
2012-04-15 03:42:56 +00:00
|
|
|
# Data
|
|
|
|
gb = goban.Goban()
|
|
|
|
network_mode = False
|
|
|
|
our_color = None
|
2012-04-15 04:20:39 +00:00
|
|
|
gui = pygogui.GUI(gb)
|
2012-04-15 03:42:56 +00:00
|
|
|
|
2012-04-15 04:20:39 +00:00
|
|
|
gui.update(gb)
|
2012-04-10 00:55:09 +00:00
|
|
|
|
2012-04-08 05:06:10 +00:00
|
|
|
while True:
|
2012-04-15 05:00:36 +00:00
|
|
|
gui.do_event(gb, network_mode, our_color)
|
2012-04-15 04:20:39 +00:00
|
|
|
gui.update(gb)
|
2012-04-08 05:06:10 +00:00
|
|
|
|
|
|
|
|
2012-04-15 05:00:36 +00:00
|
|
|
|
|
|
|
def read_config_file():
|
|
|
|
ret = ConfigParser.ConfigParser()
|
|
|
|
ret.read('pygo.cfg')
|
|
|
|
return ret
|
|
|
|
|
|
|
|
|
2012-04-08 05:06:10 +00:00
|
|
|
if __name__ == '__main__': main()
|