Skip to content

Commit

Permalink
Move config.ini, user_script.sh into $HOME/.config/vpngate-with-proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
ductin committed Aug 20, 2017
1 parent aedbba3 commit 30adf46
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Empty file modified logs/.gitignore
100644 → 100755
Empty file.
14 changes: 8 additions & 6 deletions vpn_indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,17 @@ def build_menu(self):
next_vpn.connect('activate', self.send_cmd, 'next')
menu.append(next_vpn)

menu.append(Gtk.MenuItem())
menu.append(Gtk.SeparatorMenuItem())

# stop vpn
stop_vpn = Gtk.MenuItem('Stop VPN')
stop_vpn.connect('activate', self.send_cmd, 'stop')
menu.append(stop_vpn)

# reconnect the current one
stop_vpn = Gtk.MenuItem('ReConnect')
stop_vpn.connect('activate', self.send_cmd, 'reconnect')
menu.append(stop_vpn)
reco_vpn = Gtk.MenuItem('ReConnect')
reco_vpn.connect('activate', self.send_cmd, 'reconnect')
menu.append(reco_vpn)

menu.append(Gtk.SeparatorMenuItem())

Expand Down Expand Up @@ -357,8 +357,10 @@ def status(self, menu_obj, messages=''):
self.notifier.show()

def handler(self, signal_num, frame):
print rep_time(), 'Indicator: quit now'
self.quit('')
if signal_num==signal.SIGINT:
print rep_time(), 'Indicator: got SigInt'
else:
self.quit('')

def send_cmd(self, menu_obj, arg):
print rep_time(), 'Indicator sent:', arg
Expand Down
5 changes: 5 additions & 0 deletions vpnproxy_tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ def get_csv(self, url, queue, proxy={}):
self.messages['debug'].appendleft(vpn_data)
queue.put((0, {}))

except requests.exceptions.ConnectionError as e:
self.messages['debug'].appendleft('ConnectionError')
self.messages['debug'].appendleft(' Connection to gate ' + url + ' failed')
queue.put((0, {}))

except requests.exceptions.RequestException as e:
self.messages['debug'].appendleft(str(e))
self.messages['debug'].appendleft(' Connection to gate ' + url + ' failed')
Expand Down

0 comments on commit 30adf46

Please sign in to comment.