Skip to content

Commit

Permalink
v1.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
xxnet committed Mar 17, 2015
1 parent 827c878 commit 196bc22
Show file tree
Hide file tree
Showing 54 changed files with 1,478 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

下载链接:
==========
https://codeload.github.com/XX-net/XX-Net/zip/1.3.5
https://codeload.github.com/XX-net/XX-Net/zip/1.3.6

版本历史: https://github.com/XX-net/XX-Net/releases

Expand Down
2 changes: 1 addition & 1 deletion data/launcher/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
modules:
goagent: {auto_start: 1, current_version: 3.1.40, ignore_version: 3.1.38}
launcher: {current_version: 1.0.7, ignore_version: 1.0.5}
launcher: {current_version: 1.0.8, ignore_version: 1.0.5}
update: {check_update: 1, last_path: /, node_id: '0',
uuid: 0}
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
63 changes: 63 additions & 0 deletions launcher/1.0.8/mac_tray.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/env python
# coding:utf-8

if __name__ == "__main__":
import os
import sys

current_path = os.path.dirname(os.path.abspath(__file__))
python_path = os.path.abspath( os.path.join(current_path, os.pardir, os.pardir, 'python27', '1.0'))
noarch_lib = os.path.abspath( os.path.join(python_path, 'lib', 'noarch'))
sys.path.append(noarch_lib)
osx_lib = os.path.join(python_path, 'lib', 'osx')
sys.path.append(osx_lib)

import rumps
import webbrowser
import module_init

class Mac_tray(rumps.App):
def __init__(self):
super(Mac_tray, self).__init__("XX-Net", title="XX-Net", icon="Python.ico", quit_button=None)
self.menu = ["Config", "Reset", "Quit"]

@rumps.clicked("Config")
def on_config(self, _):
webbrowser.open_new("http://127.0.0.1:8085/")

@rumps.clicked("Reset")
def on_reset(self, _):
module_init.stop_all()
module_init.start_all_auto()

@rumps.clicked("Quit")
def on_quit(self, _):
module_init.stop_all()
rumps.quit_application()

def notify_general(self, msg="msg", title="Title", buttons={}, timeout=3600):
window = rumps.Window(title, msg)
window.title = title
window.message = msg
window.default_text = 'eh'
for button in buttons:
window.add_buttons(button)
res = window.run()
return res

def dialog_yes_no(self, msg="msg", title="Title", data=None, callback=None):
if rumps.alert(title, msg):
callback(data)


def serve_forever(self):
self.run()

sys_tray = Mac_tray()

def main():
sys_tray.serve_forever()

if __name__ == '__main__':
main()

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions launcher/1.0.7/start.py → launcher/1.0.8/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
current_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(current_path)
from win_tray import sys_tray
elif sys.platform == "darwin":
osx_lib = os.path.join(python_path, 'lib', 'osx')
sys.path.append(osx_lib)
from mac_tray import sys_tray
else:
from non_tray import sys_tray

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions launcher/1.0.7/update.py → launcher/1.0.8/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ def download_module(module, new_version):
install_module(module, new_version)
else:
ignore_module(module, new_version)
elif sys.platform == "darwin":
from mac_tray import sys_tray
if sys_tray.dialog_yes_no(msg, u"Install", None, None) == 1:
install_module(module, new_version)
else:
ignore_module(module, new_version)

else:
install_module(module, new_version)

Expand Down Expand Up @@ -250,6 +257,14 @@ def check_update():
download_module(module, new_version)
else:
ignore_module(module, new_version)
elif sys.platform == "darwin":
from mac_tray import sys_tray
msg = "Module %s new version: %s, Download?" % (module, new_version)
if sys_tray.dialog_yes_no(msg, u"Download", None, None) == 1:
download_module(module, new_version)
else:
ignore_module(module, new_version)

else:
download_module(module, new_version)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ def http_request(url, method="GET"):
return False

def confirm_xxnet_exit():
for i in range(10):
if http_request("http://127.0.0.1:8084/quit") == False:
break
time.sleep(1)
for i in range(10):
if http_request("http://127.0.0.1:8085/quit") == False:
return True
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions launcher/1.0.7/win_tray.py → launcher/1.0.8/win_tray.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def on_show(self, widget=None, data=None):


def on_restart_goagent(self, widget=None, data=None):
module_init.stop()
module_init.start()
module_init.stop_all()
module_init.start_all_auto()

def on_check_update(self, widget=None, data=None):
update.check_update()
Expand Down
26 changes: 26 additions & 0 deletions python27/1.0/lib/osx/rumps/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# rumps: Ridiculously Uncomplicated Mac os x Python Statusbar apps.
# Copyright: (c) 2015, Jared Suttles. All rights reserved.
# License: BSD, see LICENSE for details.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

"""
rumps
=====
Ridiculously Uncomplicated Mac os x Python Statusbar apps.
rumps exposes Objective-C classes as Python classes and functions which greatly simplifies the process of creating a
statusbar application.
"""

__title__ = 'rumps'
__version__ = '0.2.1a'
__author__ = 'Jared Suttles'
__license__ = 'Modified BSD'
__copyright__ = 'Copyright 2015 Jared Suttles'

from .rumps import (separator, debug_mode, alert, notification, application_support, timers, quit_application, timer,
clicked, notifications, MenuItem, Timer, Window, App)
Empty file.
Loading

0 comments on commit 196bc22

Please sign in to comment.