Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added -V #61

Merged
merged 1 commit into from
Jan 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,28 @@ kmpc Change Log
0.5.9 - 2018-01-??
******************

- Added -V/--version command line option to print version number.
- Added -n/--newconfig command line option to generate default config file.
- Issue #57 wasn't actually fixed, just masked. Pretty sure it's fixed now.

******************
0.5.8 - 2018-01-26
******************

- Missed a few lines in the mpd revamp, this fixes it (`issue #57
- Missed a few lines in the mpd revamp, this fixes it. (`issue #57
<https://github.com/eratosthene/kmpc/issues/57>`_)

******************
0.5.7 - 2018-01-26
******************

- Revamped mpd connection handling to be less crashy (`issue #35
- Revamped mpd connection handling to be less crashy. (`issue #35
<https://github.com/eratosthene/kmpc/issues/35>`_)
- Documented permissions change necessary to control Pi screen backlight
- Documented permissions change necessary to control Pi screen backlight.
(`issue #45 <https://github.com/eratosthene/kmpc/issues/45>`_)
- Added setuptools>=30.3.0 to the setup_requires section of setup.cfg (`issue
- Added setuptools>=30.3.0 to the setup_requires section of setup.cfg. (`issue
#36 <https://github.com/eratosthene/kmpc/issues/36>`_)
- Added artblacklist section to config.ini (`issue #27
- Added artblacklist section to config.ini. (`issue #27
<https://github.com/eratosthene/kmpc/issues/27>`_)

******************
Expand All @@ -37,9 +38,9 @@ kmpc Change Log

- Changed the scan all for art function in the manager to schedule the requests
once per second for every row instead of skipping rows that already had some
art (`issue #26 <https://github.com/eratosthene/kmpc/issues/26>`_)
- Changed the year display to on top of the cover art to save some space
- Added a config file setting for originalyear display (`issue #16
art. (`issue #26 <https://github.com/eratosthene/kmpc/issues/26>`_)
- Changed the year display to on top of the cover art to save some space.
- Added a config file setting for originalyear display. (`issue #16
<https://github.com/eratosthene/kmpc/issues/16>`_)
- Added new settings popup to house things as config tab is going to be used
for actual config file editing eventually. (`issue #6
Expand Down
27 changes: 14 additions & 13 deletions docs/invocation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ will need to edit this config file to add the correct values for various
variables. The following commandline options are accepted, as well as all the
default Kivy options::

usage: kmpc [-h] [-q] [-d] [-n] [--helpkivy]
usage: kmpc [-h] [-q] [-d] [-n] [-V] [--helpkivy]

optional arguments:
-h, --help show this help message and exit
-q, --quiet only print errors to console log
-d, --debug print debug messages to console log
-n, --newconfig write out default config file if it doesn't exist yet
--helpkivy Print Kivy's built-in argument list
-h, --help show this help message and exit
-q, --quiet only print errors to console log
-d, --debug print debug messages to console log
-n, --newconfig write out default config file if it doesn't exist yet
-V, --version print version number and exit
--helpkivy Print Kivy's built-in argument list

***********
kmpcmanager
Expand All @@ -37,12 +38,12 @@ an rsync file to sync with, and changing song ratings and copy flags. This also
depends on the config folder and file. The following commandline options are
accepted, as well as all the default Kivy options::

usage: kmpcmanager [-h] [-q] [-d] [-n] [--helpkivy]
usage: kmpcmanager [-h] [-q] [-d] [-n] [-V] [--helpkivy]

optional arguments:
-h, --help show this help message and exit
-q, --quiet only print errors to console log
-d, --debug print debug messages to console log
-n, --newconfig write out default config file if it doesn't exist yet
--helpkivy Print Kivy's built-in argument list

-h, --help show this help message and exit
-q, --quiet only print errors to console log
-d, --debug print debug messages to console log
-n, --newconfig write out default config file if it doesn't exist yet
-V, --version print version number and exit
--helpkivy Print Kivy's built-in argument list
7 changes: 7 additions & 0 deletions kmpc/command_line.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import argparse
import sys

from kmpc.version import VERSION_STR

parser = argparse.ArgumentParser()
parser.add_argument("-q","--quiet",help="only print errors to console log",action="store_true")
parser.add_argument("-d","--debug",help="print debug messages to console log",action="store_true")
parser.add_argument("-n","--newconfig",help="write out default config file if it doesn't exist yet",action="store_true")
parser.add_argument("-V","--version",help="print version number and exit",action="store_true")
parser.add_argument("--helpkivy",help="Print Kivy's built-in argument list",action="store_true")

def do_args():
Expand All @@ -20,10 +23,14 @@ def do_args():
# if -n/--newconfig is passed, write config and exit
if args.newconfig:
print "Writing default config file if it does not exist"
print ""
from kmpc.extra import KmpcHelpers
Helpers=KmpcHelpers()
Helpers.loadconfigfile()
sys.exit(0)
if args.version:
print sys.argv[0]+" v"+VERSION_STR
sys.exit(0)
from kivy.config import Config
if args.quiet:
Config.set('kivy','log_level','warning')
Expand Down