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')
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')
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.")
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())
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.")
def test_nonexistant_config_file(self): os.environ["BEETSCONFIG"] = "/xxxxx" ui.main(["version"])
from __future__ import division, absolute_import, print_function from beets.ui import main if __name__ == "__main__": main( [ '-c', 'config.yaml', 'ls' ] )
def _run_main(self, args, config, func): self.test_cmd.func = func ui.main(args + ['test'], StringIO(config))
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=""', ])
from __future__ import division, absolute_import, print_function from beets.ui import main if __name__ == "__main__": main(['-c', 'config.yaml', 'setlister', 'Rosetta'])
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'])
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'])
def test_nonexistant_config_file(self): os.environ['BEETSCONFIG'] = '/xxxxx' ui.main(['version'])
from __future__ import division, absolute_import, print_function from beets.ui import main if __name__ == "__main__": main(['-c', 'config.yaml', 'info', 'floatfall'])
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'])