from __future__ import absolute_import import os 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__) # We use this to store any persisted, global state. VAR = '/var/global/ttbp' VAR_WWW = os.path.join(VAR, 'www') if not os.path.isdir('/var/global'): raise Exception('bad system state: /var/global does not exist.') if not os.path.isdir(VAR): os.mkdir(VAR) if not os.path.isdir(VAR_WWW): os.mkdir(VAR_WWW) LIVE = 'https://tilde.town/~' FEEDBOX = "endorphant@tilde.town" USERFILE = os.path.join(VAR, "users.txt") GRAFF_DIR = os.path.join(VAR, "graffiti") WALL = os.path.join(GRAFF_DIR, "wall.txt") WALL_LOCK = os.path.join(GRAFF_DIR, ".lock") ## Defaults DEFAULT_HEADER = ''' $USER on TTBP

~$USER@TTBP

'''.ltrim() DEFAULT_FOOTER = '''
'''.ltrim() with open(os.path.join(INSTALL_PATH, 'config', 'defaults', 'style.css')) as f: DEFAULT_STYLE = f.read() ## User config USER = os.path.basename(os.path.expanduser('~')) USER_HOME = os.path.expanduser('~') PATH = os.path.join(USER_HOME, '.ttbp') PUBLIC = os.path.join(USER_HOME, 'public_html') WWW = os.path.join(PATH, 'www') USER_CONFIG = os.path.join(PATH, 'config') TTBPRC = os.path.join(USER_CONFIG, 'ttbprc') USER_DATA = os.path.join(PATH, 'entries') NOPUB = os.path.join(USER_CONFIG, "nopub") ## UI BANNER = ''' __________________________________________________________ | | | the tilde.town | | ____ ____ ____ _ ____ ____ _ _ ____ _ _ _ ____ | | |___ |___ |___ | [__ |___ |\ | | __ | |\ | |___ | | | |___ |___ |___ ___] |___ | \| |__] | | \| |___ | | ver 0.10.0 (almost stable) | |__________________________________________________________| '''.ltrim()