Exemplo n.º 1
0
Arquivo: core.py Projeto: Amli/mopidy
def setup_settings(interactive):
    get_or_create_folder('~/.mopidy/')
    get_or_create_file('~/.mopidy/settings.py')
    try:
        settings.validate(interactive)
    except SettingsError, e:
        logger.error(e.message)
        sys.exit(1)
Exemplo n.º 2
0
def setup_settings(interactive):
    get_or_create_folder(SETTINGS_PATH)
    get_or_create_folder(DATA_PATH)
    get_or_create_file(SETTINGS_FILE)
    try:
        settings.validate(interactive)
    except SettingsError, e:
        logger.error(e.message)
        sys.exit(1)
Exemplo n.º 3
0
def setup_settings(interactive):
    path.get_or_create_folder(path.SETTINGS_PATH)
    path.get_or_create_folder(path.DATA_PATH)
    path.get_or_create_file(path.SETTINGS_FILE)
    try:
        settings.validate(interactive)
    except exceptions.SettingsError as ex:
        logger.error(ex.message)
        sys.exit(1)
Exemplo n.º 4
0
 def test_creating_folder(self):
     folder = os.path.join(self.parent, 'test')
     self.assert_(not os.path.exists(folder))
     self.assert_(not os.path.isdir(folder))
     created = get_or_create_folder(folder)
     self.assert_(os.path.exists(folder))
     self.assert_(os.path.isdir(folder))
     self.assertEqual(created, folder)
Exemplo n.º 5
0
 def test_creating_folder(self):
     folder = os.path.join(self.parent, 'test')
     self.assert_(not os.path.exists(folder))
     self.assert_(not os.path.isdir(folder))
     created = path.get_or_create_folder(folder)
     self.assert_(os.path.exists(folder))
     self.assert_(os.path.isdir(folder))
     self.assertEqual(created, folder)
Exemplo n.º 6
0
 def test_creating_nested_folders(self):
     level2_folder = os.path.join(self.parent, 'test')
     level3_folder = os.path.join(self.parent, 'test', 'test')
     self.assert_(not os.path.exists(level2_folder))
     self.assert_(not os.path.isdir(level2_folder))
     self.assert_(not os.path.exists(level3_folder))
     self.assert_(not os.path.isdir(level3_folder))
     created = path.get_or_create_folder(level3_folder)
     self.assert_(os.path.exists(level2_folder))
     self.assert_(os.path.isdir(level2_folder))
     self.assert_(os.path.exists(level3_folder))
     self.assert_(os.path.isdir(level3_folder))
     self.assertEqual(created, level3_folder)
Exemplo n.º 7
0
 def test_creating_nested_folders(self):
     level2_folder = os.path.join(self.parent, 'test')
     level3_folder = os.path.join(self.parent, 'test', 'test')
     self.assert_(not os.path.exists(level2_folder))
     self.assert_(not os.path.isdir(level2_folder))
     self.assert_(not os.path.exists(level3_folder))
     self.assert_(not os.path.isdir(level3_folder))
     created = path.get_or_create_folder(level3_folder)
     self.assert_(os.path.exists(level2_folder))
     self.assert_(os.path.isdir(level2_folder))
     self.assert_(os.path.exists(level3_folder))
     self.assert_(os.path.isdir(level3_folder))
     self.assertEqual(created, level3_folder)
Exemplo n.º 8
0
 def test_creating_existing_folder(self):
     created = get_or_create_folder(self.parent)
     self.assert_(os.path.exists(self.parent))
     self.assert_(os.path.isdir(self.parent))
     self.assertEqual(created, self.parent)
Exemplo n.º 9
0
Arquivo: core.py Projeto: bok/mopidy
 def setup_settings(self):
     get_or_create_folder('~/.mopidy/')
     get_or_create_file('~/.mopidy/settings.py')
     settings.validate()
Exemplo n.º 10
0
 def test_creating_existing_folder(self):
     created = path.get_or_create_folder(self.parent)
     self.assert_(os.path.exists(self.parent))
     self.assert_(os.path.isdir(self.parent))
     self.assertEqual(created, self.parent)