Skip to content

Commit

Permalink
add support for Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
debian committed Feb 16, 2015
1 parent 5fdca92 commit efc125e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 6 deletions.
3 changes: 0 additions & 3 deletions launcher/1.0.1/gtk_tray.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ def __init__(self):
self.trayicon.set_tooltip('XX-Net')
self.trayicon.set_visible(True)

def set_goagent_manager(self, mgr):
self.mgr = mgr

def make_menu(self):
menu = gtk.Menu()
itemlist = [(u'Config', self.on_show),
Expand Down
24 changes: 24 additions & 0 deletions launcher/1.0.1/non_tray.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python
# coding:utf-8

import time

class None_tray():
def notify_general(self, msg="msg", title="Title", buttons={}, timeout=3600):
pass

def on_quit(self, widget, data=None):
pass

def serve_forever(self):
while True:
time.sleep(100)

sys_tray = None_tray()

def main():
sys_tray.serve_forever()

if __name__ == '__main__':
main()

3 changes: 2 additions & 1 deletion launcher/1.0.1/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
current_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(current_path)
from win_tray import sys_tray

else:
from non_tray import sys_tray

import web_control
import module_init
Expand Down
5 changes: 4 additions & 1 deletion launcher/1.0.1/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ def download_module(module, new_version):
install_module(module, new_version)
else:
ignore_module(module, new_version)
else:
install_module(module, new_version)

break

Expand Down Expand Up @@ -239,7 +241,8 @@ def check_update():
download_module(module, new_version)
else:
ignore_module(module, new_version)

else:
download_module(module, new_version)

except Exception as e:
logging.warn("check_update except:%s", e)
Expand Down
7 changes: 6 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
#!/bin/bash
python2 launcher/start.py

if hash python2 2>/dev/null; then
python2 launcher/start.py
else
python launcher/start.py
fi

0 comments on commit efc125e

Please sign in to comment.