14
14
# protonvpn-cli Functions
15
15
from .logger import logger
16
16
from .utils import (
17
- check_init , pull_server_data , is_connected ,
17
+ check_init , get_server_features , pull_server_data , is_connected ,
18
18
get_servers , get_server_value , get_config_value ,
19
19
set_config_value , get_ip_info , get_country_name ,
20
20
get_fastest_server , check_update , get_default_nic ,
@@ -412,14 +412,12 @@ def status():
412
412
ip , isp = get_ip_info ()
413
413
414
414
# Collect Information
415
- all_features = {0 : "Normal" , 1 : "Secure-Core" , 2 : "Tor" , 4 : "P2P" }
416
-
417
415
logger .debug ("Collecting status information" )
418
416
country_code = get_server_value (connected_server , "ExitCountry" , servers )
419
417
country = get_country_name (country_code )
420
418
city = get_server_value (connected_server , "City" , servers )
421
419
load = get_server_value (connected_server , "Load" , servers )
422
- feature = get_server_value (connected_server , "Features" , servers )
420
+ features = get_server_features (connected_server , servers )
423
421
last_connection = get_config_value ("metadata" , "connected_time" )
424
422
connection_time = time .time () - int (last_connection )
425
423
@@ -441,7 +439,7 @@ def status():
441
439
+ "Time: {0}\n " .format (connection_time )
442
440
+ "IP: {0}\n " .format (ip )
443
441
+ "Server: {0}\n " .format (connected_server )
444
- + "Features: {0}\n " .format (all_features [ feature ] )
442
+ + "Features: {0}\n " .format (', ' . join ( features ) )
445
443
+ "Protocol: {0}\n " .format (connected_protocol .upper ())
446
444
+ "Kill Switch: {0}\n " .format (killswitch_status )
447
445
+ "Country: {0}\n " .format (country )
0 commit comments