diff --git a/ttbp/config/__init__.py b/ttbp/config/__init__.py index 6d8639d..e363efe 100644 --- a/ttbp/config/__init__.py +++ b/ttbp/config/__init__.py @@ -1,13 +1,14 @@ from __future__ import absolute_import import os +import sys -from . import util +from .. import util ## System config # We refer to some package files (ie .css stuff), so we save a reference to the # path. -INSTALL_PATH = dirname(sys.modules['ttbp'].__file__) +INSTALL_PATH = os.path.dirname(sys.modules['ttbp'].__file__) # We use this to store any persisted, global state. VAR = '/var/global/ttbp' @@ -29,6 +30,9 @@ GRAFF_DIR = os.path.join(VAR, "graffiti") WALL = os.path.join(GRAFF_DIR, "wall.txt") WALL_LOCK = os.path.join(GRAFF_DIR, ".lock") +if not os.path.isdir(GRAFF_DIR): + os.mkdir(GRAFF_DIR) + ## Defaults DEFAULT_HEADER = ''' @@ -44,13 +48,13 @@ DEFAULT_HEADER = '''