From 96275f9f1e0685019ef77e8fdfffde72c7bfd478 Mon Sep 17 00:00:00 2001 From: gimick Date: Wed, 5 Jan 2011 22:35:42 +0000 Subject: [PATCH] rushnotes: more tweaks - add LF's and brackets for negative BB100 --- pyfpdb/RushNotesAux.py | 11 ++++++++--- pyfpdb/RushNotesMerge.py | 19 ++++++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/pyfpdb/RushNotesAux.py b/pyfpdb/RushNotesAux.py index 28e3aaaa..3a445a0f 100644 --- a/pyfpdb/RushNotesAux.py +++ b/pyfpdb/RushNotesAux.py @@ -36,7 +36,7 @@ The existing notes file will be altered by this function ### http://www.faqs.org/docs/diveintopython/kgp_search.html #debugmode will write logfiles for the __init__ and update_data methods -debugmode = True +debugmode = False # Standard Library modules import os @@ -210,9 +210,14 @@ class RushNotes(Aux_Window): steal=str(Stats.do_stat(self.hud.stat_dict, player = playerid, stat = 'steal')[3] + " ") ffreq1=str(Stats.do_stat(self.hud.stat_dict, player = playerid, stat = 'ffreq1')[3] + " ") agg_freq=str(Stats.do_stat(self.hud.stat_dict, player = playerid, stat = 'agg_freq')[3] + " ") - BBper100=str(Stats.do_stat(self.hud.stat_dict, player = playerid, stat = 'BBper100')[3] + " ") + BBper100=str(Stats.do_stat(self.hud.stat_dict, player = playerid, stat = 'BBper100')[3]) + if BBper100[6] == "-": BBper100=BBper100[0:6] + "(" + BBper100[7:] + ")" - xmlqueuedict[playername] = "~fpdb~" + n + vpip + pfr + three_B + fbbsteal + "\n" + steal + cbet + ffreq1 + "\n" + agg_freq + BBper100 + "~ends~" + xmlqueuedict[playername] = ("~fpdb~" + "\n" + + n + vpip + pfr + three_B + fbbsteal + "\n" + + steal + cbet + ffreq1 + "\n" + + agg_freq + BBper100 + "\n" + + "~ends~") if (debugmode): now = datetime.now() diff --git a/pyfpdb/RushNotesMerge.py b/pyfpdb/RushNotesMerge.py index 8d46c3fa..f22b67ab 100755 --- a/pyfpdb/RushNotesMerge.py +++ b/pyfpdb/RushNotesMerge.py @@ -102,8 +102,15 @@ if not os.path.isfile((sys.argv[1]+".queue")): print "Nothing queued, quitting" quit() -print "reading from: ", sys.argv[1] -print "merging with: ", sys.argv[1]+".queue" +print "***************************************************************" +print "IMPORTANT: *** Before running this merge: ***" +print "Closedown the FullTiltClient and wait for it to completely stop" +print "If FullTiltClient was running, run the merge again once it" +print "has stopped completely" +print "***************************************************************" +print +print "read from: ", sys.argv[1] +print "merge with: ", sys.argv[1]+".queue" #read queue and turn into a dict queuedict = {} @@ -158,7 +165,13 @@ mergednotes.close() xmlnotefile.unlink -print "new file has been written to: ", sys.argv[1]+".merged" +print "Merged file has been written to: ", sys.argv[1]+".merged" +print "" print "number in queue: ", statqueue print "existing players updated: ", statupdated print "new players added: ", statadded +print "\n" +print "Use a viewer to check the contents of the merge file." +print "If you are happy, carry out the following steps:" +print "1 Rename or delete the existing notes file (normally .xml" +print "2 Rename the .merged file to become the new notes file"