Exemple #1
0
def enable(path):
    '''
    Enables a location of models and test cases specified by the path.

    :param path: A path to a location directory
    :type path: string
    '''
    path = os.path.abspath(path)
    if path not in _cache:
        return None
    _cache[path] = True
    errors = []
    for dirname, module in _DIRS_MAP.iteritems():
        errors.extend(_addModuleDir(module, os.path.join(path, dirname)))
    # Add a corresponding locale
    locale.add(os.path.join(path, _LOCALE_DIR))
    if errors:
        disable(path)
    return errors
Exemple #2
0
def enable(path):
    '''
    Enables a location of models and test cases specified by the path.

    :param path: A path to a location directory
    :type path: string
    '''
    path = os.path.abspath(path)
    if path not in _cache:
        return None
    _cache[path] = True
    errors = []
    for dirname, module in _DIRS_MAP.iteritems():
        errors.extend(_addModuleDir(module, os.path.join(path, dirname)))
    # Add a corresponding locale
    locale.add(os.path.join(path, _LOCALE_DIR))
    if errors:
        disable(path)
    return errors
Exemple #3
0
 def _addLocaleDir(self, localedir):
     locale.add(os.path.abspath(os.path.join(_LOCALES_DIR, localedir)))
Exemple #4
0
 def _addLocaleDir(self, localedir):
     locale.add(os.path.abspath(os.path.join(_LOCALES_DIR, localedir)))