mirror of
https://github.com/beetbox/beets.git
synced 2025-12-08 01:23:09 +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
|
flat: no
|
||||||
group_albums: no
|
group_albums: no
|
||||||
pretend: false
|
pretend: false
|
||||||
detailed: false
|
|
||||||
|
|
||||||
clutter: ["Thumbs.DB", ".DS_Store"]
|
clutter: ["Thumbs.DB", ".DS_Store"]
|
||||||
ignore: [".*", "*~", "System Volume Information"]
|
ignore: [".*", "*~", "System Volume Information"]
|
||||||
|
|
|
||||||
|
|
@ -1299,16 +1299,11 @@ def manipulate_files(session, task):
|
||||||
def log_files(session, task):
|
def log_files(session, task):
|
||||||
"""A coroutine (pipeline stage) to log each file which will be imported
|
"""A coroutine (pipeline stage) to log each file which will be imported
|
||||||
"""
|
"""
|
||||||
detailed = config['import']['detailed'].get()
|
|
||||||
if isinstance(task, SingletonImportTask):
|
if isinstance(task, SingletonImportTask):
|
||||||
if detailed:
|
log.info(
|
||||||
log.info(
|
'Singleton: {0}'.format(displayable_path(task.item['path'])))
|
||||||
'Singleton: {0}'.format(displayable_path(task.item['path'])))
|
|
||||||
else:
|
|
||||||
log.info(displayable_path(task.item['path']))
|
|
||||||
elif task.items:
|
elif task.items:
|
||||||
if detailed:
|
log.info('Album {0}'.format(displayable_path(task.paths[0])))
|
||||||
log.info('Album {0}'.format(displayable_path(task.paths[0])))
|
|
||||||
for item in task.items:
|
for item in task.items:
|
||||||
log.info(displayable_path(item['path']))
|
log.info(displayable_path(item['path']))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -947,10 +947,6 @@ import_cmd.parser.add_option(
|
||||||
'--pretend', dest='pretend', action='store_true',
|
'--pretend', dest='pretend', action='store_true',
|
||||||
help='just print the files to import'
|
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
|
import_cmd.func = import_func
|
||||||
default_commands.append(import_cmd)
|
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
|
option. If set, beets will just print a list of files that it would
|
||||||
otherwise import.
|
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
|
.. _rarfile: https://pypi.python.org/pypi/rarfile/2.2
|
||||||
|
|
||||||
.. only:: html
|
.. only:: html
|
||||||
|
|
|
||||||
|
|
@ -1573,9 +1573,7 @@ class ImportPretendTest(_common.TestCase, ImportHelper):
|
||||||
os.makedirs(path)
|
os.makedirs(path)
|
||||||
self.empty_path = path
|
self.empty_path = path
|
||||||
|
|
||||||
def __run(self, import_paths, singletons=True, detailed=False):
|
def __run(self, import_paths, singletons=True):
|
||||||
config['import']['detailed'] = detailed
|
|
||||||
|
|
||||||
self._setup_import_session(singletons=singletons)
|
self._setup_import_session(singletons=singletons)
|
||||||
self.importer.paths = import_paths
|
self.importer.paths = import_paths
|
||||||
|
|
||||||
|
|
@ -1589,26 +1587,15 @@ class ImportPretendTest(_common.TestCase, ImportHelper):
|
||||||
|
|
||||||
return logs
|
return logs
|
||||||
|
|
||||||
def test_import_pretend(self):
|
def test_import_singletons_pretend(self):
|
||||||
logs = self.__run(self.import_paths)
|
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, [
|
self.assertEqual(logs, [
|
||||||
'Singleton: %s' % self.import_files[0],
|
'Singleton: %s' % self.import_files[0],
|
||||||
'Singleton: %s' % self.import_paths[1]])
|
'Singleton: %s' % self.import_paths[1]])
|
||||||
|
|
||||||
def test_import_album_pretend_detailed(self):
|
def test_import_album_pretend(self):
|
||||||
logs = self.__run(self.import_paths, singletons=False, detailed=True)
|
logs = self.__run(self.import_paths, singletons=False)
|
||||||
|
|
||||||
self.assertEqual(logs, [
|
self.assertEqual(logs, [
|
||||||
'Album %s' % displayable_path(self.import_paths[0]),
|
'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]),
|
'Album %s' % displayable_path(self.import_paths[1]),
|
||||||
self.import_paths[1]])
|
self.import_paths[1]])
|
||||||
|
|
||||||
def test_import_pretend_empty_detailed(self):
|
def test_import_pretend_empty(self):
|
||||||
logs = self.__run([self.empty_path], detailed=True)
|
logs = self.__run([self.empty_path])
|
||||||
|
|
||||||
self.assertEqual(logs, ['No files imported from {0}'
|
self.assertEqual(logs, ['No files imported from {0}'
|
||||||
.format(displayable_path(self.empty_path))])
|
.format(displayable_path(self.empty_path))])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue