From 39878e40f806fb26971c1f54fddca4b73b82bd8e Mon Sep 17 00:00:00 2001 From: Adrien Tétar Date: Thu, 12 Nov 2015 12:01:24 +0100 Subject: fontView: version string --- Lib/defconQt/fontView.py | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'Lib/defconQt/fontView.py') diff --git a/Lib/defconQt/fontView.py b/Lib/defconQt/fontView.py index c5d0ca9..506c842 100644 --- a/Lib/defconQt/fontView.py +++ b/Lib/defconQt/fontView.py @@ -66,6 +66,12 @@ latinDefault = GlyphSet( "tildecomb", "uni0327", "quoteleft", "quoteright", "minus"], "Latin-default") +try: + gitShortHash = subprocess.check_output( + ['git', 'rev-parse', '--short', 'HEAD']).decode() +except: + gitShortHash = "" + class Application(QApplication): currentFontChanged = pyqtSignal() @@ -1244,23 +1250,16 @@ class MainWindow(QMainWindow): self.sortDescriptor = self.sortDescriptor def about(self): - - def getGitShortHash(): - try: - return subprocess.check_output( - ['git', 'rev-parse', '--short', 'HEAD']).decode() - except: - return "" - name = QApplication.applicationName() domain = QApplication.organizationDomain() - text = \ - "

About {n}

" \ - "

{n} is a cross-platform, modular typeface design software.

" \ - "

{n} is built on top of defcon and includes scripting support " \ - "with a robofab-like API.

" \ - "

Version {} {} – Python {}.".format( - __version__, getGitShortHash(), platform.python_version(), n=name) + text = "

About {n}

" \ + "

{n} is a cross-platform, modular typeface design " \ + "application.

{n} is built on top of " \ + "defcon " \ + "and includes scripting support " \ + "with a robofab-like API.

" \ + "

Version {} {} – Python {}.".format( + __version__, gitShortHash, platform.python_version(), n=name) if domain: text += "
See {d} for more " \ "information.

".format(d=domain) -- cgit v1.2.3