TourneySummary: Add ability to create a db object if passed None

This commit is contained in:
Worros 2010-11-09 20:08:15 +08:00
parent 9dea6cc8e3
commit a39b4704e6

View File

@ -37,6 +37,7 @@ from Exceptions import *
import pprint import pprint
import DerivedStats import DerivedStats
import Card import Card
import Database
log = logging.getLogger("parser") log = logging.getLogger("parser")
@ -118,6 +119,8 @@ class TourneySummary(object):
if builtFrom=="IMAP": if builtFrom=="IMAP":
# Fix line endings? # Fix line endings?
pass pass
if self.db == None:
self.db = Database.Database(config)
self.parseSummary() self.parseSummary()
self.insertOrUpdate() self.insertOrUpdate()