Skip to content

Commit

Permalink
- adding functionality to class PyRadioLocalized
Browse files Browse the repository at this point in the history
- adding classes LetterProvider and LetterDisplay to keyboard.py
- class SimpleCursesMenu gains more functionality
- when the External Player is used, pyradio will not exit; it
  will reload the tui and continue from where it left off
- fixing mpv metadata collection (Audio, Codec Name and Codec)
- removing more python 2 code
  • Loading branch information
s-n-g committed Dec 31, 2024
1 parent a3818e4 commit b41da39
Show file tree
Hide file tree
Showing 17 changed files with 1,255 additions and 477 deletions.
13 changes: 7 additions & 6 deletions pyradio/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2131,8 +2131,8 @@ def _read_localized_shortcuts(self, name=None):
# Construct potential paths
script_dir_path = path.join(path.dirname(__file__), 'keyboard', name + '.json')
full_path = path.join(self.data_dir, name + '.json')
logger.error(f'{script_dir_path = }')
logger.error(f'{full_path = }')
# logger.error(f'{script_dir_path = }')
# logger.error(f'{full_path = }')

reversed_dict = {}
# Check which file path exists
Expand All @@ -2144,7 +2144,7 @@ def _read_localized_shortcuts(self, name=None):
# Return an empty dictionary if neither path exists
target_path = None

logger.error(f'{target_path = }')
# logger.error(f'{target_path = }')
if target_path is None:
set_lkbkey({})
else:
Expand All @@ -2158,6 +2158,7 @@ def _read_localized_shortcuts(self, name=None):
# Reverse the keys and values
reversed_dict = {value: key for key, value in data.items()}

# logger.error('\n\nsetting lkbkey 1\n{}\n\n'.format(reversed_dict))
set_lkbkey(reversed_dict)

def read_config(self, distro_config=False):
Expand Down Expand Up @@ -2378,9 +2379,9 @@ def _read_config(self, distro_config=False):
self._linux_resource_opener = ' '.join(tmp)
self.opts['resource_opener'][1] = sp[1]
elif sp[0] == 'localized_keys':
logger.error(f'{sp[1] = }')
# logger.error(f'{sp[1] = }')
self.localize = None if sp[1].strip().lower() == 'none' else sp[1].strip().lower()
logger.error(f'{self.localize = }')
# logger.error(f'{self.localize = }')
self._old_localize = self.localize

# logger.error('\n\nself.params{}\n\n'.format(self.params))
Expand Down Expand Up @@ -2471,7 +2472,7 @@ def _read_config(self, distro_config=False):
# do this here to get proper schedule and keyboard config filepath if XDG is on
self.schedule_file = path.join(self.data_dir, 'schedule.json')
self.keyboard_file = path.join(self.data_dir, 'keyboard.json')
logger.error(f'{self.keyboard_file = }')
# logger.error(f'{self.keyboard_file = }')
if not self.headless and not distro_config:
read_keyboard_shortcuts(self.keyboard_file)
read_localized_keyboard(
Expand Down
Loading

0 comments on commit b41da39

Please sign in to comment.