Skip to content

Commit a7b90ca

Browse files
committed
updating Windows docs and adding delOldInstallation.py
1 parent cb5d4f8 commit a7b90ca

File tree

9 files changed

+198
-61
lines changed

9 files changed

+198
-61
lines changed

devel/delOldInstallation.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import site
2+
import subprocess
3+
from os import path
4+
5+
paths = site.getsitepackages()
6+
7+
ph = ['', '']
8+
ex = ['', '']
9+
for p in paths:
10+
if 'site-packages' in p:
11+
ph[1] = p
12+
ex[1] = 'RD /Q /S "{}\\pyradio*.egg"'.format(p)
13+
else:
14+
ph[0] = p
15+
ex[0] = 'DEL "{}\\Scripts\\pyradio.exe"'.format(p)
16+
failed = False
17+
for i, x in enumerate(ex):
18+
print('Executing: {}'.format(x), end='', flush=True)
19+
subprocess.call(x, shell=True,
20+
stdout=subprocess.DEVNULL,
21+
stderr=subprocess.DEVNULL)
22+
if path.exists(ph[i]):
23+
print(' ... Failed')
24+
failed = True
25+
else:
26+
print(' ... OK')
27+
28+
if failed:
29+
print('\nPlease run this in a console opened with "Run as Administrator"')

