summaryrefslogtreecommitdiffstats
path: root/version.py
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2014-09-03 22:28:28 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2014-09-03 23:48:34 +0100
commit5167e93d12cb9f3c43ab2cecdac3961dac6b0fb2 (patch)
tree92c4504c3943999836edeeaee2b52af3f04dd6c4 /version.py
parent5d88504c34bab3d00c338ad7f5da7048beba9223 (diff)
downloaddeluge-5167e93d12cb9f3c43ab2cecdac3961dac6b0fb2.tar.gz
deluge-5167e93d12cb9f3c43ab2cecdac3961dac6b0fb2.tar.bz2
deluge-5167e93d12cb9f3c43ab2cecdac3961dac6b0fb2.zip
Flake8 core and common files
* Added N802 to flake8 ignore as certain inherited funcs cannot be changed to lowercase and this unresolved warning hides other errors/warnings. * Include new header
Diffstat (limited to 'version.py')
-rw-r--r--version.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/version.py b/version.py
index f20fc4863..feb6a4f4e 100644
--- a/version.py
+++ b/version.py
@@ -35,18 +35,20 @@ __all__ = ("get_version")
from subprocess import Popen, PIPE
VERSION_FILE = "RELEASE-VERSION"
-def call_git_describe(prefix='', suffix=''):
- cmd = 'git describe --tags --match %s[0-9]*' % prefix
+
+def call_git_describe(prefix="", suffix=""):
+ cmd = "git describe --tags --match %s[0-9]*" % prefix
try:
version = Popen(cmd.split(), stdout=PIPE).communicate()[0]
- version = version.strip().replace(prefix, '')
- if '-' in version:
- version = '.dev'.join(version.replace(suffix,'').split('-')[:2])
+ version = version.strip().replace(prefix, "")
+ if "-" in version:
+ version = ".dev".join(version.replace(suffix, "").split("-")[:2])
return version
except:
return None
-def get_version(prefix='', suffix=''):
+
+def get_version(prefix="", suffix=""):
try:
with open(VERSION_FILE, "r") as f:
release_version = f.readline().strip()
@@ -67,4 +69,4 @@ def get_version(prefix='', suffix=''):
return version
if __name__ == "__main__":
- print get_version(prefix='deluge-', suffix='.dev0')
+ print get_version(prefix="deluge-", suffix=".dev0")