@@ -281,6 +281,7 @@ def __init__(self, pyradio_config,
281
281
req_player = '' ,
282
282
theme = '' ,
283
283
force_update = '' ):
284
+ self ._no_netifaces = False
284
285
self ._current_selection = 0
285
286
self ._force_print_all_lines = False
286
287
self ._system_asked_to_terminate = False
@@ -378,6 +379,7 @@ def __init__(self, pyradio_config,
378
379
self .ws .EDIT_STATION_URL_ERROR : self ._print_editor_url_error ,
379
380
self .ws .PY2_EDITOR_ERROR : self ._print_py2_editor_error ,
380
381
self .ws .REQUESTS_MODULE_NOT_INSTALLED_ERROR : self ._print_requests_not_installed_error ,
382
+ self .ws .NETIFACES_MODULE_NOT_INSTALLED_ERROR : self ._print_netifaces_not_installed_error ,
381
383
self .ws .DNSPYTHON_MODULE_NOT_INSTALLED_ERROR : self ._print_dnspython_not_installed_error ,
382
384
self .ws .CLEAR_REGISTER_MODE : self ._print_clear_register ,
383
385
self .ws .CLEAR_ALL_REGISTERS_MODE : self ._print_clear_all_registers ,
@@ -992,6 +994,9 @@ def refreshBody(self, start=0):
992
994
self ._show_theme_not_supported ()
993
995
elif self ._cnf .user_param_id == - 1 :
994
996
self ._print_user_parameter_error ()
997
+ elif self ._no_netifaces :
998
+ self ._no_netifaces = False
999
+ self ._print_netifaces_not_installed_error ()
995
1000
# elif not self._cnf.use_themes:
996
1001
# self._show_no_themes()
997
1002
@@ -1026,6 +1031,8 @@ def refreshNoDepencency(self):
1026
1031
self .bodyWin .addstr ('dnspython' , curses .color_pair (4 ))
1027
1032
self .bodyWin .addstr (14 ,1 , ' 3. ' , curses .color_pair (5 ))
1028
1033
self .bodyWin .addstr ('psutil ' , curses .color_pair (4 ))
1034
+ self .bodyWin .addstr (15 ,1 , ' 3. ' , curses .color_pair (5 ))
1035
+ self .bodyWin .addstr ('netifaces' , curses .color_pair (4 ))
1029
1036
self .outerBodyWin .refresh ()
1030
1037
self .bodyWin .refresh ()
1031
1038
@@ -3213,6 +3220,23 @@ def _print_dnspython_not_installed_error(self):
3213
3220
prompt = ' Press any key ' ,
3214
3221
is_message = True )
3215
3222
3223
+ def _print_netifaces_not_installed_error (self ):
3224
+ txt = '''
3225
+ Module "|netifaces|" not found!
3226
+
3227
+ In order to use the |Remote Control Server|, the
3228
+ "|netifaces|" module must be installed.
3229
+
3230
+ Exit |PyRadio| now, install the module (named
3231
+ |python-netifaces| or |python{}-netifaces|) and try
3232
+ executing |PyRadio| again.
3233
+ '''
3234
+ self ._show_help (txt .format (python_version [0 ]),
3235
+ self .ws .NETIFACES_MODULE_NOT_INSTALLED_ERROR ,
3236
+ caption = ' Module Error ' ,
3237
+ prompt = ' Press any key ' ,
3238
+ is_message = True )
3239
+
3216
3240
def _print_requests_not_installed_error (self ):
3217
3241
txt = '''
3218
3242
Module "|requests|" not found!
@@ -9256,6 +9280,10 @@ def _start_remote_control_server(self):
9256
9280
'/html_init' : self ._html_init_song_title ,
9257
9281
}
9258
9282
)
9283
+ if not self ._remote_control_server .has_netifaces :
9284
+ self ._remote_control_server = None
9285
+ self ._no_netifaces = True
9286
+ return
9259
9287
self ._remote_control_server_thread = threading .Thread (
9260
9288
target = self ._remote_control_server .start_remote_control_server ,
9261
9289
args = (
0 commit comments