From 6c08aae3a4b02f6350e7af873aa021a9098bb21e Mon Sep 17 00:00:00 2001 From: jmwatte Date: Mon, 2 Nov 2015 21:42:58 +0100 Subject: [PATCH 1/9] Update changelog.rst added yamleditor(a new plugin) entry --- docs/changelog.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 070dfeaf7..72f37bbf7 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -3,6 +3,10 @@ Changelog 1.3.16 (in development) ----------------------- +* A new :doc:`/plugins/yamleditor` helps you manually edit fields from items. + You search for items in the normal beets way.Then yamleditor opens a texteditor + with the items and the fields of the items you want to edit. Afterwards you can + review your changes save them back into the items. Fixes: From d5c9be44d466026af5a960dfd90887431700d49f Mon Sep 17 00:00:00 2001 From: jmwatte Date: Mon, 2 Nov 2015 22:02:20 +0100 Subject: [PATCH 2/9] Update changelog.rst --- docs/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 72f37bbf7..8182bdd69 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -3,7 +3,7 @@ Changelog 1.3.16 (in development) ----------------------- -* A new :doc:`/plugins/yamleditor` helps you manually edit fields from items. +* A new plugin yamleditor helps you manually edit fields from items. You search for items in the normal beets way.Then yamleditor opens a texteditor with the items and the fields of the items you want to edit. Afterwards you can review your changes save them back into the items. From e3e81502779e7a1cdee5bfd20221bf40494a21f0 Mon Sep 17 00:00:00 2001 From: jmwatte Date: Mon, 2 Nov 2015 22:07:59 +0100 Subject: [PATCH 3/9] Update yamleditor.rst polishing --- docs/plugins/yamleditor.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/plugins/yamleditor.rst b/docs/plugins/yamleditor.rst index a81a58827..2c51cb2ec 100644 --- a/docs/plugins/yamleditor.rst +++ b/docs/plugins/yamleditor.rst @@ -1,5 +1,5 @@ Yamleditor Plugin -================ +================= The ``yamleditor`` plugin lets you open the tags, fields from a group of items , edit them in a text-editor and save them back. @@ -41,7 +41,7 @@ you get a summary of your changes. Check em, answer y or n and the changes are written to your library. Configuration ------------- +------------- Make a ``yamleditor:`` section in your config.yaml ``(beet config -e)`` From a3ee1d0d3795235a33c31d65cee9cef1889889aa Mon Sep 17 00:00:00 2001 From: jmwatte Date: Mon, 2 Nov 2015 22:21:03 +0100 Subject: [PATCH 4/9] Update yamleditor.rst more polishing --- docs/plugins/yamleditor.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/plugins/yamleditor.rst b/docs/plugins/yamleditor.rst index 2c51cb2ec..fbb9f4eda 100644 --- a/docs/plugins/yamleditor.rst +++ b/docs/plugins/yamleditor.rst @@ -18,6 +18,7 @@ Without anything specified in your ``config.yaml`` for ``yamleditor:`` you will get track-$title-$artist-$album for items + and $album-$albumartist for albums @@ -25,6 +26,7 @@ and you can get more fields from the cmdline by adding -f '$genre $added' + or -e '$year $comments' From 151c1f3fbd591900f92c807baf0f19b87e35ad5a Mon Sep 17 00:00:00 2001 From: jmwatte Date: Mon, 2 Nov 2015 23:00:02 +0100 Subject: [PATCH 5/9] Update yamleditor.rst polishing --- docs/plugins/yamleditor.rst | 70 +++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 31 deletions(-) diff --git a/docs/plugins/yamleditor.rst b/docs/plugins/yamleditor.rst index fbb9f4eda..7317c3411 100644 --- a/docs/plugins/yamleditor.rst +++ b/docs/plugins/yamleditor.rst @@ -5,9 +5,12 @@ The ``yamleditor`` plugin lets you open the tags, fields from a group of items You simply put in a query like you normally do in beets. - beet yamleditor beatles - beet yamleditor beatles -a - beet yamleditor beatles -f'$title-$lyrics' + `beet yamleditor beatles` + + `beet yamleditor beatles -a` + + `beet yamleditor beatles -f'$title-$lyrics'` + You get a list of hits and then you can edit them. @@ -17,25 +20,25 @@ and for each hit a bunch of fields. Without anything specified in your ``config.yaml`` for ``yamleditor:`` you will get - track-$title-$artist-$album for items + `track-$title-$artist-$album` for items and - $album-$albumartist for albums + `$album-$albumartist` for albums you can get more fields from the cmdline by adding - -f '$genre $added' + `-f '$genre $added'` or - -e '$year $comments' + `-e '$year $comments'` If you use ``-f '$field $field'`` you get *only* what you specified. If you use ``-e '$field $field'`` you get what you specified *extra*. - -f or -e '$_all' gets you all the fields + ``-f or -e '$_all'`` gets you all the fields After you edit the values in your text-editor - *and you may only edit the values, no deleting fields or adding fields!* - you save the file, answer with y on ``Done`` and @@ -48,34 +51,39 @@ Configuration Make a ``yamleditor:`` section in your config.yaml ``(beet config -e)`` yamleditor: - editor: # specify the editor you like - editor_args: # additional arguments for editor - diff_method: ndiff # 4 different ways to view your changes - diff_method: unified # Pick one. See ex https://pymotw.com/2/difflib/ - diff_method: html # for details or just try it :) - diff_method: vimdiff # this opens up vim diff - html_viewer: # viewer to see the diff_method html - html_args : # additional arguments for the viewer - albumfields: genre album # a list of albumfields to edit - itemfields: track artist # a list of itemfields to edit - not_fields: id path # list of not-wanted fields - separator: "|>" # something that separates printed fields - -* You can pick 1 of the diff-methods (or none and you get the beet way). -If you pick ``html`` you can specify a viewer for it. If not the systems-default -will be picked. - + * editor: nano + * editor_args: + * diff_method: ndiff + * html_viewer:firefox + * html_args : + * albumfields: genre album + * itemfields: track artist + * not_fields: id path + * separator: "|>" + +* editor: you can pick your own texteditor. Defaults to systems default. +* editor_args: in case you need extra arguments for your text-editor. +* diff_method: 4 choices + * ndiff: you see original and the changed yaml files with the changes + * unified: you see the changes with a bit of context. Simple and compact. + * html: a html file that you can open in a browser. Looks nice. + * vimdiff: gives you VIM with the diffs + with no diff_method you get the beets way of showing differences. +* html_viewer: + If you pick ``html`` you can specify a viewer for it. If not the systems-default + will be picked. +* html_args: in case your html_viewer needs arguments * The ``albumfields`` and ``itemfields`` let you put in a list of fields you want to change. -``albumfields`` gets picked if you put -a in your search query else ``itemfields``. For a list of fields -do the ``beet fields``. + ``albumfields`` gets picked if you put -a in your search query else ``itemfields``. For a list of fields + do the ``beet fields``. * The ``not_fields`` always contain ``id`` and standard also the ``path``. -Don't want to mess with them. + Don't want to mess with them. * The default ``separator`` prints like: - -02-The Night Before-The Beatles-Help! + ``-02-The Night Before-The Beatles-Help!`` - but with ex "|>" it will look like: + but with ex "|>" it will look like: - |>02|>The Night Before|>The Beatles|>Help! + ``|>02|>The Night Before|>The Beatles|>Help!`` From 149dd8676a351d9f8437a0845c677478859f5065 Mon Sep 17 00:00:00 2001 From: jmwatte Date: Mon, 2 Nov 2015 23:09:50 +0100 Subject: [PATCH 6/9] Update yamleditor.rst polishing --- docs/plugins/yamleditor.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/plugins/yamleditor.rst b/docs/plugins/yamleditor.rst index 7317c3411..21321ca08 100644 --- a/docs/plugins/yamleditor.rst +++ b/docs/plugins/yamleditor.rst @@ -59,7 +59,7 @@ Make a ``yamleditor:`` section in your config.yaml ``(beet config -e)`` * albumfields: genre album * itemfields: track artist * not_fields: id path - * separator: "|>" + * separator: "<>" * editor: you can pick your own texteditor. Defaults to systems default. * editor_args: in case you need extra arguments for your text-editor. @@ -84,6 +84,6 @@ Make a ``yamleditor:`` section in your config.yaml ``(beet config -e)`` ``-02-The Night Before-The Beatles-Help!`` - but with ex "|>" it will look like: + but with ex "<>" it will look like: - ``|>02|>The Night Before|>The Beatles|>Help!`` + ``<>02<>The Night Before<>The Beatles<>Help!`` From fdbf9e59e7d11b2462646ff12f81ff31f6520bf6 Mon Sep 17 00:00:00 2001 From: jmwatte Date: Mon, 2 Nov 2015 23:11:42 +0100 Subject: [PATCH 7/9] Update yamleditor.py polishing --- beetsplug/yamleditor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beetsplug/yamleditor.py b/beetsplug/yamleditor.py index 963be9829..1124edd0e 100644 --- a/beetsplug/yamleditor.py +++ b/beetsplug/yamleditor.py @@ -1,5 +1,5 @@ # This file is part of beets. -# Copyright 2015 +# Copyright 2015, Jean-Marie Winters # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the From 3741e28947f0edf2080d6a3ba662e21733b1e68c Mon Sep 17 00:00:00 2001 From: jmwatte Date: Mon, 2 Nov 2015 23:23:57 +0100 Subject: [PATCH 8/9] Update yamleditor.rst polishing --- docs/plugins/yamleditor.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/plugins/yamleditor.rst b/docs/plugins/yamleditor.rst index 21321ca08..863a34bfb 100644 --- a/docs/plugins/yamleditor.rst +++ b/docs/plugins/yamleditor.rst @@ -63,12 +63,12 @@ Make a ``yamleditor:`` section in your config.yaml ``(beet config -e)`` * editor: you can pick your own texteditor. Defaults to systems default. * editor_args: in case you need extra arguments for your text-editor. -* diff_method: 4 choices +* diff_method: 4 choices with no diff_method you get the beets way of showing differences. * ndiff: you see original and the changed yaml files with the changes * unified: you see the changes with a bit of context. Simple and compact. * html: a html file that you can open in a browser. Looks nice. * vimdiff: gives you VIM with the diffs - with no diff_method you get the beets way of showing differences. + * html_viewer: If you pick ``html`` you can specify a viewer for it. If not the systems-default will be picked. From f0040370ec47bc7295ecccde0eae9df45beb4377 Mon Sep 17 00:00:00 2001 From: jmwatte Date: Mon, 2 Nov 2015 23:57:11 +0100 Subject: [PATCH 9/9] Update yamleditor.rst polishing --- docs/plugins/yamleditor.rst | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/docs/plugins/yamleditor.rst b/docs/plugins/yamleditor.rst index 863a34bfb..d5f3641ba 100644 --- a/docs/plugins/yamleditor.rst +++ b/docs/plugins/yamleditor.rst @@ -1,7 +1,6 @@ Yamleditor Plugin ================= -The ``yamleditor`` plugin lets you open the tags, fields from a group of items -, edit them in a text-editor and save them back. +The ``yamleditor`` plugin lets you open the tags, fields from a group of items, edit them in a text-editor and save them back. You simply put in a query like you normally do in beets. @@ -13,20 +12,19 @@ You simply put in a query like you normally do in beets. -You get a list of hits and then you can edit them. -The ``yamleditor`` opens your standard text-editor with a list of your hits -and for each hit a bunch of fields. +You get a list of hits and then you can edit them. The ``yamleditor`` opens your standard text-editor with a list of your hits and for each hit a bunch of fields. -Without anything specified in your ``config.yaml`` for ``yamleditor:`` -you will get +Without anything specified in your ``config.yaml`` for ``yamleditor:`` you will get - `track-$title-$artist-$album` for items +for items + + `track-$title-$artist-$album` -and +and for albums - `$album-$albumartist` for albums + `$album-$albumartist` -you can get more fields from the cmdline by adding +you can get fields from the cmdline by adding `-f '$genre $added'` @@ -34,16 +32,13 @@ or `-e '$year $comments'` -If you use ``-f '$field $field'`` you get *only* what you specified. +If you use ``-f '$field ...'`` you get *only* what you specified. -If you use ``-e '$field $field'`` you get what you specified *extra*. +If you use ``-e '$field ...'`` you get what you specified *extra*. - ``-f or -e '$_all'`` gets you all the fields +If you use ``-f or -e '$_all'`` you get all the fields. -After you edit the values in your text-editor - *and you may only edit the values, -no deleting fields or adding fields!* - you save the file, answer with y on ``Done`` and -you get a summary of your changes. -Check em, answer y or n and the changes are written to your library. +After you edit the values in your text-editor - *and you may only edit the values, no deleting fields or adding fields!* - you save the file, answer with y on ``Done`` and you get a summary of your changes. Check em, answer y or n and the changes are written to your library. Configuration -------------