From b61b2c447297e50db76b73650065caeef0cb6f98 Mon Sep 17 00:00:00 2001 From: kaliko Date: Thu, 29 Jan 2015 11:37:06 +0100 Subject: [PATCH] Some more clean-up --- data/bash/completion.sh | 33 +++++++++------------------------ data/man/info.xml | 2 +- doc/Changelog | 2 +- sima/info.py | 2 +- sima/lib/plugin.py | 12 +++++++----- simadb_cli | 4 ++-- 6 files changed, 21 insertions(+), 34 deletions(-) diff --git a/data/bash/completion.sh b/data/bash/completion.sh index be0d444..d1d6b64 100644 --- a/data/bash/completion.sh +++ b/data/bash/completion.sh @@ -1,4 +1,4 @@ -# Copyright (c) 2010, 2011, 2013, 2014 Jack Kaliko +# Copyright (c) 2010, 2011, 2013, 2014, 2015 Jack Kaliko # # This file is part of MPD_sima # @@ -31,7 +31,7 @@ _sima() { -l --log \ -v --log-level \ -S --host \ - -P --mpd_port \ + -P --port \ -h --help --version \ --var_dir \ -d --daemon" @@ -71,23 +71,17 @@ _sima() { complete -F _sima mpd_sima complete -F _sima mpd-sima -_art_names_list() { - local IFS=$'\n' - compgen -W "${artists}" -- ${cur} -} - _simadb_cli() { - local cur prev opts artists + local cur prev opts local IFS=$'\n' COMPREPLY=() _get_comp_words_by_ref cur prev - opts="--add_similarity -a --remove_similarity --remove_artist \ - --purge_hist --view_artist --view_all \ - --bl_curr_trk --bl_curr_art --bl_curr_al --bl_art --remove_bl --view_bl \ - --dbfile -d \ - --host -S --port -P \ - --reciprocal -r --check_names -c \ - --version -h --help" + opts="--purge_hist \ + --bl_curr_trk --bl_curr_art --bl_curr_al --bl_art --remove_bl --view_bl \ + --dbfile -d \ + --host -S --port -P \ + --check_names -c \ + --version -h --help" opts=$(echo $opts | sed 's/ /\n/g') if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then @@ -105,15 +99,6 @@ _simadb_cli() { --host|-S) COMPREPLY=( $(compgen -A hostname ${cur}) ) ;; - -a|--add_similarity|--view_artist|-v|--bl_art) - if [ -x /usr/bin/mpc ]; then - artists=$(for x in $(/usr/bin/mpc list artist) ; do echo "'${x}'"; done) - COMPREPLY=( $(compgen -W "${artists}" -- ${cur}) ) - return 0 - fi - # It should also complete artist name when the string ends with a comma - return 0 - ;; *) ;; esac diff --git a/data/man/info.xml b/data/man/info.xml index 046a8a7..b068fa9 100644 --- a/data/man/info.xml +++ b/data/man/info.xml @@ -5,7 +5,7 @@ - + diff --git a/doc/Changelog b/doc/Changelog index b95ea7b..b4e6483 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,4 +1,4 @@ -MPD_sima v0.13.1 +MPD_sima v0.14.0 * Fixed default conf file name (back to mpd_sima.cfg) * Cleanup code (removed users similarities) diff --git a/sima/info.py b/sima/info.py index aa879d4..39f9b47 100644 --- a/sima/info.py +++ b/sima/info.py @@ -11,7 +11,7 @@ queue is getting short. """ -__version__ = '0.13.1' +__version__ = '0.14.0' __author__ = 'kaliko jack' __email__ = 'kaliko@azylum.org' __url__ = 'git://git.kaliko.me/sima.git' diff --git a/sima/lib/plugin.py b/sima/lib/plugin.py index 0523a75..bb80a27 100644 --- a/sima/lib/plugin.py +++ b/sima/lib/plugin.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2013, 2014 Jack Kaliko +# Copyright (c) 2013-2015 Jack Kaliko # # This file is part of sima # @@ -86,24 +86,26 @@ class Plugin: def callback_playlist(self): """ Called on playlist changes - Not returning data """ pass def callback_next_song(self): - """Not returning data, + """ Could be use to scrobble, maintain an history… + Not returning data, """ pass def callback_need_track(self): - """Returns a list of Track objects to add + """ + Returns a list of Track objects to add """ pass def callback_need_track_fb(self): - """Called when callback_next_song failled to find tracks to queue + """ + Called when callback_need_track failled to find tracks to queue Returns a list of Track objects to add """ pass diff --git a/simadb_cli b/simadb_cli index c57e130..65ae284 100755 --- a/simadb_cli +++ b/simadb_cli @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright (c) 2010-2013 Jack Kaliko +# Copyright (c) 2010-2015 Jack Kaliko # # This file is part of MPD_sima # @@ -73,6 +73,7 @@ OPTS = list([ { 'sw': ['--view_bl'], 'action': 'store_true', + 'dest': 'view_bl', 'help': 'View black list.'}, { 'sw': ['--remove_bl'], @@ -112,7 +113,6 @@ class SimaDB_CLI(object): self.options = dict({}) self.localencoding = 'UTF-8' self._get_encoding() - self._upgrade() self.main() def _get_encoding(self): -- 2.39.2