diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-12-13 17:38:30 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-12-13 17:38:30 +0300 |
commit | 7fc4ab2aab403e5db27c7dc7097c8db8afc2cfe8 (patch) | |
tree | 5400b0440397ef3011a8af0131815d7e552dc966 /release/getversion.py | |
parent | 1add5b58e8e290003a40cf3a123af22703c2fb3b (diff) |
add pep8 headers so these scripts spit out errors when running pep8.
made some changes but mostly these scripts will give pep8 warnings.
Diffstat (limited to 'release/getversion.py')
-rwxr-xr-x | release/getversion.py | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/release/getversion.py b/release/getversion.py index fd52129bf4a..a9bf3b1d04e 100755 --- a/release/getversion.py +++ b/release/getversion.py @@ -24,15 +24,19 @@ # The Original Code is: see repository. # # Contributor(s): see repository. -# -import sys, os, re -nanblenderhome = os.getenv("NANBLENDERHOME"); +# <pep8-80 compliant> + +import sys +import os +import re + +nanblenderhome = os.getenv("NANBLENDERHOME") if nanblenderhome == None: - nanblenderhome = os.path.dirname(os.path.abspath(sys.argv[0]))+"/.." + nanblenderhome = os.path.dirname(os.path.abspath(sys.argv[0])) + "/.." -config = nanblenderhome+"/source/blender/blenkernel/BKE_blender.h" +config = nanblenderhome + "/source/blender/blenkernel/BKE_blender.h" infile = open(config) @@ -40,23 +44,23 @@ major = None minor = None for line in infile.readlines(): - m = re.search("#define BLENDER_VERSION\s+(\d+)", line) - if m: - major = m.group(1) - m = re.search("#define BLENDER_SUBVERSION\s+(\d+)", line) - if m: - minor = m.group(1) - if minor and major: - major = float(major) / 100.0 - break + m = re.search("#define BLENDER_VERSION\s+(\d+)", line) + if m: + major = m.group(1) + m = re.search("#define BLENDER_SUBVERSION\s+(\d+)", line) + if m: + minor = m.group(1) + if minor and major: + major = float(major) / 100.0 + break infile.close() # Major was changed to float, but minor is still a string if minor and major: - if minor == "0": - print "%.2f" % major - else: - print "%.2f.%s" % (major, minor) + if minor == "0": + print "%.2f" % major + else: + print "%.2f.%s" % (major, minor) else: - print "unknownversion" + print "unknownversion" |