Skip to content

Commit

Permalink
pylint: invalid-name
Browse files Browse the repository at this point in the history
  • Loading branch information
Rechi committed Jun 9, 2024
1 parent cbb7acd commit f824679
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
32 changes: 16 additions & 16 deletions resources/lib/Addon.py → resources/lib/addon.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import sys

from Kodi import *
from kodi import *
import routing

settings_file = 'settings.json'
channel_map_file = 'channels.json'
search_history_file = 'search_history'
SETTINGS_FILE = 'settings.json'
CHANNEL_MAP_FILE = 'channels.json'
SEARCH_HISTORY_FILE = 'search_history'

route_plugin = routing.Plugin()
kodi_worker = Kodi(route_plugin)
if not sys.argv[0].startswith('plugin:https://' + kodi_worker.addon_id + '/dialog'):
channel_map, channel_map_cached = kodi_worker.get_cached_file(channel_map_file)
settings, settings_cached = kodi_worker.get_cached_file(settings_file)
channel_map, channel_map_cached = kodi_worker.get_cached_file(CHANNEL_MAP_FILE)
settings, settings_cached = kodi_worker.get_cached_file(SETTINGS_FILE)
api = OrfOn(channel_map=channel_map, settings=settings, useragent=kodi_worker.useragent, kodi_worker=kodi_worker)
api.set_pager_limit(kodi_worker.pager_limit)
api.set_segments_behaviour(kodi_worker.use_segments)
Expand All @@ -22,10 +22,10 @@

# Only overwrite if cache was invalidated
if not channel_map_cached:
kodi_worker.save_json(channel_map, channel_map_file)
kodi_worker.save_json(channel_map, CHANNEL_MAP_FILE)

if not settings_cached:
kodi_worker.save_json(settings, settings_file)
kodi_worker.save_json(settings, SETTINGS_FILE)


@route_plugin.route('/')
Expand Down Expand Up @@ -195,7 +195,7 @@ def get_search():
search_link = '/search/query'
search_dir = Directory(kodi_worker.get_translation(30131, 'Enter search ...', '%s ...'), "", search_link, translator=kodi_worker)
kodi_worker.render(search_dir)
directories = kodi_worker.get_stored_directories(search_history_file)
directories = kodi_worker.get_stored_directories(SEARCH_HISTORY_FILE)
for directory in directories:
kodi_worker.render(directory)
kodi_worker.list_callback()
Expand Down Expand Up @@ -237,7 +237,7 @@ def get_search_dialog():
def clear_search_history():
dialog = kodi_worker.get_progress_dialog(kodi_worker.get_translation(30132, 'Clearing search history'))
dialog.update(0, kodi_worker.get_translation(30133, 'Clearing ...', '%s ...'))
kodi_worker.clear_stored_directories(search_history_file)
kodi_worker.clear_stored_directories(SEARCH_HISTORY_FILE)
dialog.update(100, kodi_worker.get_translation(30134, 'Done'))
dialog.close()

Expand All @@ -247,19 +247,19 @@ def clear_cache():
dialog = kodi_worker.get_progress_dialog('Reloading cache')
dialog.update(0, kodi_worker.get_translation(30136, 'Reloading cache ...', '%s ...'))
kodi_worker.log("Reloading channel/settings cache", 'route')
tmp_channel_map, tmp_channel_map_cached = kodi_worker.get_cached_file(channel_map_file)
tmp_settings, tmp_settings_cached = kodi_worker.get_cached_file(settings_file)
kodi_worker.remove_file(settings_file)
kodi_worker.remove_file(channel_map_file)
tmp_channel_map, tmp_channel_map_cached = kodi_worker.get_cached_file(CHANNEL_MAP_FILE)
tmp_settings, tmp_settings_cached = kodi_worker.get_cached_file(SETTINGS_FILE)
kodi_worker.remove_file(SETTINGS_FILE)
kodi_worker.remove_file(CHANNEL_MAP_FILE)
tmp_api = OrfOn(channel_map=tmp_channel_map, settings=tmp_settings, useragent=kodi_worker.useragent, kodi_worker=kodi_worker)
tmp_api.channel_map = False
tmp_api.settings = False
dialog.update(33, kodi_worker.get_translation(30137, 'Loading channels'))
tmp_channel_map = tmp_api.get_channel_map()
kodi_worker.save_json(tmp_channel_map, channel_map_file)
kodi_worker.save_json(tmp_channel_map, CHANNEL_MAP_FILE)
dialog.update(66, kodi_worker.get_translation(30138, 'Loading settings'))
tmp_settings = tmp_api.get_settings()
kodi_worker.save_json(tmp_settings, settings_file)
kodi_worker.save_json(tmp_settings, SETTINGS_FILE)
dialog.update(100, kodi_worker.get_translation(30134, 'Done'))
dialog.close()

Expand Down
4 changes: 2 additions & 2 deletions resources/lib/default.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

import Addon
import addon

Addon.run()
addon.run()
File renamed without changes.
4 changes: 2 additions & 2 deletions resources/lib/Kodi.py → resources/lib/kodi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
from urllib.parse import unquote

try:
from OrfOn import *
from orf_on import *
except ModuleNotFoundError:
from resources.lib.OrfOn import *
from resources.lib.orf_on import *


class Kodi:
Expand Down
4 changes: 2 additions & 2 deletions resources/lib/OrfOn.py → resources/lib/orf_on.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import re
from datetime import date, timedelta
try:
from Directory import *
from directory import *
except ModuleNotFoundError:
from resources.lib.Directory import *
from resources.lib.directory import *

from urllib.request import Request as urllib_Request
from urllib.request import urlopen as urllib_urlopen
Expand Down

0 comments on commit f824679

Please sign in to comment.