diff --git a/py2app.sh b/py2app.sh index fc3faee..bb413a4 100755 --- a/py2app.sh +++ b/py2app.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash ## Cleanup rm -rf build/ dist/ @@ -13,7 +13,7 @@ touch dist/Pesterchum.app/Contents/Resources/qt.conf find dist/Pesterchum.app -iname "*_debug" -exec rm -f '{}' \; ## Create a dmg file to hold everything -VERSION="3.41.2 Beta 5" +VERSION=$(python version.py) #"3.41.2 Beta 5" SIZE=2000 name="Pesterchum" title="${name} ${VERSION}" diff --git a/setup-py2app.py b/setup-py2app.py index 3e75173..e456c66 100644 --- a/setup-py2app.py +++ b/setup-py2app.py @@ -6,13 +6,14 @@ Usage: """ from setuptools import setup +from version import lexVersion APP = ['pesterchum.py'] #DATA_FILES = ['pesterchum.js', 'profiles', 'themes', 'smilies', 'logs'] DATA_FILES = ['quirks', 'themes', 'smilies'] # TODO: Grep this version out of version.py -SHORT_VERSION = '3.41.2B5' -LONG_VERSION = '3.41.2 Beta 5 Bleeding Edge' +SHORT_VERSION = lexVersion(True) #'3.41.2B5' +LONG_VERSION = lexVersion() #'3.41.2 Beta 5 Bleeding Edge' OPTIONS = { 'argv_emulation': False, 'prefer_ppc': True, diff --git a/version.py b/version.py index 07eebdc..d8a6f33 100644 --- a/version.py +++ b/version.py @@ -9,7 +9,7 @@ USER_TYPE = "edge" # edge - new git stuff. bleeding edge, do not try at home (kiooeht version) _pcMajor = "3.41" -_pcMinor = "0" +_pcMinor = "2" _pcStatus = "B" # A = alpha # B = beta # RC = release candidate @@ -24,6 +24,34 @@ def pcVerCalc(): else: _pcVersion = "%s.%s.%s" % (_pcMajor, _pcMinor, _pcRevision) +def lexVersion(short=False): + if not _pcStatus: + return "%s.%s" % (_pcMajor, _pcMinor) + + utype = "" + if USER_TYPE == "edge": + utype = "E" + + if short: + return "%s.%s%s%s%s" % (_pcMajor, _pcMinor, _pcStatus, _pcRevision, utype); + + stype = "" + if _pcStatus == "A": + stype = "Alpha" + elif _pcStatus == "B": + stype = "Beta" + elif _pcStatus == "RC": + stype = "Release Candidate" + + if utype == "E": + utype = " Bleeding Edge" + + return "%s.%s %s %s%s" % (_pcMajor, _pcMinor, stype, _pcRevision, utype); + +# Naughty I know, but it lets me grab it from the bash script. +if __name__ == "__main__": + print lexVersion() + def verStrToNum(ver): w = re.match("(\d+\.?\d+)\.(\d+)-?([A-Za-z]{0,2})\.?(\d*):(\S+)", ver) if not w: