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

Commit

Permalink
added fix to country listing with Mullvad app update to 2020.6
Browse files Browse the repository at this point in the history
  • Loading branch information
atticusmatticus committed Oct 22, 2020
1 parent 29c6df4 commit a5f5279
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
20 changes: 14 additions & 6 deletions src/mullvad.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def connection_status():
# print '{} to: {} {}'.format(stat, cityString, countryString).decode('utf8')
# print ' '.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.',
subtitle=' '.join(status.split()[4:])+'. Select to Disconnect. Type "Relay" to change.',
arg='/usr/local/bin/mullvad disconnect',
valid=True,
icon='icons/mullvad_green.png')
Expand All @@ -75,14 +75,14 @@ def connection_status():


def get_country_city():
countryCodeSearch = '({})'.format(get_protocol()[-1])
# print countryCodeSearch
cityCodeSearch = '({})'.format(get_protocol()[-2][0:3])
# print cityCodeSearch
countryCodeSearch = '({})'.format(get_protocol()[9])
# print 'countryCodeSearch', countryCodeSearch
cityCodeSearch = '({})'.format(get_protocol()[8][0:3])
# print 'cityCodeSearch', cityCodeSearch
countries = wf.cached_data('mullvad_country_list',
get_country_list,
max_age=432000)
# print countries
# print 'countries', countries
index = [i for i,s in enumerate(countries) if countryCodeSearch in s][0]
relayList = wf.cached_data('mullvad_relay_list',
get_relay_list,
Expand Down Expand Up @@ -318,6 +318,14 @@ def main(wf):
set_kill_switch()
protocol_status()
set_lan()
for action in mullvad_actions.ACTIONS:
if action['name'] in ['relay', 'Check']:
wf.add_item(action['name'], action['description'],
uid=action['name'],
autocomplete=action['autocomplete'],
arg=action['arg'],
valid=action['valid'],
icon=action['icon'])

if query and query.startswith('Check'):
wf.add_item('Check',
Expand Down
2 changes: 1 addition & 1 deletion src/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7
0.8

0 comments on commit a5f5279

Please sign in to comment.