From 3765f25fd8f16757b37daa23336c8be642438858 Mon Sep 17 00:00:00 2001 From: Maveno Date: Sun, 29 Sep 2024 16:15:56 +0200 Subject: [PATCH] ff --- bin/ffx/ffx_app.py | 14 ----- bin/ffx/language_data.py | 93 ---------------------------------- bin/ffx/show_details_screen.py | 2 - 3 files changed, 109 deletions(-) delete mode 100644 bin/ffx/language_data.py diff --git a/bin/ffx/ffx_app.py b/bin/ffx/ffx_app.py index 6567f5c..5c21b1d 100644 --- a/bin/ffx/ffx_app.py +++ b/bin/ffx/ffx_app.py @@ -22,19 +22,9 @@ class FfxApp(App): BINDINGS = [ ("q", "quit()", "Quit"), - # ("d", "switch_mode('dashboard')", "Dashboard"), - # ("s", "switch_mode('settings')", "Settings"), ("h", "switch_mode('help')", "Help"), ] - # MODES = { - # "shows": ShowsScreen, - # "warning": WarningScreen, - # "dashboard": DashboardScreen, - # "settings": SettingsScreen, - # "help": HelpScreen, - # } - def __init__(self, context = {}): super().__init__() @@ -67,10 +57,6 @@ class FfxApp(App): def on_mount(self) -> None: - - - # Show Shows Screen - #self.switch_mode("shows") self.push_screen(ShowsScreen()) diff --git a/bin/ffx/language_data.py b/bin/ffx/language_data.py deleted file mode 100644 index 23201db..0000000 --- a/bin/ffx/language_data.py +++ /dev/null @@ -1,93 +0,0 @@ -from enum import Enum -import difflib - -class LanguageData(Enum): - - AFRIKAANS = {"name": "Afrikaans", "iso639_1": "af", "iso639_2": "afr"} - ALBANIAN = {"name": "Albanian", "iso639_1": "sq", "iso639_2": "alb"} - ARABIC = {"name": "Arabic", "iso639_1": "ar", "iso639_2": "ara"} - ARMENIAN = {"name": "Armenian", "iso639_1": "hy", "iso639_2": "arm"} - AZERBAIJANI = {"name": "Azerbaijani", "iso639_1": "az", "iso639_2": "aze"} - BASQUE = {"name": "Basque", "iso639_1": "eu", "iso639_2": "baq"} - BELARUSIAN = {"name": "Belarusian", "iso639_1": "be", "iso639_2": "bel"} - BULGARIAN = {"name": "Bulgarian", "iso639_1": "bg", "iso639_2": "bul"} - CATALAN = {"name": "Catalan", "iso639_1": "ca", "iso639_2": "cat"} - CHINESE = {"name": "Chinese", "iso639_1": "zh", "iso639_2": "chi"} - CROATIAN = {"name": "Croatian", "iso639_1": "hr", "iso639_2": "hrv"} - CZECH = {"name": "Czech", "iso639_1": "cs", "iso639_2": "cze"} - DANISH = {"name": "Danish", "iso639_1": "da", "iso639_2": "dan"} - DUTCH = {"name": "Dutch", "iso639_1": "nl", "iso639_2": "dut"} - ENGLISH = {"name": "English", "iso639_1": "en", "iso639_2": "eng"} - ESTONIAN = {"name": "Estonian", "iso639_1": "et", "iso639_2": "est"} - FINNISH = {"name": "Finnish", "iso639_1": "fi", "iso639_2": "fin"} - FRENCH = {"name": "French", "iso639_1": "fr", "iso639_2": "fre"} - GEORGIAN = {"name": "Georgian", "iso639_1": "ka", "iso639_2": "geo"} - GERMAN = {"name": "German", "iso639_1": "de", "iso639_2": "ger"} - GREEK = {"name": "Greek", "iso639_1": "el", "iso639_2": "gre"} - HEBREW = {"name": "Hebrew", "iso639_1": "he", "iso639_2": "heb"} - HINDI = {"name": "Hindi", "iso639_1": "hi", "iso639_2": "hin"} - HUNGARIAN = {"name": "Hungarian", "iso639_1": "hu", "iso639_2": "hun"} - ICELANDIC = {"name": "Icelandic", "iso639_1": "is", "iso639_2": "ice"} - INDONESIAN = {"name": "Indonesian", "iso639_1": "id", "iso639_2": "ind"} - IRISH = {"name": "Irish", "iso639_1": "ga", "iso639_2": "gle"} - ITALIAN = {"name": "Italian", "iso639_1": "it", "iso639_2": "ita"} - JAPANESE = {"name": "Japanese", "iso639_1": "ja", "iso639_2": "jpn"} - KAZAKH = {"name": "Kazakh", "iso639_1": "kk", "iso639_2": "kaz"} - KOREAN = {"name": "Korean", "iso639_1": "ko", "iso639_2": "kor"} - LATIN = {"name": "Latin", "iso639_1": "la", "iso639_2": "lat"} - LATVIAN = {"name": "Latvian", "iso639_1": "lv", "iso639_2": "lav"} - LITHUANIAN = {"name": "Lithuanian", "iso639_1": "lt", "iso639_2": "lit"} - MACEDONIAN = {"name": "Macedonian", "iso639_1": "mk", "iso639_2": "mac"} - MALAY = {"name": "Malay", "iso639_1": "ms", "iso639_2": "may"} - MALTESE = {"name": "Maltese", "iso639_1": "mt", "iso639_2": "mlt"} - NORWEGIAN = {"name": "Norwegian", "iso639_1": "no", "iso639_2": "nor"} - PERSIAN = {"name": "Persian", "iso639_1": "fa", "iso639_2": "per"} - POLISH = {"name": "Polish", "iso639_1": "pl", "iso639_2": "pol"} - PORTUGUESE = {"name": "Portuguese", "iso639_1": "pt", "iso639_2": "por"} - ROMANIAN = {"name": "Romanian", "iso639_1": "ro", "iso639_2": "rum"} - RUSSIAN = {"name": "Russian", "iso639_1": "ru", "iso639_2": "rus"} - NORTHERN_SAMI = {"name": "Northern Sami", "iso639_1": "se", "iso639_2": "sme"} - SAMOAN = {"name": "Samoan", "iso639_1": "sm", "iso639_2": "smo"} - SANGO = {"name": "Sango", "iso639_1": "sg", "iso639_2": "sag"} - SANSKRIT = {"name": "Sanskrit", "iso639_1": "sa", "iso639_2": "san"} - SARDINIAN = {"name": "Sardinian", "iso639_1": "sc", "iso639_2": "srd"} - SERBIAN = {"name": "Serbian", "iso639_1": "sr", "iso639_2": "srp"} - SHONA = {"name": "Shona", "iso639_1": "sn", "iso639_2": "sna"} - SINDHI = {"name": "Sindhi", "iso639_1": "sd", "iso639_2": "snd"} - SINHALA = {"name": "Sinhala", "iso639_1": "si", "iso639_2": "sin"} - SLOVAK = {"name": "Slovak", "iso639_1": "sk", "iso639_2": "slk"} - SLOVENIAN = {"name": "Slovenian", "iso639_1": "sl", "iso639_2": "slv"} - SOMALI = {"name": "Somali", "iso639_1": "so", "iso639_2": "som"} - SOUTHERN_SOTHO = {"name": "Southern Sotho", "iso639_1": "st", "iso639_2": "sot"} - SPANISH = {"name": "Spanish", "iso639_1": "es", "iso639_2": "spa"} - SUNDANESE = {"name": "Sundanese", "iso639_1": "su", "iso639_2": "sun"} - SWAHILI = {"name": "Swahili", "iso639_1": "sw", "iso639_2": "swa"} - SWATI = {"name": "Swati", "iso639_1": "ss", "iso639_2": "ssw"} - SWEDISH = {"name": "Swedish", "iso639_1": "sv", "iso639_2": "swe"} - TAGALOG = {"name": "Tagalog", "iso639_1": "tl", "iso639_2": "tgl"} - TAMIL = {"name": "Tamil", "iso639_1": "ta", "iso639_2": "tam"} - THAI = {"name": "Thai", "iso639_1": "th", "iso639_2": "tha"} - TURKISH = {"name": "Turkish", "iso639_1": "tr", "iso639_2": "tur"} - UKRAINIAN = {"name": "Ukrainian", "iso639_1": "uk", "iso639_2": "ukr"} - URDU = {"name": "Urdu", "iso639_1": "ur", "iso639_2": "urd"} - VIETNAMESE = {"name": "Vietnamese", "iso639_1": "vi", "iso639_2": "vie"} - WELSH = {"name": "Welsh", "iso639_1": "cy", "iso639_2": "wel"} - -def find(name : str): - - closestMatches = difflib.get_close_matches(name, [l.value["name"] for l in LanguageData], n=1) - - if closestMatches: - foundLangs = [l for l in LanguageData if l.value['name'] == closestMatches[0]] - return foundLangs[0] if foundLangs else None - else: - return None - -def get(lang : str): - - selectedLangs = [l for l in LanguageData if l.value['iso639_2'] == lang] - - if selectedLangs: - return selectedLangs[0] - else: - return None diff --git a/bin/ffx/show_details_screen.py b/bin/ffx/show_details_screen.py index cfed332..194e17b 100644 --- a/bin/ffx/show_details_screen.py +++ b/bin/ffx/show_details_screen.py @@ -124,12 +124,10 @@ class ShowDetailsScreen(Screen): #selected_row_index = self.table.cursor_row row_key, col_key = self.patternTable.coordinate_to_cell_key(self.patternTable.cursor_coordinate) - if row_key is not None: selected_row_data = self.patternTable.get_row(row_key) selectedPattern['pattern'] = str(selected_row_data[0]) - #selectedPattern['pattern'] = selected_row_data[1] except CellDoesNotExist: pass