Skip to content

Commit 241860a

Browse files
committed
removing -cp, --check-playlist command line argument
1 parent 61a9853 commit 241860a

File tree

1 file changed

+15
-36
lines changed

1 file changed

+15
-36
lines changed

pyradio/main.py

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ def __configureLogger(pyradio_config, debug=None, titles=None):
146146
if debug or titles:
147147

148148
if debug and \
149-
not pyradio_config.log_debug and \
150-
not pyradio_config.check_playlist:
149+
not pyradio_config.log_debug:
151150
if platform.startswith('win'):
152151
print(r'''Debug mode activated
153152
printing messages to file: "[red]{}\pyradio.log[/red]"'''.format(getenv('USERPROFILE')))
@@ -299,8 +298,6 @@ def shell():
299298
help='When -d is used, this option will not log player input (value = 0), log accepted input (value = 1) or raw input (value = 2).')
300299
parser.add_argument('-ul', '--unlock', action='store_true',
301300
help="Remove sessions' lock file.")
302-
parser.add_argument('-cp', '--check-playlist', action='store_true',
303-
help='Enter playlist check mode.')
304301
parser.add_argument('-us', '--update-stations', action='store_true',
305302
help='Update "stations.csv" (if needed).')
306303
parser.add_argument('-U', '--update', action='store_true',
@@ -501,7 +498,7 @@ def shell():
501498
sys.exit(1)
502499

503500
with pyradio_config_file(user_config_dir, args.headless) as pyradio_config:
504-
read_config(pyradio_config, args.check_playlist)
501+
read_config(pyradio_config)
505502

506503
# handle playilst validation
507504
if args.validate:
@@ -596,12 +593,6 @@ def shell():
596593

597594
sys.exit(0)
598595

599-
if args.check_playlist:
600-
pyradio_config.check_playlist = args.check_playlist
601-
args.play = 'False'
602-
args.debug = True
603-
args.d_player_input = '2'
604-
605596
if not system().lower().startswith('darwin') and \
606597
not system().lower().startswith('win'):
607598
# if args.generate_systemd_service_files:
@@ -1158,9 +1149,7 @@ def shell():
11581149

11591150
''' set window title '''
11601151
try:
1161-
if pyradio_config.check_playlist:
1162-
win_title = ' (' + M_STRINGS['checking-playlist'] + ')'
1163-
elif pyradio_config.locked:
1152+
if pyradio_config.locked:
11641153
win_title = M_STRINGS['session-locked']
11651154
else:
11661155
win_title = None
@@ -1211,15 +1200,6 @@ def shell():
12111200
else:
12121201
break
12131202

1214-
if pyradio_config.check_playlist:
1215-
pyradio.program_restart = False
1216-
print('[blue bold]-->[/blue bold] [magenta]Check Playlist Mode[/magenta] activated!')
1217-
if path.exists(pyradio_config.check_output_folder):
1218-
print(f'[blue bold]-->[/blue bold] Output folder:\n "[red]{pyradio_config.check_output_folder}[/red]"')
1219-
pyradio.handle_check_playlist_data()
1220-
else:
1221-
print('[blue bold]-->[/blue bold] Operation [red bold]Cancelled![/red bold]')
1222-
12231203
''' curses is off '''
12241204
pyradio_config._online_browser = None
12251205
if pyradio.setup_return_status:
@@ -1250,24 +1230,23 @@ def shell():
12501230
upd.user = is_pyradio_user_installed()
12511231
upd.update_pyradio()
12521232
else:
1253-
if not pyradio_config.check_playlist:
1254-
st = en = ''
1255-
if platform.startswith('win') or \
1256-
platform.lower().startswith('dar'):
1233+
st = en = ''
1234+
if platform.startswith('win') or \
1235+
platform.lower().startswith('dar'):
1236+
st = '\n'
1237+
else:
1238+
if is_graphical_environment_running():
12571239
st = '\n'
12581240
else:
1259-
if is_graphical_environment_running():
1260-
st = '\n'
1261-
else:
1262-
import subprocess
1263-
subprocess.call('clear')
1264-
en = '\n'
1265-
print(st + 'Thank you for using [magenta]PyRadio[/magenta]. Cheers!' + en)
1241+
import subprocess
1242+
subprocess.call('clear')
1243+
en = '\n'
1244+
print(st + 'Thank you for using [magenta]PyRadio[/magenta]. Cheers!' + en)
12661245
else:
12671246
print('\nThis terminal can not display colors.\nPyRadio cannot function in such a terminal.\n')
12681247

1269-
def read_config(pyradio_config, check_playlist):
1270-
ret = pyradio_config.read_config(check_playlist=check_playlist)
1248+
def read_config(pyradio_config):
1249+
ret = pyradio_config.read_config()
12711250
if ret == -1:
12721251
print(f'Error opening config: "[red]{pyradio_config.config_file}[/red]"')
12731252
sys.exit(1)

0 commit comments

Comments
 (0)