aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2017-12-14 13:32:52 +0100
committerLorenz Diener <[email protected]>2017-12-14 13:32:52 +0100
commit20c1d95b45ae86678c748d5046de7bae8843e4a7 (patch)
tree977b647184b82af4a142d118b3c012c15000c770 /mastodon
parent5a94c46bb47de3aeb44cbfabfa9b422310d57449 (diff)
downloadmastodon.py-20c1d95b45ae86678c748d5046de7bae8843e4a7.tar.gz
Fix version check
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/Mastodon.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index b276291..2d51561 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -44,16 +44,16 @@ def api_version(created_ver, last_changed_ver):
44 def wrapper(function, self, *args, **kwargs): 44 def wrapper(function, self, *args, **kwargs):
45 if not self.version_check_mode == "none": 45 if not self.version_check_mode == "none":
46 if self.version_check_mode == "created": 46 if self.version_check_mode == "created":
47 version = created_version 47 version = created_ver
48 else: 48 else:
49 version = last_changed_ver 49 version = last_changed_ver
50 major, minor, patch = parse_version_string(version) 50 major, minor, patch = parse_version_string(version)
51 if major > self.mastodon_major: 51 if major > self.mastodon_major:
52 raise MastodonVersionError("Version check failed (Need version " + version + ")") 52 raise MastodonVersionError("Version check failed (Need version " + version + ")")
53 elif major == self.mastodon_major and minor > self.mastodon_minor: 53 elif major == self.mastodon_major and minor > self.mastodon_minor:
54 raise MastodonVersionError("Version check failed (Need version " + version + ")") 54 raise MastodonVersionError("Version check failed (Need version " + version + ")")
55 elif major == self.mastodon_major and minor == self.mastodon_minor and patch > self.mastodon_patch: 55 elif major == self.mastodon_major and minor == self.mastodon_minor and patch > self.mastodon_patch:
56 raise MastodonVersionError("Version check failed (Need version " + version + ")") 56 raise MastodonVersionError("Version check failed (Need version " + version + ")")
57 return function(self, *args, **kwargs) 57 return function(self, *args, **kwargs)
58 function.__doc__ = function.__doc__ + "\n\n *Added: Mastodon v" + created_ver + ", last changed: Mastodon v" + last_changed_ver + "*" 58 function.__doc__ = function.__doc__ + "\n\n *Added: Mastodon v" + created_ver + ", last changed: Mastodon v" + last_changed_ver + "*"
59 return decorate(function, wrapper) 59 return decorate(function, wrapper)
Powered by cgit v1.2.3 (git 2.41.0)