mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-16 21:36:40 +00:00
remove spawning
This commit is contained in:
parent
17f71c916e
commit
2e1e6901da
@ -31,6 +31,8 @@
|
||||
|
||||
import os.path
|
||||
import xdg.BaseDirectory
|
||||
import gobject
|
||||
gobject.threads_init()
|
||||
|
||||
PROGRAM_NAME = "Deluge"
|
||||
PROGRAM_VERSION = "0.5.4"
|
||||
@ -123,11 +125,11 @@ def open_url_in_browser(link):
|
||||
import webbrowser
|
||||
webbrowser.open(link)
|
||||
else:
|
||||
import os, sys
|
||||
py_version = sys.version[:3]
|
||||
file = os.path.join(INSTALL_PREFIX, 'lib', 'python' \
|
||||
+ py_version, 'site-packages', 'deluge', 'browser.py')
|
||||
os.spawnlp(os.P_NOWAIT, 'python', 'python', file, link)
|
||||
import webbrowser
|
||||
import gtk
|
||||
gtk.gdk.threads_enter()
|
||||
webbrowser.open(link)
|
||||
gtk.gdk.threads_leave()
|
||||
|
||||
def is_url(url):
|
||||
import re
|
||||
|
@ -48,6 +48,7 @@ import tab_details
|
||||
|
||||
class DelugeGTK:
|
||||
def __init__(self):
|
||||
gobject.threads_init()
|
||||
self.ipc_manager = ipc_manager.Manager(self)
|
||||
#Start the Deluge Manager:
|
||||
self.manager = core.Manager(common.CLIENT_CODE, common.CLIENT_VERSION,
|
||||
@ -115,26 +116,44 @@ class DelugeGTK:
|
||||
self.update_interface = True
|
||||
|
||||
def new_release_check():
|
||||
import sys
|
||||
py_version = sys.version[:3]
|
||||
file = os.path.join(common.INSTALL_PREFIX, 'lib', 'python' \
|
||||
+ py_version, 'site-packages', 'deluge', 'update.py')
|
||||
os.spawnlp(os.P_NOWAIT, 'python', 'python', file,
|
||||
common.PROGRAM_VERSION)
|
||||
import urllib
|
||||
new_release = urllib.urlopen("http://download.deluge-torrent.org/version").read().strip()
|
||||
if new_release > common.PROGRAM_VERSION:
|
||||
gtk.gdk.threads_enter()
|
||||
dialog = gtk.MessageDialog(parent = None,
|
||||
flags = gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||
buttons = gtk.BUTTONS_YES_NO,
|
||||
message_format=_("There is a newer version of Deluge. Would you like to be taken to our download site?"),
|
||||
type=gtk.MESSAGE_QUESTION)
|
||||
dialog.set_title('New Release!')
|
||||
result = dialog.run()
|
||||
dialog.destroy()
|
||||
if result == gtk.RESPONSE_YES:
|
||||
common.open_url_in_browser('http://download.deluge-torrent.org')
|
||||
elif result == gtk.RESPONSE_NO:
|
||||
pass
|
||||
gtk.gdk.threads_leave()
|
||||
|
||||
|
||||
def send_info():
|
||||
import time
|
||||
import time
|
||||
|
||||
def _run_script():
|
||||
import sys
|
||||
|
||||
py_version = sys.version[:3]
|
||||
|
||||
file = os.path.join(common.INSTALL_PREFIX, 'lib', 'python' \
|
||||
+ py_version, 'site-packages', 'deluge', 'info.py')
|
||||
os.spawnlp(os.P_NOWAIT, 'python', 'python', file,
|
||||
common.PROGRAM_VERSION)
|
||||
|
||||
import urllib
|
||||
import platform
|
||||
|
||||
pygtk = '%i.%i.%i' %(gtk.pygtk_version[0],gtk.pygtk_version[1],gtk.pygtk_version[2])
|
||||
gtk.gdk.threads_enter()
|
||||
|
||||
urllib.urlopen("http://download.deluge-torrent.org/stats.php?processor=" + \
|
||||
platform.machine() + "&python=" + platform.python_version() \
|
||||
+ "&os=" + platform.system() + "&pygtk=" + pygtk)
|
||||
|
||||
f = open(os.path.join(common.CONFIG_DIR, 'infosent'), 'w')
|
||||
f.write("")
|
||||
f.close
|
||||
gtk.gdk.threads_leave()
|
||||
|
||||
info_file = os.path.join(common.CONFIG_DIR, 'infosent')
|
||||
|
||||
# Check if we've done this within the last week
|
||||
|
Loading…
x
Reference in New Issue
Block a user