Skip to content

Commit d818db2

Browse files
committed
do not ask to update stations on new install (i.e. stations.csv copied from package)
1 parent 8c29344 commit d818db2

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

pyradio/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@ def _copy_icon(self):
227227
pass
228228

229229
@property
230-
def user_has_stations_csv(self):
230+
def user_csv_found(self):
231231
return self._user_csv_found
232232

233-
@user_has_stations_csv.setter
234-
def user_has_stations_csv(self, val):
233+
@user_csv_found.setter
234+
def user_csv_found(self, val):
235235
raise ValueError('parameter is read only')
236236

237237
@property

pyradio/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,9 @@ def shell():
625625
if pyradio_config.locked:
626626
print_session_is_locked()
627627
sys.exit(1)
628+
elif not pyradio_config.user_csv_found:
629+
print_simple_error('Error: "stations.csv" already up to date!')
630+
sys.exit(1)
628631
else:
629632
do_update_stations(pyradio_config)
630633

pyradio/radio.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,6 +1626,9 @@ def run(self):
16261626
if self._cnf.locked:
16271627
if logger.isEnabledFor(logging.INFO):
16281628
logger.info('(detectUpdateStationsThread): not starting; session is locked!!!')
1629+
elif not self._cnf.user_csv_found:
1630+
if logger.isEnabledFor(logging.INFO):
1631+
logger.info('(detectUpdateStationsThread): not starting; copyed stations.csv!!!')
16291632
else:
16301633
if logger.isEnabledFor(logging.INFO):
16311634
logger.info('(detectUpdateStationsThread): checking in 10 seconds')

0 commit comments

Comments
 (0)