Exemple #1
0
def _get_config(name, exporter):
    '''shared function to return a file in the config directory
    '''
    exporter_path = exporter or ''

    template_path = os.path.join(get_installdir(), 'config', 'templates',
                                 exporter_path, name)

    if os.path.exists(template_path):
        return os.path.abspath(template_path)
    else:
        bot.info(
            'The exporter specified does not exist : %s. The task was created with no exporters. '
            % exporter)
        return os.path.abspath(
            os.path.join(get_installdir(), 'config', 'templates', name))
Exemple #2
0
 def test_get_installdir(self):
     '''get install directory should return the base of where singularity
     is installed
     '''
     print("Testing utils.get_installdir")
     from watchme.utils import get_installdir
     whereami = get_installdir()
     print(whereami)
     self.assertTrue(whereami.endswith('watchme'))
Exemple #3
0
def _get_config(name):
    '''shared function to return a file in the config directory
    '''
    return os.path.abspath(os.path.join(get_installdir(), 'config', name))
Exemple #4
0
def _get_config(name):
    """shared function to return a file in the config directory
    """
    return os.path.abspath(os.path.join(get_installdir(), "config", name))