Skip to content

Commit

Permalink
Improve --version and About version display
Browse files Browse the repository at this point in the history
Introduce PICARD_FANCY_VERSION_STR and simplify code.
  • Loading branch information
zas committed Apr 15, 2014
1 parent ed43b1d commit 7d0ccd0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
3 changes: 3 additions & 0 deletions picard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ def version_from_string(version_str):
PICARD_VERSION_STR_SHORT = version_to_string(PICARD_VERSION, short=True)
if PICARD_BUILD_VERSION_STR:
__version__ = "%s_%s" % (PICARD_VERSION_STR, PICARD_BUILD_VERSION_STR)
PICARD_FANCY_VERSION_STR = "%s (%s)" % (PICARD_VERSION_STR_SHORT,
PICARD_BUILD_VERSION_STR)
else:
__version__ = PICARD_VERSION_STR
PICARD_FANCY_VERSION_STR = PICARD_VERSION_STR_SHORT

api_versions = ["0.15.0", "0.15.1", "0.16.0", "1.0.0", "1.1.0", "1.2.0", "1.3.0"]
5 changes: 3 additions & 2 deletions picard/tagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def _patched_shutil_copystat(src, dst):
import picard.plugins
from picard.i18n import setup_gettext

from picard import (PICARD_APP_NAME, PICARD_ORG_NAME, __version__,
from picard import (PICARD_APP_NAME, PICARD_ORG_NAME,
PICARD_FANCY_VERSION_STR, __version__,
log, acoustid, config)
from picard.album import Album, NatAlbum
from picard.browser.browser import BrowserIntegration
Expand Down Expand Up @@ -614,7 +615,7 @@ def help():


def version():
print """MusicBrainz Picard %s""" % (__version__)
print "%s %s %s" % (PICARD_ORG_NAME, PICARD_APP_NAME, PICARD_FANCY_VERSION_STR)


def main(localedir=None, autoupdate=True):
Expand Down
9 changes: 2 additions & 7 deletions picard/ui/options/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from mutagen import version_string as mutagen_version
from PyQt4.QtCore import PYQT_VERSION_STR as pyqt_version
from picard import (PICARD_VERSION_STR_SHORT, PICARD_BUILD_VERSION_STR)
from picard import PICARD_FANCY_VERSION_STR
from picard.const import PICARD_URLS
from picard.formats import supported_formats
from picard.ui.options import OptionsPage, register_options_page
Expand All @@ -41,13 +41,8 @@ def __init__(self, parent=None):
self.ui.setupUi(self)

def load(self):
if PICARD_BUILD_VERSION_STR:
version = "%s (%s)" % (PICARD_VERSION_STR_SHORT,
PICARD_BUILD_VERSION_STR)
else:
version = PICARD_VERSION_STR_SHORT
args = {
"version": version,
"version": PICARD_FANCY_VERSION_STR,
"mutagen-version": mutagen_version,
"pyqt-version": pyqt_version,
"discid-version": discid_version or _("is not installed"),
Expand Down

0 comments on commit 7d0ccd0

Please sign in to comment.