pyradio/install.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,13 @@ def update_or_uninstall_on_windows(self, mode='update', from_pyradio=False, firs
574574
b.write(self._python_exec.python + ' install.py --do-update ' + params[self._package] + '\n')
575575
b.write('if %ERRORLEVEL% == 1 GOTO downloaderror\n')
576576
b.write('cd "' + os.path.join(self._dir, self.ZIP_DIR[self._package]) + '"\n')
577+
578+
b.write('IF EXIST C:\\Users\\Spiros\\pyradio (\n')
579+
b.write('COPY C:\\Users\\Spiros\\pyradio\\pyradio\\*.py pyradio\n')
580+
b.write('COPY C:\\Users\\Spiros\\pyradio\\devel\\*.bat devel\n')
581+
b.write(')\n')
582+
583+
577584
b.write('devel\\build_install_pyradio.bat -U\n')
578585
if first_install:
579586
b.write('CD pyradio\n')
@@ -591,7 +598,14 @@ def update_or_uninstall_on_windows(self, mode='update', from_pyradio=False, firs
591598
# print('self._package = "{}"'.format(self._package))
592599
# print('self.ZIP_DIR = "{}"'.format(self.ZIP_DIR))
593600
b.write('cd "' + os.path.join(self._dir, self.ZIP_DIR[self._package]) + '"\n')
601+
602+
b.write('IF EXIST C:\\Users\\Spiros\\pyradio (\n')
603+
b.write('COPY C:\\Users\\Spiros\\pyradio\\pyradio\\*.py pyradio\n')
604+
b.write('COPY C:\\Users\\Spiros\\pyradio\\devel\\*.bat devel\n')
605+
b.write(')\n')
606+
594607
b.write('devel\\build_install_pyradio.bat -u\n')
608+
b.write('PAUSE\n')
595609
b.write('GOTO endofscript\n')
596610
b.write('ECHO.\n\n')
597611
b.write(':downloaderror\n')
@@ -878,15 +892,15 @@ def _do_it(self, mode='update'):
878892

879893

880894
if __name__ == '__main__':
881-
exe = find_pyradio_win_exe()
882-
print(exe)
883-
sys.exit()
895+
#exe = find_pyradio_win_exe()
896+
#print(exe)
897+
#sys.exit()
884898
# l=get_github_long_description(use_sng_repo=True)
885899
# print(l)
886900
# print(get_devel_version())
887901
# sys.exit()
888-
print_pyradio_on()
889-
print_python3() if PY3 else print_python2()
902+
#print_pyradio_on()
903+
#print_python3() if PY3 else print_python2()
890904
# print(get_devel_version())
891905
# sys.exit()
892906
from argparse import ArgumentParser, SUPPRESS as SUPPRESS

pyradio/radio.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4781,6 +4781,8 @@ def keypress(self, char):
47814781
if self.ws.operation_mode == self.ws.WIN_PRINT_EXE_LOCATION_MODE:
47824782
if char in (ord('q'), curses.KEY_EXIT, 27):
47834783
self.ws.close_window()
4784+
self.refreshBody()
4785+
return
47844786

47854787
if self._limited_height_mode or self._limited_width_mode:
47864788
self._handle_limited_height_keys(char)

windows-mplayer.html

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,14 @@ <h2 id="mplayer-installation">MPlayer installation <span style="padding-left: 10
5252
<p style="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> <em>MPlayer</em> provides CPU type dependent builds. In case you select the wrong <em>mplayer</em> build, you will end up connecting to stations but having no sound. If this is the case, please do go back to the download page and get the right build for your system / CPU.</p>
5353
<p>Extract this directory to whatever place you like and <strong>rename</strong> it to <strong>mplayer</strong>.</p>
5454
<p>Here comes the tricky part…</p>
55-
<p>Move the <strong>mplayer</strong> directory to either on of the following locations (<strong>PyRadio</strong> will look for it there, when executed):</p>
55+
<p>Move the <strong>mplayer</strong> directory to the following location (<strong>PyRadio</strong> will look for it there, when executed):</p>
5656
<ul>
5757
<li><strong>%APPDATA%\pyradio</strong><br />
5858
This is (or will be) “<em>PyRadio’s configuration directory</em>”.<br />
59-
In case the “<em>pyradio</em>” directory does not exit, you just go ahead and create it.</p></li>
60-
<li><strong>%APPDATA%</strong><br />
61-
This is your “Roaming” folder.</p></li>
62-
<li><strong>%USERPROFILE%</strong><br />
63-
This is actually your “<em>Home</em>” directory.</p></li>
59+
In case the “<em>pyradio</em>” directory does not exit, you just go ahead and create it.</li>
6460
</ul>
65-
<p>In either case, in order to do that, open an <strong>Explorer File Manager</strong> window, and enter at its location field <strong>%USERPROFILE%</strong> or <strong>%APPDATA%</strong>.</p>
66-
<p>If you are unsure on how to do that, please refer to the following image (you can ENTER <strong>%USERPROFILE%</strong> or <strong>%APPDATA%</strong> or any other Windows System Variable this way).</p>
61+
<p>In order to do that, open an <strong>Explorer File Manager</strong> window, and enter <strong>%APPDATA%</strong>” at its location field and press ENTER.</p>
62+
<p>If you are unsure on how to do that, please refer to the following image (you can ENTER <strong>%APPDATA%</strong> or any other Windows System Variable this way).</p>
6763
<a href="https://members.hellug.gr/sng/pyradio/appdata.jpg" target="_blank"><img src="https://members.hellug.gr/sng/pyradio/appdata.jpg" alt="Navigating to %APPDATA%" /></a>
6864
</body>
6965
</html>

windows-mplayer.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,15 @@ Extract this directory to whatever place you like and **rename** it to **mplayer
2828

2929
Here comes the tricky part...
3030

31-
Move the **mplayer** directory to either on of the following locations (**PyRadio** will look for it there, when executed):
31+
Move the **mplayer** directory to the following location (**PyRadio** will look for it there, when executed):
3232

3333
- **%APPDATA%\\pyradio** \
3434
This is (or will be) "*PyRadio's configuration directory*". \
3535
In case the "*pyradio*" directory does not exit, you just go ahead and create it.
3636

37-
- **%APPDATA%** \
38-
This is your "Roaming" folder.
37+
In order to do that, open an **Explorer File Manager** window, and enter "**%APPDATA%**" at its location field and press ENTER.
3938

40-
- **%USERPROFILE%** \
41-
This is actually your "*Home*" directory.
42-
43-
44-
In either case, in order to do that, open an **Explorer File Manager** window, and enter at its location field **%USERPROFILE%** or **%APPDATA%**.
45-
46-
If you are unsure on how to do that, please refer to the following image (you can ENTER **%USERPROFILE%** or **%APPDATA%** or any other Windows System Variable this way).
39+
If you are unsure on how to do that, please refer to the following image (you can ENTER **%APPDATA%** or any other Windows System Variable this way).
4740

4841
![Navigating to %APPDATA%](https://members.hellug.gr/sng/pyradio/appdata.jpg)
4942

windows-mpv.html

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,14 @@ <h2 id="mpv-installation">MPV installation <span style="padding-left: 10px;"><su
5151
<p>You will end up downloading a <a target="_blank" href="https://www.7-zip.org/">7z archive</a>, which contains a directory whose name is similar to <strong>mpv-0.34.-x86_64.7z</strong>.</p>
5252
<p>Extract this archive to whatever place you like and <strong>rename</strong> it to <strong>mpv</strong>.</p>
5353
<p>Here comes the tricky part…</p>
54-
<p>Move the <strong>mpv</strong> directory to either on of the following locations (<strong>PyRadio</strong> will look for it there, when executed):</p>
54+
<p>Move the <strong>mpv</strong> directory to the following location (<strong>PyRadio</strong> will look for it there, when executed):</p>
5555
<ul>
5656
<li><strong>%APPDATA%\pyradio</strong><br />
5757
This is (or will be) “<em>PyRadio’s configuration directory</em>”.<br />
58-
In case the “<em>pyradio</em>” directory does not exit, you just go ahead and create it.</p></li>
59-
<li><strong>%APPDATA%</strong><br />
60-
This is your “Roaming” folder.</p></li>
61-
<li><strong>%USERPROFILE%</strong><br />
62-
This is actually your “<em>Home</em>” directory.</p></li>
58+
In case the “<em>pyradio</em>” directory does not exit, you just go ahead and create it.</li>
6359
</ul>
64-
<p>In either case, in order to do that, open an <strong>Explorer File Manager</strong> window, and enter at its location field <strong>%USERPROFILE%</strong> or <strong>%APPDATA%</strong>.</p>
65-
<p>If you are unsure on how to do that, please refer to the following image (you can ENTER <strong>%USERPROFILE%</strong> or <strong>%APPDATA%</strong> or any other Windows System Variable this way).</p>
60+
<p>In order to do that, open an <strong>Explorer File Manager</strong> window, and enter “**%APPDATA%” at its location field and press ENTER.</p>
61+
<p>If you are unsure on how to do that, please refer to the following image (you can ENTER <strong>%APPDATA%</strong> or any other Windows System Variable this way).</p>
6662
<a href="https://members.hellug.gr/sng/pyradio/appdata.jpg" target="_blank"><img src="https://members.hellug.gr/sng/pyradio/appdata.jpg" alt="Navigating to %APPDATA%" /></a>
6763
</body>
6864
</html>

windows-mpv.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,15 @@ Extract this archive to whatever place you like and **rename** it to **mpv**.
2727
Here comes the tricky part...
2828

2929

30-
Move the **mpv** directory to either on of the following locations (**PyRadio** will look for it there, when executed):
30+
Move the **mpv** directory to the following location (**PyRadio** will look for it there, when executed):
3131

3232
- **%APPDATA%\\pyradio** \
3333
This is (or will be) "*PyRadio's configuration directory*". \
3434
In case the "*pyradio*" directory does not exit, you just go ahead and create it.
3535

36-
- **%APPDATA%** \
37-
This is your "Roaming" folder.
36+
In order to do that, open an **Explorer File Manager** window, and enter "**%APPDATA%" at its location field and press ENTER.
3837

39-
- **%USERPROFILE%** \
40-
This is actually your "*Home*" directory.
41-
42-
43-
In either case, in order to do that, open an **Explorer File Manager** window, and enter at its location field **%USERPROFILE%** or **%APPDATA%**.
44-
45-
If you are unsure on how to do that, please refer to the following image (you can ENTER **%USERPROFILE%** or **%APPDATA%** or any other Windows System Variable this way).
38+
If you are unsure on how to do that, please refer to the following image (you can ENTER **%APPDATA%** or any other Windows System Variable this way).
4639

4740
![Navigating to %APPDATA%](https://members.hellug.gr/sng/pyradio/appdata.jpg)
4841

0 commit comments

Comments
 (0)