Skip to content

Commit a14c069

Browse files
committed
- disabling theme editing (#141)
- trying to change install.py description per command line
1 parent 3b07762 commit a14c069

File tree

4 files changed

+39
-18
lines changed

4 files changed

+39
-18
lines changed

pyradio/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,10 +1435,10 @@ def get_pyradio_version(self):
14351435
# if revision is not 0
14361436
git_description = ''
14371437
if git_description:
1438-
if git_description.endswith('-dev'):
1438+
if git_description.endswith('-git'):
14391439
if 'rdev' in git_description:
14401440
''' failed to get it on linux '''
1441-
git_description = 'PyRadio-dev'
1441+
git_description = 'PyRadio-git'
14421442
self.info = ' ' + git_description
14431443
ret = self.info + " (development version)"
14441444
else:

pyradio/install.py

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
VERSION = ''
3232

3333
PY3 = sys.version[0] == '3'
34+
# import logging
35+
# logger = logging.getLogger(__name__)
3436

3537
def print_pyradio_on():
3638
print('''
@@ -93,7 +95,18 @@ def isRunning():
9395
print('')
9496

9597
def version_string_to_list(this_version):
96-
a_v = this_version.replace('-', '.').lower()
98+
# logger.error('DE this_version = "{}"'.format(this_version))
99+
poped = False
100+
tokens = ('sng', 'dev', 'git')
101+
sp = this_version.split('-')
102+
while sp[-1] in tokens:
103+
p = sp.pop()
104+
if p != 'git':
105+
poped = True
106+
if poped:
107+
sp.pop()
108+
a_v = '.'.join(sp).lower()
109+
# a_v = this_version.replace('-', '.').lower()
97110
a_l = a_v.split('.')
98111
while len(a_l) < 4:
99112
a_l.append('0')
@@ -186,7 +199,10 @@ def get_github_long_description(
186199
# print(n, '\n\n')
187200

188201
if ret is None:
189-
return 'Pyradio-dev', 'Pyradio-dev'
202+
if only_tag_name:
203+
return 'PyRadio-git'
204+
else:
205+
return 'PyRadio-git', 'PyRadio-git'
190206

191207
if only_tag_name:
192208
return returns[0][0]['name']
@@ -210,9 +226,9 @@ def get_github_long_description(
210226
# print('this_version = ' + this_version)
211227
return tag_name, this_version
212228

213-
def get_github_tag():
229+
def get_github_tag(do_not_exit=False):
214230
''' get the name of the latest PyRadio tag on GitHub '''
215-
return get_github_long_description(only_tag_name=True)
231+
return get_github_long_description(only_tag_name=True, do_not_exit=do_not_exit)
216232

217233
def get_next_release():
218234
r = get_github_long_description()
@@ -225,10 +241,10 @@ def get_next_release():
225241

226242
def get_devel_version():
227243
long_descpr = get_github_long_description(do_not_exit=True)
228-
if long_descpr == ('PyRadio-dev', 'PyRadio-dev'):
229-
return 'PyRadio-dev'
244+
if long_descpr == ('PyRadio-git', 'PyRadio-git'):
245+
return 'PyRadio-git'
230246
else:
231-
return 'PyRadio ' + long_descpr[1].replace('-', '-r', 1) + '-dev'
247+
return 'PyRadio ' + long_descpr[1].replace('-', '-r', 1) + '-git'
232248

233249
def windows_put_devel_version():
234250
long_descr = get_devel_version()
@@ -773,11 +789,13 @@ def _do_it(self, mode='update'):
773789
args.force = True
774790
package = 1
775791
VERSION, github_long_description = get_github_long_description(use_sng_repo=True, sng_branch=True)
792+
github_long_description += '-sng'
776793
elif args.sng_devel:
777794
'''' sng devel '''
778795
args.force = True
779796
package = 2
780797
VERSION, github_long_description = get_github_long_description(use_sng_repo=True)
798+
github_long_description += '-sng-dev'
781799
elif args.devel:
782800
''' official devel '''
783801
package = 3

pyradio/radio.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -981,8 +981,7 @@ def run(self):
981981
pass
982982
else:
983983
''' start update detection and notification thread '''
984-
if CAN_CHECK_FOR_UPDATES and \
985-
not self._cnf.current_pyradio_version.endswith('-dev'):
984+
if CAN_CHECK_FOR_UPDATES:
986985
if self._cnf.locked:
987986
if logger.isEnabledFor(logging.INFO):
988987
logger.info('(detectUpdateThread): session locked. Not starting!!!')
@@ -3792,14 +3791,16 @@ def to_time(secs):
37923791
if logger.isEnabledFor(logging.DEBUG):
37933792
logger.debug('detectUpdateThread: Asked to stop. Stoping...')
37943793
break
3795-
last_tag = get_github_tag()
3794+
last_tag = get_github_tag(do_not_exit=True)
37963795
if stop():
37973796
if logger.isEnabledFor(logging.DEBUG):
37983797
logger.debug('detectUpdateThread: Asked to stop. Stoping...')
37993798
break
38003799

3800+
logger.error('DE last_tag = "{}"'.format(last_tag))
38013801
if self._force_update:
38023802
last_tag = self._force_update
3803+
logger.error('DE last_tag = "{}"'.format(last_tag))
38033804

38043805
if last_tag:
38053806
connection_fail_count = 0
@@ -3812,6 +3813,7 @@ def to_time(secs):
38123813
logger.info('detectUpdateThread: No update found. Will check again in {} days. Terminating...'.format(check_days))
38133814
break
38143815
else:
3816+
logger.error('DE 1 this_version = {}'.format(this_version))
38153817
existing_version = version_string_to_list(this_version)
38163818
new_version = version_string_to_list(last_tag)
38173819
if logger.isEnabledFor(logging.DEBUG):

pyradio/themes.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -832,12 +832,13 @@ def keypress(self, char):
832832
return -1, False
833833
if char in (ord('e'), ):
834834
''' edit theme '''
835-
if self._themes[self._selection][1] == '' or \
836-
self._is_theme_read_only(self._themes[self._selection][1]):
837-
''' display question to create theme instead '''
838-
return -2, False
839-
else:
840-
pass
835+
pass
836+
# if self._themes[self._selection][1] == '' or \
837+
# self._is_theme_read_only(self._themes[self._selection][1]):
838+
# ''' display question to create theme instead '''
839+
# return -2, False
840+
# else:
841+
# pass
841842
elif char in (ord('a'), ):
842843
''' new theme '''
843844
pass

0 commit comments

Comments
 (0)