Skip to content

Commit 6d4b8db

Browse files
committed
- version 0.8.9.16
- fixing install.py script - Installing Start Menu Shortcut on Windows
1 parent 1076a6e commit 6d4b8db

File tree

3 files changed

+36
-28
lines changed

3 files changed

+36
-28
lines changed

devel/build_install_pyradio.bat

+5
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ CD ..
110110
:: Install lnk file
111111
ECHO *** Installing Dekstop Shortcut
112112
COPY /Y %APPDATA%\pyradio\help\*.lnk %DESKTOP% >NUL
113+
IF EXIST "%APPDATA%\Microsoft\Windows\Start Menu\Programs" (
114+
ECHO *** Installing Start Menu Shortcut
115+
COPY /Y %APPDATA%\pyradio\help\*.lnk "%APPDATA%\Microsoft\Windows\Start Menu\Programs" >NUL
116+
)
113117

114118
:: Clean up
115119
CD pyradio
@@ -179,6 +183,7 @@ ECHO ECHO Uninstalling PyRadio>>pyremove.bat
179183
:: ECHO ECHO ** Removing executable>>pyremove.bat
180184
ECHO ECHO ** Removing Desktop shortcut>>pyremove.bat
181185
ECHO IF EXIST "%DESKTOP%\PyRadio.lnk" DEL "%DESKTOP%\PyRadio.lnk">>pyremove.bat
186+
ECHO IF EXIST "%APPDATA%\Microsoft\Windows\Start Menu\Programs"\PyRadio.lnk DEL "%APPDATA%\Microsoft\Windows\Start Menu\Programs"\PyRadio.lnk>>pyremove.bat
182187
:: python devel\site.py exe 2>NUL >>pyremove.bat
183188
:: python devel\site.py 2>NUL >dirs
184189
:: python -m site --user-site 2>NUL >>dirs

pyradio/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" pyradio -- Console radio player. "
22

3-
version_info = (0, 8, 9, 15)
3+
version_info = (0, 8, 9, 16)
44

55
# Application state:
66
# New stable version: ''

pyradio/install.py

+30-27
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,8 @@ def _do_it(self, mode='update'):
918918
if platform.system().lower().startswith('linux'):
919919
parser.add_argument('--python2', action='store_true',
920920
help='install using python 2.')
921+
else:
922+
parser.add_argument('--python2', action='store_true', help=SUPPRESS)
921923
parser.add_argument('-R', '--uninstall', action='store_true',
922924
help='uninstall PyRadio.')
923925

@@ -944,33 +946,34 @@ def _do_it(self, mode='update'):
944946
args = parser.parse_args()
945947
sys.stdout.flush()
946948

947-
if args.brew != "False":
948-
if args.brew is None:
949-
param = ' --fix-mac-path'
950-
else:
951-
param = ' --warning --fix-mac-path "' + args.brew + '"'
952-
#### print('parameter: ' + param)
953-
try:
954-
from urllib.request import urlretrieve
955-
except:
956-
from urllib import urlretrieve
957-
try:
958-
r = urlretrieve('https://raw.githubusercontent.com/coderholic/pyradio/master/devel/build_install_pyradio')
959-
except:
960-
print('Cannot contact github...')
961-
sys.exit(1)
962-
if int(r[1]['content-length']) < 1000:
963-
print('Cannot contact github...')
964-
sys.exit(1)
965-
script = r[0]
966-
#### print('script:', script)
967-
if exists('/Users/Max/pyradio/devel/build_install_pyradio'):
968-
script = '/Users/Max/pyradio/devel/build_install_pyradio'
969-
#### print('script:', script)
970-
# now I can run the script
971-
subprocess.call('bash -c "' + script + param + '"', shell=True)
972-
os.remove(r[0])
973-
sys.exit()
949+
if platform.system().lower().startswith('darwin'):
950+
if args.brew != "False":
951+
if args.brew is None:
952+
param = ' --fix-mac-path'
953+
else:
954+
param = ' --warning --fix-mac-path "' + args.brew + '"'
955+
#### print('parameter: ' + param)
956+
try:
957+
from urllib.request import urlretrieve
958+
except:
959+
from urllib import urlretrieve
960+
try:
961+
r = urlretrieve('https://raw.githubusercontent.com/coderholic/pyradio/master/devel/build_install_pyradio')
962+
except:
963+
print('Cannot contact github...')
964+
sys.exit(1)
965+
if int(r[1]['content-length']) < 1000:
966+
print('Cannot contact github...')
967+
sys.exit(1)
968+
script = r[0]
969+
#### print('script:', script)
970+
if exists('/Users/Max/pyradio/devel/build_install_pyradio'):
971+
script = '/Users/Max/pyradio/devel/build_install_pyradio'
972+
#### print('script:', script)
973+
# now I can run the script
974+
subprocess.call('bash -c "' + script + param + '"', shell=True)
975+
os.remove(r[0])
976+
sys.exit()
974977

975978
if not PY3 and not args.python2:
976979
print_trying_to_install()

0 commit comments

Comments
 (0)