Merge branch 'master' of git://git.assembla.com/mctfpdb
Conflicts: pyfpdb/FulltiltToFpdb.py
This commit is contained in:
+10
-3
@@ -115,6 +115,7 @@ class Importer:
|
||||
# Called from GuiBulkImport to add a file or directory.
|
||||
def addBulkImportImportFileOrDir(self, inputPath,filter = "passthrough"):
|
||||
"""Add a file or directory for bulk import"""
|
||||
|
||||
# Bulk import never monitors
|
||||
# if directory, add all files in it. Otherwise add single file.
|
||||
# TODO: only add sane files?
|
||||
@@ -124,7 +125,6 @@ class Importer:
|
||||
self.addImportFile(os.path.join(inputPath, subdir[0], file), site="default", filter=filter)
|
||||
else:
|
||||
self.addImportFile(inputPath, site="default", filter=filter)
|
||||
|
||||
#Add a directory of files to filelist
|
||||
#Only one import directory per site supported.
|
||||
#dirlist is a hash of lists:
|
||||
@@ -172,7 +172,15 @@ class Importer:
|
||||
|
||||
def calculate_auto(self):
|
||||
"""An heuristic to determine a reasonable value of drop/don't drop"""
|
||||
if len(self.filelist) == 1: return "don't drop"
|
||||
if len(self.filelist) == 1: return "don't drop"
|
||||
if 'handsInDB' not in self.settings:
|
||||
try:
|
||||
tmpcursor = self.fdb.db.cursor()
|
||||
tmpcursor.execute("Select count(1) from Hands;")
|
||||
self.settings['handsInDB'] = tmpcursor.fetchone()[0]
|
||||
tmpcursor.close()
|
||||
except:
|
||||
pass # if this fails we're probably doomed anyway
|
||||
if self.settings['handsInDB'] < 5000: return "drop"
|
||||
if len(self.filelist) < 50: return "don't drop"
|
||||
if self.settings['handsInDB'] > 50000: return "don't drop"
|
||||
@@ -348,7 +356,6 @@ class Importer:
|
||||
isTourney=fpdb_simple.isTourney(hand[0])
|
||||
if not isTourney:
|
||||
fpdb_simple.filterAnteBlindFold(site,hand)
|
||||
hand=fpdb_simple.filterCrap(site, hand, isTourney)
|
||||
self.hand=hand
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user