1
0
mirror of https://github.com/ihabunek/toot synced 2024-12-23 07:27:12 +01:00

Delete unused code

This commit is contained in:
Ivan Habunek 2023-12-04 18:46:45 +01:00
parent eaaa14cfc2
commit b9d0c1f7c2
No known key found for this signature in database
GPG Key ID: F5F0623FF5EBCB3D

View File

@ -127,17 +127,6 @@ def editor_input(editor: str, initial_text: str):
return f.read().split(EDITOR_DIVIDER)[0].strip() return f.read().split(EDITOR_DIVIDER)[0].strip()
def read_char(values, default):
values = [v.lower() for v in values]
while True:
value = input().lower()
if value == "":
return default
if value in values:
return value
def delete_tmp_status_file(): def delete_tmp_status_file():
try: try:
os.unlink(_tmp_status_path()) os.unlink(_tmp_status_path())
@ -166,32 +155,6 @@ def drop_empty_values(data: Dict) -> Dict:
return {k: v for k, v in data.items() if v is not None} return {k: v for k, v in data.items() if v is not None}
def args_get_instance(instance, scheme, default=None):
if not instance:
return default
if scheme == "http":
_warn_scheme_deprecated()
if instance.startswith("http"):
return instance.rstrip("/")
else:
return f"{scheme}://{instance}"
def _warn_scheme_deprecated():
from toot.output import print_err
print_err("\n".join([
"--disable-https flag is deprecated and will be removed.",
"Please specify the instance as URL instead.",
"e.g. instead of writing:",
" toot instance unsafehost.com --disable-https",
"instead write:",
" toot instance http://unsafehost.com\n"
]))
def urlencode_url(url): def urlencode_url(url):
parsed_url = urlparse(url) parsed_url = urlparse(url)