Merge branch 'master' of git://git.assembla.com/fpdb-eric

This commit is contained in:
Worros 2008-11-10 22:55:24 +10:00
commit 6de1ac1c82
7 changed files with 446 additions and 437 deletions

View File

@ -140,6 +140,7 @@ class GuiAutoImport (threading.Thread):
# Add directories to importer object. # Add directories to importer object.
for site in self.input_settings: for site in self.input_settings:
self.importer.addImportDirectory(self.input_settings[site][0], True, site, self.input_settings[site][1]) self.importer.addImportDirectory(self.input_settings[site][0], True, site, self.input_settings[site][1])
print "Adding import directories - Site: " + site + " dir: "+ str(self.input_settings[site][0])
self.do_import() self.do_import()
interval=int(self.intervalEntry.get_text()) interval=int(self.intervalEntry.get_text())

View File

@ -116,13 +116,13 @@ class Hud:
return True return True
return False return False
def kill_hud(self, args): def kill_hud(self, *args):
for k in self.stat_windows.keys(): for k in self.stat_windows.keys():
self.stat_windows[k].window.destroy() self.stat_windows[k].window.destroy()
self.main_window.destroy() self.main_window.destroy()
self.deleted = True self.deleted = True
def reposition_windows(self, args): def reposition_windows(self, *args):
for w in self.stat_windows: for w in self.stat_windows:
self.stat_windows[w].window.move(self.stat_windows[w].x, self.stat_windows[w].window.move(self.stat_windows[w].x,
self.stat_windows[w].y) self.stat_windows[w].y)
@ -259,7 +259,8 @@ class Stat_Window:
# This handles all callbacks from button presses on the event boxes in # This handles all callbacks from button presses on the event boxes in
# the stat windows. There is a bit of an ugly kludge to separate single- # the stat windows. There is a bit of an ugly kludge to separate single-
# and double-clicks. # and double-clicks.
if event.button == 1: # left button event
if event.button == 3: # right button event
if event.type == gtk.gdk.BUTTON_PRESS: # left button single click if event.type == gtk.gdk.BUTTON_PRESS: # left button single click
if self.sb_click > 0: return if self.sb_click > 0: return
self.sb_click = gobject.timeout_add(250, self.single_click, widget) self.sb_click = gobject.timeout_add(250, self.single_click, widget)
@ -270,12 +271,14 @@ class Stat_Window:
self.double_click(widget, event, *args) self.double_click(widget, event, *args)
if event.button == 2: # middle button event if event.button == 2: # middle button event
pass
# print "middle button clicked" # print "middle button clicked"
if event.button == 3: # right button event
pass pass
# print "right button clicked"
if event.button == 1: # left button event
if event.state & gtk.gdk.SHIFT_MASK:
self.window.begin_resize_drag(gtk.gdk.WINDOW_EDGE_SOUTH_EAST, event.button, int(event.x_root), int(event.y_root), event.time)
else:
self.window.begin_move_drag(event.button, int(event.x_root), int(event.y_root), event.time)
def single_click(self, widget): def single_click(self, widget):
# Callback from the timeout in the single-click finding part of the # Callback from the timeout in the single-click finding part of the
@ -349,8 +352,9 @@ class Stat_Window:
# font = pango.FontDescription("Sans 8") # font = pango.FontDescription("Sans 8")
self.label[r][c].modify_font(font) self.label[r][c].modify_font(font)
if not os.name == 'nt': # seems to be a bug in opacity on windows # if not os.name == 'nt': # seems to be a bug in opacity on windows
self.window.set_opacity(parent.colors['hudopacity']) self.window.set_opacity(parent.colors['hudopacity'])
self.window.realize self.window.realize
self.window.move(self.x, self.y) self.window.move(self.x, self.y)
self.window.show_all() self.window.show_all()
@ -457,7 +461,7 @@ class Popup_window:
self.lab.set_text(pu_text) self.lab.set_text(pu_text)
self.window.show_all() self.window.show_all()
self.window.set_transient_for(stat_window.main_window) self.window.set_transient_for(stat_window.window)
# set_keep_above(1) for windows # set_keep_above(1) for windows
if os.name == 'nt': self.topify_window(self.window) if os.name == 'nt': self.topify_window(self.window)

View File

@ -177,7 +177,11 @@ class Importer:
self.pos_in_file[file] = inputFile.tell() self.pos_in_file[file] = inputFile.tell()
inputFile.close() inputFile.close()
try: # sometimes we seem to be getting an empty self.lines, in which case, we just want to return.
firstline = self.lines[0] firstline = self.lines[0]
except:
# print "import_fpdb_file", file, site, self.lines, "\n"
return
if firstline.find("Tournament Summary")!=-1: if firstline.find("Tournament Summary")!=-1:
print "TODO: implement importing tournament summaries" print "TODO: implement importing tournament summaries"