diff options
author | halcy <halcy@ARARAGI-KUN> | 2022-11-30 23:09:09 +0200 |
---|---|---|
committer | halcy <halcy@ARARAGI-KUN> | 2022-11-30 23:09:09 +0200 |
commit | 48f1d31c72de4ce93f19e1235ca06c2b8f9058fa (patch) | |
tree | 090e7c1da1d496dda4d2b34873dbdba3570f317b /mastodon/internals.py | |
parent | 99432f538e0243a12ee575ad6a9ff06c06792dc9 (diff) | |
download | mastodon.py-48f1d31c72de4ce93f19e1235ca06c2b8f9058fa.tar.gz |
carefully move some things into files, test if readthedocs still builds
Diffstat (limited to 'mastodon/internals.py')
-rw-r--r-- | mastodon/internals.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mastodon/internals.py b/mastodon/internals.py index 415e22d..4ee2c5b 100644 --- a/mastodon/internals.py +++ b/mastodon/internals.py | |||
@@ -656,3 +656,14 @@ class Mastodon(): | |||
656 | elif base_url.startswith("https://") or base_url.startswith("onion://"): | 656 | elif base_url.startswith("https://") or base_url.startswith("onion://"): |
657 | base_url = base_url[8:] | 657 | base_url = base_url[8:] |
658 | return base_url | 658 | return base_url |
659 | |||
660 | def __normalize_version_string(self, version_string): | ||
661 | # Split off everything after the first space, to take care of Pleromalikes so that the parser doesn't get confused in case those have a + somewhere in their version | ||
662 | version_string = version_string.split(" ")[0] | ||
663 | try: | ||
664 | # Attempt to split at + and check if the part after parses as a version string, to account for hometown | ||
665 | parse_version_string(version_string.split("+")[1]) | ||
666 | return version_string.split("+")[1] | ||
667 | except: | ||
668 | # If this fails, assume that if there is a +, what is before that is the masto version (or that there is no +) | ||
669 | return version_string.split("+")[0] \ No newline at end of file | ||