Skip to content

Commit 0b84d9f

Browse files
committed
fixing (#147)
1 parent bfdcad2 commit 0b84d9f

File tree

7 files changed

+78
-40
lines changed

7 files changed

+78
-40
lines changed

Changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2022-01-25 s-n-g
2+
* version 0.8.9.11 (0.9-beta8)
3+
* Fixing (#147): Cannot type "t" in RadioBrowser Search window
4+
* Trying to fix install.py crash
5+
* Adding MPV support on Windows
6+
17
2022-01-17 s-n-g
28
* version 0.8.9.10 (0.9-beta7)
39
* RadioBrowser config window almost finished

README.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,12 @@ <h2 id="features">Features <span style="padding-left: 10px;"><sup style="font-si
121121
<li>Station editor (add/edit) with <a href="#cjk-characters-support">CJK characters support</a></li>
122122
<li>Configuration editor</li>
123123
<li>Multiple playlist support</li>
124-
<li>vi like station ragisters</li>
124+
<li>vi like station registers</li>
125125
<li>Search function</li>
126126
<li>Theming support</li>
127127
<li><a href="radio-browser.html">RadioBrowser</a> support</li>
128128
<li>Easy installation / updating</li>
129-
<li>Runs on Linux. MacOS and Windows</li>
129+
<li>Runs on Linux, MacOS and Windows</li>
130130
</ul>
131131
<p>and much more…</p>
132132
<h2 id="requirements">Requirements <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
@@ -143,6 +143,12 @@ <h2 id="requirements">Requirements <span style="padding-left: 10px;"><sup style=
143143
<h2 id="changelog">Changelog <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
144144
<pre style="height: 200px;">
145145

146+
2022-01-25 s-n-g
147+
* version 0.8.9.11 (0.9-beta8)
148+
* Fixing (#147): Cannot type "t" in RadioBrowser Search window
149+
* Trying to fix install.py crash
150+
* Adding MPV support on Windows
151+
146152
2022-01-17 s-n-g
147153
* version 0.8.9.10 (0.9-beta7)
148154
* RadioBrowser config window almost finished

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ Ben Dowling - [https://github.com/coderholic](https://github.com/coderholic)
6969
- Station editor (add/edit) with [CJK characters support](#cjk-characters-support)
7070
- Configuration editor
7171
- Multiple playlist support
72-
- vi like station ragisters
72+
- vi like station registers
7373
- Search function
7474
- Theming support
7575
- [RadioBrowser](radio-browser.md) support
7676
- Easy installation / updating
77-
- Runs on Linux. MacOS and Windows
77+
- Runs on Linux, MacOS and Windows
7878

7979
and much more...
8080

pyradio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" pyradio -- Console radio player. "
22

3-
version_info = (0, 8, 9, 10)
3+
version_info = (0, 8, 9, 11)
44

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

pyradio/config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,16 +1444,16 @@ def get_pyradio_version(self):
14441444
ret = self.info + " (development version)"
14451445
else:
14461446
git_info = git_description.split('-')
1447-
if git_info[1] != '0':
1448-
try:
1447+
try:
1448+
if git_info[1] != '0':
14491449
if 'beta' in git_info[1] or 'rc' in git_info[1].lower():
14501450
self.info = " PyRadio {1}-{1}".format(git_info[0], git_info[1])
14511451
ret = "RyRadio built from git: https://github.com/coderholic/pyradio/commit/{0} (rev. {1})".format(git_info[-1], git_info[2])
14521452
else:
14531453
self.info = " PyRadio {0}-r{1} ".format(version, git_info[1])
14541454
ret = "RyRadio built from git: https://github.com/coderholic/pyradio/commit/{0} (rev. {1})".format(git_info[-1], git_info[1])
1455-
except:
1456-
pass
1455+
except:
1456+
pass
14571457
self.current_pyradio_version = self.info.replace(' PyRadio ', '').replace(' ', '')
14581458
# if self._distro != 'None':
14591459
# self.info += '({})'.format(self._distro)

pyradio/install.py

Lines changed: 49 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -178,22 +178,27 @@ def get_github_long_description(
178178
returns = []
179179
for n in points:
180180
ret = None
181-
url = 'https://api.github.com/repos/' + user + '/pyradio/' + n
182-
if sys.version_info < (3, 0):
183-
try:
184-
ret = urlopen(url).read()
185-
except:
186-
ret = None
181+
if n == 'tags':
182+
url = 'https://api.github.com/repos/coderholic/pyradio/tags'
187183
else:
188-
try:
184+
url = 'https://api.github.com/repos/' + user + '/pyradio/' + n
185+
if use_sng_repo and not sng_branch:
186+
url += '?sha=devel'
187+
else:
188+
url += '?sha=master'
189+
url += '&per_page=50'
190+
try:
191+
if sys.version_info < (3, 0):
192+
ret = urlopen(url).read()
193+
else:
189194
with urlopen(url) as https_response:
190195
ret = https_response.read()
191-
except:
192-
if do_not_exit:
193-
ret = None
194-
else:
195-
print('Error: Cannot contact GitHub!\n Please make sure your internet connection is up and try again.')
196-
sys.exit(1)
196+
except:
197+
if do_not_exit:
198+
ret = None
199+
else:
200+
print('Error: Cannot contact GitHub!\n Please make sure your internet connection is up and try again.')
201+
sys.exit(1)
197202

198203
try:
199204
returns.append(json.loads(ret))
@@ -210,9 +215,9 @@ def get_github_long_description(
210215

211216
if ret is None:
212217
if only_tag_name:
213-
return 'PyRadio-git'
218+
return None
214219
else:
215-
return 'PyRadio-git', 'PyRadio-git'
220+
return None, None
216221

217222
if only_tag_name:
218223
return returns[0][0]['name']
@@ -231,35 +236,45 @@ def get_github_long_description(
231236
# print(tag_hash)
232237
# print(revision)
233238

234-
this_version = tag_name + '-' + str(revision) + '-' + returns[0][0]['sha'][:7] if revision > 0 else None
239+
if revision > 0:
240+
this_version = tag_name + '-r' + str(revision) + '-' + returns[0][0]['sha'][:7]
241+
if use_sng_repo:
242+
this_version += '-sng'
243+
if not sng_branch:
244+
this_version += '-dev'
245+
else:
246+
this_version = None
235247

236-
# print('this_version = ' + this_version)
248+
# if this_version:
249+
# print('this_version = ' + this_version)
237250
return tag_name, this_version
238251

239252
def get_github_tag(do_not_exit=False):
240253
''' get the name of the latest PyRadio tag on GitHub '''
241254
return get_github_long_description(only_tag_name=True, do_not_exit=do_not_exit)
242255

243256
def get_next_release():
257+
''' not used '''
244258
r = get_github_long_description()
245-
print('Descriptyion: {}'.format(r))
259+
print('Description: {}'.format(r))
246260

247261
sp = r[1].split('-')
248262
print('sp = {}'.format(sp))
249263
x = int(sp[1]) + 1
250-
return sp[0] + '-r{}'.format(x)
264+
return sp[0] + '-{}'.format(x)
251265

252266
def get_devel_version():
253267
long_descpr = get_github_long_description(do_not_exit=True)
254-
if long_descpr == ('PyRadio-git', 'PyRadio-git'):
255-
return 'PyRadio-git'
256-
else:
268+
if long_descpr[0]:
257269
if long_descpr[1]:
258-
return 'PyRadio ' + long_descpr[1].replace('-', '-r', 1) + '-git'
270+
return 'PyRadio ' + long_descpr[1]
259271
else:
260-
return 'PyRadio ' + long_descpr[0] + '-0'
272+
return 'PyRadio ' + long_descpr[0]
273+
else:
274+
return None
261275

262276
def windows_put_devel_version():
277+
''' not used '''
263278
long_descr = get_devel_version()
264279
from shutil import copyfile
265280
cur_dir = os.getcwd()
@@ -795,10 +810,10 @@ def _do_it(self, mode='update'):
795810

796811

797812
if __name__ == '__main__':
798-
# l=get_github_long_description()
799-
# print(l)
800-
# get_devel_version()
801-
# sys.exit()
813+
l=get_github_long_description(use_sng_repo=True)
814+
print(l)
815+
print(get_devel_version())
816+
sys.exit()
802817
print_pyradio_on()
803818
print_python3() if PY3 else print_python2()
804819
# print(get_devel_version())
@@ -860,15 +875,19 @@ def _do_it(self, mode='update'):
860875
args.force = True
861876
package = 1
862877
VERSION, github_long_description = get_github_long_description(use_sng_repo=True, sng_branch=True)
863-
github_long_description += '-sng'
878+
if not github_long_description:
879+
github_long_description = 'PyRadio'
864880
github_long_description = github_long_description.replace('-', '-r', 1)
881+
# github_long_description += '-sng'
865882
elif args.sng_devel:
866883
'''' sng devel '''
867884
args.force = True
868885
package = 2
869886
VERSION, github_long_description = get_github_long_description(use_sng_repo=True)
870-
github_long_description += '-sng-dev'
887+
if not github_long_description:
888+
github_long_description = 'PyRadio'
871889
github_long_description = github_long_description.replace('-', '-r', 1)
890+
# github_long_description += '-sng-dev'
872891
elif args.devel:
873892
''' official devel '''
874893
package = 3

pyradio/radio.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4714,6 +4714,12 @@ def _return_from_server_selection(self, a_server):
47144714
self.ws.close_window()
47154715
self.refreshBody()
47164716

4717+
def _can_show_theme_window_in_browser_search(self):
4718+
if self.ws.operation_mode == self.ws.BROWSER_SEARCH_MODE:
4719+
return not self._cnf._online_browser.line_editor_has_focus()
4720+
else:
4721+
return True
4722+
47174723
def keypress(self, char):
47184724
if self._system_asked_to_terminate:
47194725
''' Make sure we exit when signal received '''
@@ -5061,7 +5067,8 @@ def keypress(self, char):
50615067
self.ws.RENAME_PLAYLIST_MODE, self.ws.CREATE_PLAYLIST_MODE,) and \
50625068
self.ws.operation_mode not in self.ws.PASSIVE_WINDOWS and \
50635069
not self.is_search_mode(self.ws.operation_mode) and \
5064-
self.ws.window_mode not in (self.ws.CONFIG_MODE, ):
5070+
self.ws.window_mode not in (self.ws.CONFIG_MODE, ) and \
5071+
self._can_show_theme_window_in_browser_search():
50655072
self._reset_status_bar_right()
50665073
self._config_win = None
50675074
self.theme_forced_selection = None

0 commit comments

Comments
 (0)