diff options
Diffstat (limited to 'src/sliceitoff')
-rw-r--r-- | src/sliceitoff/hiscores/hiscores.py | 19 | ||||
-rw-r--r-- | src/sliceitoff/hiscores/static.py | 2 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/sliceitoff/hiscores/hiscores.py b/src/sliceitoff/hiscores/hiscores.py index 372db31..627c3f7 100644 --- a/src/sliceitoff/hiscores/hiscores.py +++ b/src/sliceitoff/hiscores/hiscores.py @@ -6,16 +6,21 @@ from .static import INITIAL_HIGHSCORES, MAX_HIGHSCORES class HiScores: """ Keeps track of high scores """ - def __init__(self): + def __init__(self, filename = None): """ On creation load high scores from config file """ self.table=[] - if os.name == 'nt': - self.config_filename = os.path.join(Path.home(), "sliceitoff.cfg") + if filename: + self.config_filename = filename else: - self.config_filename = os.path.join( - Path.home(), - ".config", - "sliceitoffrc") + if os.name == 'nt': + self.config_filename = os.path.join( + Path.home(), + "sliceitoff.cfg") + else: + self.config_filename = os.path.join( + Path.home(), + ".config", + "sliceitoffrc") if not os.path.isfile(self.config_filename): self.table=INITIAL_HIGHSCORES[:] return diff --git a/src/sliceitoff/hiscores/static.py b/src/sliceitoff/hiscores/static.py index cf17ba8..65a032e 100644 --- a/src/sliceitoff/hiscores/static.py +++ b/src/sliceitoff/hiscores/static.py @@ -19,7 +19,7 @@ INITIAL_HIGHSCORES = [ (10000, "-O-"), (8000, "-F-"), (6000, "-F-"), - (4000, "-!-"), + (4000, "---"), (2000, "---"), (0, "---") ] |