Example #1
0
def get_conf_path(filename=None):
    """
    Return absolute path for configuration file with specified filename
    """
    from src.gui import userconfig
    conf_dir = osp.join(userconfig.get_home_dir(), SUBFOLDER)
    if not osp.isdir(conf_dir):
        os.mkdir(conf_dir)
    if filename is None:
        return conf_dir
    else:
        return osp.join(conf_dir, filename)
Example #2
0
        'zoom_factor': .8,
        'max_history_entries': 20,
    }),
]

DEV = not __file__.startswith(sys.prefix)
DEV = False
CONF = UserConfig('openfisca_ga',
                  defaults=DEFAULTS,
                  load=(not DEV),
                  version='0.0.1',
                  subfolder=SUBFOLDER,
                  backup=True,
                  raw_mode=True)
# Removing old .openfisca.ini location:
old_location = osp.join(get_home_dir(), '.openfisca_ga.ini')
if osp.isfile(old_location):
    os.remove(old_location)

IMG_PATH = []


def add_image_path(path):
    if not osp.isdir(path):
        return
    global IMG_PATH
    IMG_PATH.append(path)
    for _root, dirs, _files in os.walk(path):
        for directory in dirs:
            IMG_PATH.append(osp.join(path, directory))
Example #3
0
File: config.py Project: Pyke75/ga
              }),
            ('onlinehelp',
             {
              'shortcut': "Ctrl+Shift+D",
              'enable': True,
              'zoom_factor': .8,
              'max_history_entries': 20,
              }),
            ]

DEV = not __file__.startswith(sys.prefix)
DEV = False
CONF = UserConfig('openfisca_ga', defaults=DEFAULTS, load=(not DEV), version='0.0.1',
                  subfolder=SUBFOLDER, backup=True, raw_mode=True)
# Removing old .openfisca.ini location:
old_location = osp.join(get_home_dir(), '.openfisca_ga.ini')
if osp.isfile(old_location):
    os.remove(old_location)


IMG_PATH = []
def add_image_path(path):
    if not osp.isdir(path):
        return
    global IMG_PATH
    IMG_PATH.append(path)
    for _root, dirs, _files in os.walk(path):
        for directory in dirs:
            IMG_PATH.append(osp.join(path, directory))

add_image_path(get_module_data_path('src.gui', relpath='images'))