Skip to content

Commit

Permalink
have CardLoader accept custom file/path to configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
zephyrfalcon committed Dec 5, 2010
1 parent a06fbbb commit 7f8403e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cardloader.py
Expand Up @@ -26,14 +26,14 @@ def get_files_for_sets(sets, dir, suffix):

class CardLoader:

def __init__(self, sets=None):
self.cfg = self._read_configuration()
def __init__(self, sets=None, path="config.txt"):
self.cfg = self._read_configuration(path)
self.sets = sets or []
self.cards = []

def _read_configuration(self):
def _read_configuration(self, path="config.txt"):
cp = ConfigParser.ConfigParser()
cp.read("config.txt")
cp.read(path)
return cp

def load_cards(self):
Expand Down

0 comments on commit 7f8403e

Please sign in to comment.