Skip to content

Commit

Permalink
- version 0.9.3.11.1 (BUG FIX) - 0.9.3.12-beta1
Browse files Browse the repository at this point in the history
- fixing makedirs in radio.py
- fixing patool installation in win.py
  • Loading branch information
s-n-g committed Oct 17, 2024
1 parent 3f2af22 commit faef8be
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
2024-10-16 s-n-g
2024-10-17 s-n-g
* version 0.9.3.11.1 (BUG FIX) - 0.9.3.12-beta1
* adding -sdd (--show_dirs) command line parameter
* fixing a couple of bugs (some reported by pylint /ruff)
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ <h2 id="requirements">Requirements <span style="padding-left: 10px;"><sup style=
<h2 id="changelog">Changelog <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
<pre style="height: 200px;">

2024-10-16 s-n-g
2024-10-17 s-n-g
* version 0.9.3.11.1 (BUG FIX) - 0.9.3.12-beta1
* adding -sdd (--show_dirs) command line parameter
* fixing a couple of bugs (some reported by pylint /ruff)
Expand Down
10 changes: 6 additions & 4 deletions pyradio/radio.py
Original file line number Diff line number Diff line change
Expand Up @@ -5746,8 +5746,10 @@ def _tag_a_title(self, html=False, text=False):
if self._cnf.can_like_a_station():
if not path.exists(self._cnf.recording_dir):
try:
makedirs(self._cnf.recording_dir)
except:
os.makedirs(self._cnf.recording_dir)
except (
FileExistsError, FileNotFoundError,
PermissionError, OSError):
pass
if not path.exists(self._cnf.recording_dir):
if logger.isEnabledFor(logging.ERROR):
Expand Down Expand Up @@ -6155,7 +6157,7 @@ def keypress(self, char):
if self._open_dir_win.dir == path.join(path.expanduser('~'), 'pyradio-recordings'):
if not path.exists(self._open_dir_win.dir):
try:
makedirs(self._open_dir_win.dir)
os.makedirs(self._open_dir_win.dir)
except:
self._show_delayed_notification(
'___|Error|: Recording dir does |not exist|!___',
Expand Down Expand Up @@ -9252,7 +9254,7 @@ def _start_player(self, mode=None):
if self.player.recording > 0:
if not os.path.exists(self._cnf.recording_dir):
try:
makedirs(self._cnf.recording_dir)
os.makedirs(self._cnf.recording_dir)
except:
pass
if not os.path.exists(self._cnf.recording_dir):
Expand Down
23 changes: 15 additions & 8 deletions pyradio/win.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,17 +329,24 @@ def download_player(output_folder=None, package=1, do_not_exit=False):
download_seven_zip(output_folder)

if not HAVE_PYUNPACK:
for a_module in ('pyunpack', 'patool'):
install_module(a_module, print_msg=False)
install_module('pyunpack', print_msg=False)
from pyunpack import Archive

patool_exec = join(site.USER_SITE.replace('site-packages', 'Scripts'), 'patool')
if not exists(patool_exec):
patool_exec = glob.glob(join(environ['APPDATA'], '**', 'patool.exe'), recursive=True)
if patool_exec:
patool_exec = patool_exec[0]
count = 0
while True:
patool_exec = join(site.USER_SITE.replace('site-packages', 'Scripts'), 'patool')
if exists(patool_exec):
break
else:
patool_exec = None
patool_exec = glob.glob(join(environ['APPDATA'], '**', 'patool.exe'), recursive=True)
if patool_exec:
patool_exec = patool_exec[0]
break
else:
install_module('patool', print_msg=False)
count += 1
if count > 2:
break
try:
Archive(out_file).extractall(join(output_folder, 'mpv' if package==0 else ''),
auto_create_dir=True,
Expand Down

0 comments on commit faef8be

Please sign in to comment.