mirror of
https://github.com/borgbase/vorta
synced 2024-12-22 15:57:34 +00:00
parent
642ce58225
commit
4cdc76680c
2 changed files with 10 additions and 2 deletions
|
@ -26,6 +26,7 @@
|
|||
help='Specify output file name')
|
||||
opts = parser.parse_args()
|
||||
|
||||
|
||||
def get_pypi_url(name: str, filename: str) -> str:
|
||||
url = 'https://pypi.python.org/pypi/{}/json'.format(name)
|
||||
print('Extracting download url for', name)
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
from functools import reduce
|
||||
import operator
|
||||
import psutil
|
||||
import xml
|
||||
|
||||
from paramiko.rsakey import RSAKey
|
||||
from paramiko.ecdsakey import ECDSAKey
|
||||
|
@ -120,8 +121,14 @@ def get_sorted_wifis(profile):
|
|||
|
||||
if sys.platform == 'darwin':
|
||||
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:
|
||||
for wifi in wifis.values():
|
||||
timestamp = wifi.get('LastConnected', None)
|
||||
|
|
Loading…
Reference in a new issue