Esempio n. 1
0
 def test_cli_config_option(self):
     """Read config from file passed on the command line with
     ``--config file``
     """
     config_path = os.path.join(self.temp_dir, 'config.yml')
     with open(config_path, 'w') as file:
         file.write('anoption: value')
     ui.main(['--config', config_path, 'test'])
     self.assertEqual(config['anoption'].get(), 'value')
Esempio n. 2
0
    def test_beetsdir_config_file_overwrites_defaults(self):
        with open(self.user_config_path, 'w') as file:
            file.write('anoption: value')

        env_config_path = os.path.join(self.temp_dir, 'config.yaml')
        os.environ['BEETSDIR'] = self.temp_dir
        with open(env_config_path, 'w') as file:
            file.write('anoption: overwrite')

        ui.main(['test'])
        self.assertEqual(config['anoption'].get(), 'overwrite')
Esempio n. 3
0
from __future__ import division, absolute_import, print_function
from beets.ui import main
import time

if __name__ == "__main__":
    t = time.time()

    main(['-c', 'config.yaml', '-vv', 'convert'])

    print(f"\n\n Elapsed time: {time.time() - t} s.")
Esempio n. 4
0
import re
import sys

from beets.ui import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())
Esempio n. 5
0
from __future__ import division, absolute_import, print_function
from beets.ui import main

if __name__ == "__main__":
    main(
        [
            '-c', 'config.yaml',
            '-l', 'library/library.db',
            'link', '--add'
        ]
    )
from __future__ import division, absolute_import, print_function
from beets.ui import main
import time

if __name__ == "__main__":
    t = time.time()

    main(
        [
            '-c', 'config.yaml', '-vv',
            'replaygain', '-a', '-fw',
        ]
    )

    print(f"\n\n Elapsed time: {time.time() - t} s.")
Esempio n. 7
0
 def test_nonexistant_config_file(self):
     os.environ["BEETSCONFIG"] = "/xxxxx"
     ui.main(["version"])
Esempio n. 8
0
from __future__ import division, absolute_import, print_function
from beets.ui import main

if __name__ == "__main__":
    main(
        [
            '-c', 'config.yaml', 'ls'
        ]
    )
Esempio n. 9
0
 def _run_main(self, args, config, func):
     self.test_cmd.func = func
     ui.main(args + ['test'], StringIO(config))
Esempio n. 10
0
from __future__ import division, absolute_import, print_function
from beets.ui import main

if __name__ == "__main__":
    main([
        '-c', 'config.yaml', '-vv', 'lyrics', '--force', '--write-rest',
        'lyrics'
    ])
from __future__ import division, absolute_import, print_function
from beets.ui import main

if __name__ == "__main__":
    main([
        '-c',
        'config.yaml',
        '-vv',
        'modify',
        '-y',
        'rg_album_gain=""',
        'rg_album_peak=""',
        'rg_track_gain=""',
        'rg_track_peak=""',
    ])
Esempio n. 12
0
from __future__ import division, absolute_import, print_function
from beets.ui import main

if __name__ == "__main__":
    main(['-c', 'config.yaml', 'setlister', 'Rosetta'])
Esempio n. 13
0
from __future__ import division, absolute_import, print_function
from beets.ui import main

if __name__ == "__main__":
    main(['-c', 'config.yaml', '-l', 'library/library.db', 'link', 'remove'])
Esempio n. 14
0
from __future__ import division, absolute_import, print_function
from beets.ui import main
import shutil
import os

if __name__ == '__main__':
    try:
        shutil.rmtree('library')
        while os.path.isdir('library'):
            pass  # todo: sometimes the dir gets removed *after* it is made!
        # todo: this still doesn't catch it, need to run this script twice...
        main(['-c', 'config.yaml', 'update', '--from-scratch'])
    except FileNotFoundError:
        pass

    if not os.path.isdir('library'):
        os.mkdir('library')
        # touch ~ https://stackoverflow.com/questions/1158076/implement-touch-using-python
        with open('library/library.db', 'a'):
            os.utime('library/library.db', None)

    main(['-c', 'config.yaml', 'import', 'import'])
Esempio n. 15
0
 def _run_main(self, args, config, func):
     self.test_cmd.func = func
     ui.main(args + ['test'], StringIO(config))
Esempio n. 16
0
 def test_nonexistant_config_file(self):
     os.environ['BEETSCONFIG'] = '/xxxxx'
     ui.main(['version'])
Esempio n. 17
0
from __future__ import division, absolute_import, print_function
from beets.ui import main

if __name__ == "__main__":
    main(['-c', 'config.yaml', 'info', 'floatfall'])
Esempio n. 18
0
 def test_nonexistant_config_file(self):
     os.environ['BEETSCONFIG'] = '/xxxxx'
     ui.main(['version'])
Esempio n. 19
0
from __future__ import division, absolute_import, print_function
from beets.ui import main

if __name__ == "__main__":
    main(['-c', 'config.yaml', 'ls', '-af', '$album:$albumtotal', 'botanist'])