@@ -22,6 +22,21 @@ class PyRadioStationsBrowser(object):
22
22
Actual implementations should be subclasses of this one.
23
23
"""
24
24
25
+ BASE_URL = ''
26
+ _raw_stations = []
27
+ _last_search = None
28
+ _have_to_retrieve_url = False
29
+ _internal_header_height = 0
30
+ _url_timeout = 3
31
+ _search_timeout = 3
32
+
33
+ # Normally outer boddy (holding box, header, internal header) is
34
+ # 2 chars wider that the internal body (holding the stations)
35
+ # This property value is half the difference (normally 2 / 2 = 1)
36
+ # Used to chgat the columns' separators in internal body
37
+ # Check if the cursor is divided as required and adjust
38
+ _outer_internal_body_diff = 1
39
+
25
40
def __init__ (self , search = None ):
26
41
"""Initialize the station's browser.
27
42
@@ -35,19 +50,7 @@ def __init__(self, search=None):
35
50
Search parameters to be used instead of the default.
36
51
"""
37
52
38
- self ._raw_stations = []
39
- self ._last_search = None
40
- self ._have_to_retrieve_url = False
41
- self ._internal_header_height = 0
42
- self ._url_timeout = 3
43
- self ._search_timeout = 3
44
-
45
- # Normally outer boddy (holding box, header, internal header) is
46
- # 2 chars wider that the internal body (holding the stations)
47
- # This property value is half the difference (normally 2 / 2 = 1)
48
- # Used to chgat the columns' separators in internal body
49
- # Check if the cursor is divided as required and adjust
50
- self ._outer_internal_body_diff = 1
53
+ pass
51
54
52
55
@property
53
56
def outer_internal_body_diff (self ):
@@ -134,31 +137,28 @@ def format_station_line(self, id_in_list, pad, width):
134
137
135
138
136
139
class PyRadioBrowserInfoBrowser (PyRadioStationsBrowser ):
140
+
137
141
BASE_URL = 'www.radio-browser.info'
142
+
138
143
_open_url = \
139
- 'http://www.radio-browser.info/webservice/json/stations/topvote/100'
144
+ 'http://www.radio-browser.info/webservice/json/stations/topvote/100'
140
145
_open_headers = {'user-agent' : 'PyRadio/dev' }
141
146
142
147
_raw_stations = []
143
148
144
149
# the output format to use based on window width
145
150
# Default value: -1
146
- # Possible values: 0..4
151
+ # Possible values: 0..5
147
152
# Look at format_station_line() for info
148
153
_output_format = - 1
149
154
_info_len = []
150
155
_info_name_len = 0
151
156
157
+ _raw_stations = []
152
158
_have_to_retrieve_url = True
153
159
_internal_header_height = 1
154
160
155
-
156
161
def __init__ (self , search = None ):
157
- if PY3 :
158
- super ().__init__ ()
159
- else :
160
- super (PyRadioBrowserInfoBrowser , self ).__init__ ()
161
- self ._raw_stations = []
162
162
if search :
163
163
self .search (search )
164
164
else :
0 commit comments