mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 16:42:42 +01:00
Made the detailed output the default behaviour.
This commit is contained in:
parent
023c13d292
commit
cc82e1cb43
5 changed files with 9 additions and 36 deletions
|
|
@ -22,7 +22,6 @@ import:
|
|||
flat: no
|
||||
group_albums: no
|
||||
pretend: false
|
||||
detailed: false
|
||||
|
||||
clutter: ["Thumbs.DB", ".DS_Store"]
|
||||
ignore: [".*", "*~", "System Volume Information"]
|
||||
|
|
|
|||
|
|
@ -1299,15 +1299,10 @@ def manipulate_files(session, task):
|
|||
def log_files(session, task):
|
||||
"""A coroutine (pipeline stage) to log each file which will be imported
|
||||
"""
|
||||
detailed = config['import']['detailed'].get()
|
||||
if isinstance(task, SingletonImportTask):
|
||||
if detailed:
|
||||
log.info(
|
||||
'Singleton: {0}'.format(displayable_path(task.item['path'])))
|
||||
else:
|
||||
log.info(displayable_path(task.item['path']))
|
||||
elif task.items:
|
||||
if detailed:
|
||||
log.info('Album {0}'.format(displayable_path(task.paths[0])))
|
||||
for item in task.items:
|
||||
log.info(displayable_path(item['path']))
|
||||
|
|
|
|||
|
|
@ -947,10 +947,6 @@ import_cmd.parser.add_option(
|
|||
'--pretend', dest='pretend', action='store_true',
|
||||
help='just print the files to import'
|
||||
)
|
||||
import_cmd.parser.add_option(
|
||||
'--detailed', dest='detailed', action='store_true',
|
||||
help='use in conjunction with --pretend to get sophisticated output'
|
||||
)
|
||||
import_cmd.func = import_func
|
||||
default_commands.append(import_cmd)
|
||||
|
||||
|
|
|
|||
|
|
@ -132,10 +132,6 @@ Optional command flags:
|
|||
option. If set, beets will just print a list of files that it would
|
||||
otherwise import.
|
||||
|
||||
* To get a more detailed output with the ``--pretend`` option, you can use the
|
||||
``--detailed`` flag. This way you can see which tracks beets think should
|
||||
belong to an album.
|
||||
|
||||
.. _rarfile: https://pypi.python.org/pypi/rarfile/2.2
|
||||
|
||||
.. only:: html
|
||||
|
|
|
|||
|
|
@ -1573,9 +1573,7 @@ class ImportPretendTest(_common.TestCase, ImportHelper):
|
|||
os.makedirs(path)
|
||||
self.empty_path = path
|
||||
|
||||
def __run(self, import_paths, singletons=True, detailed=False):
|
||||
config['import']['detailed'] = detailed
|
||||
|
||||
def __run(self, import_paths, singletons=True):
|
||||
self._setup_import_session(singletons=singletons)
|
||||
self.importer.paths = import_paths
|
||||
|
||||
|
|
@ -1589,26 +1587,15 @@ class ImportPretendTest(_common.TestCase, ImportHelper):
|
|||
|
||||
return logs
|
||||
|
||||
def test_import_pretend(self):
|
||||
def test_import_singletons_pretend(self):
|
||||
logs = self.__run(self.import_paths)
|
||||
|
||||
self.assertEqual(logs, self.import_files)
|
||||
|
||||
def test_import_pretend_empty(self):
|
||||
logs = self.__run([self.empty_path])
|
||||
|
||||
self.assertEqual(logs, ['No files imported from {0}'
|
||||
.format(displayable_path(self.empty_path))])
|
||||
|
||||
def test_import_singletons_pretend_detailed(self):
|
||||
logs = self.__run(self.import_paths, detailed=True)
|
||||
|
||||
self.assertEqual(logs, [
|
||||
'Singleton: %s' % self.import_files[0],
|
||||
'Singleton: %s' % self.import_paths[1]])
|
||||
|
||||
def test_import_album_pretend_detailed(self):
|
||||
logs = self.__run(self.import_paths, singletons=False, detailed=True)
|
||||
def test_import_album_pretend(self):
|
||||
logs = self.__run(self.import_paths, singletons=False)
|
||||
|
||||
self.assertEqual(logs, [
|
||||
'Album %s' % displayable_path(self.import_paths[0]),
|
||||
|
|
@ -1616,8 +1603,8 @@ class ImportPretendTest(_common.TestCase, ImportHelper):
|
|||
'Album %s' % displayable_path(self.import_paths[1]),
|
||||
self.import_paths[1]])
|
||||
|
||||
def test_import_pretend_empty_detailed(self):
|
||||
logs = self.__run([self.empty_path], detailed=True)
|
||||
def test_import_pretend_empty(self):
|
||||
logs = self.__run([self.empty_path])
|
||||
|
||||
self.assertEqual(logs, ['No files imported from {0}'
|
||||
.format(displayable_path(self.empty_path))])
|
||||
|
|
|
|||
Loading…
Reference in a new issue