Skip to content
This repository has been archived by the owner on Apr 23, 2023. It is now read-only.

Commit

Permalink
Updated for minor changes to string formatting for Mullvad version 20…
Browse files Browse the repository at this point in the history
…22.2
  • Loading branch information
atticusmatticus committed Jun 15, 2022
1 parent 2ef3f4c commit 3582e66
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Binary file modified MullvadVPN.alfredworkflow
Binary file not shown.
15 changes: 8 additions & 7 deletions src/mullvad.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ def connection_status():
Item -- Connected/Disconnected/Blocked
"""
for status in get_connection():
# print 'status:', status
stat = str(status.split()[2])
# print 'stat:', stat
# print('DEBUG:', 'status:', status)
stat = str(status.split()[0])
# print('DEBUG:', 'stat:', stat)
if stat == 'Connected':
countryString, cityString = get_country_city()
# print '{} to: {} {}'.format(stat, cityString, countryString).decode('utf8')
# print ' '.join(status.split()[4:])+'. Select to Disconnect.'
# print('DEBUG:', '{} to: {} {}'.format(stat, cityString, countryString))#.decode('utf8'))
# print('DEBUG:', ' '.join(status.split()[4:])+'. Select to Disconnect.')
wf.add_item('{} to: {} {}'.format(stat, cityString, countryString), #.decode('utf8'),
subtitle=' '.join(status.split()[4:])+'. Select to Disconnect. Type "relay" to change.',
arg='/usr/local/bin/mullvad disconnect',
Expand Down Expand Up @@ -274,8 +274,9 @@ def update_mullvad():

def get_account():
getAcct = execute(['mullvad', 'account', 'get']).splitlines()
# print('DEBUG:', type(getAcct[1].split()[3]), type('%Y-%m-%d'))
deltaDays = (datetime.strptime(getAcct[1].split()[3], '%Y-%m-%d') - datetime.utcnow()).days
# print('DEBUG:', getAcct[2].split()[3])
# print('DEBUG:', type(getAcct[2].split()[3]), type('%Y-%m-%d'))
deltaDays = (datetime.strptime(getAcct[2].split()[3], '%Y-%m-%d') - datetime.utcnow()).days
return [getAcct[0].split()[2], deltaDays]


Expand Down
2 changes: 1 addition & 1 deletion src/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.6
0.10.7

0 comments on commit 3582e66

Please sign in to comment.