mirror of https://github.com/borgbase/vorta
parent
642ce58225
commit
4cdc76680c
|
@ -26,6 +26,7 @@ parser.add_argument('--output',
|
||||||
help='Specify output file name')
|
help='Specify output file name')
|
||||||
opts = parser.parse_args()
|
opts = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
def get_pypi_url(name: str, filename: str) -> str:
|
def get_pypi_url(name: str, filename: str) -> str:
|
||||||
url = 'https://pypi.python.org/pypi/{}/json'.format(name)
|
url = 'https://pypi.python.org/pypi/{}/json'.format(name)
|
||||||
print('Extracting download url for', name)
|
print('Extracting download url for', name)
|
||||||
|
|
|
@ -13,6 +13,7 @@ from collections import defaultdict
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
import operator
|
import operator
|
||||||
import psutil
|
import psutil
|
||||||
|
import xml
|
||||||
|
|
||||||
from paramiko.rsakey import RSAKey
|
from paramiko.rsakey import RSAKey
|
||||||
from paramiko.ecdsakey import ECDSAKey
|
from paramiko.ecdsakey import ECDSAKey
|
||||||
|
@ -120,8 +121,14 @@ def get_sorted_wifis(profile):
|
||||||
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
plist_path = '/Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist'
|
plist_path = '/Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist'
|
||||||
plist_file = open(plist_path, 'rb')
|
|
||||||
wifis = plistlib.load(plist_file).get('KnownNetworks')
|
try:
|
||||||
|
plist_file = open(plist_path, 'rb')
|
||||||
|
wifis = plistlib.load(plist_file).get('KnownNetworks')
|
||||||
|
except xml.parsers.expat.ExpatError:
|
||||||
|
logger.error('Unable to parse list of Wifi networks.')
|
||||||
|
return
|
||||||
|
|
||||||
if wifis is not None:
|
if wifis is not None:
|
||||||
for wifi in wifis.values():
|
for wifi in wifis.values():
|
||||||
timestamp = wifi.get('LastConnected', None)
|
timestamp = wifi.get('LastConnected', None)
|
||||||
|
|
Loading…
Reference in New Issue