mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-07 00:48:41 +00:00
only resend info if it's been over a week
This commit is contained in:
parent
666a043275
commit
9cb20a96ce
2 changed files with 18 additions and 3 deletions
|
@ -4,8 +4,14 @@
|
||||||
import urllib
|
import urllib
|
||||||
import platform
|
import platform
|
||||||
import gtk
|
import gtk
|
||||||
|
import common
|
||||||
|
|
||||||
pygtk = '%i.%i.%i' %(gtk.pygtk_version[0],gtk.pygtk_version[1],gtk.pygtk_version[2])
|
pygtk = '%i.%i.%i' %(gtk.pygtk_version[0],gtk.pygtk_version[1],gtk.pygtk_version[2])
|
||||||
|
|
||||||
urllib.urlopen("http://download.deluge-torrent.org/stats.php?processor=" + \
|
urllib.urlopen("http://download.deluge-torrent.org/stats.php?processor=" + \
|
||||||
platform.machine() + "&python=" + platform.python_version() \
|
platform.machine() + "&python=" + platform.python_version() \
|
||||||
+ "&os=" + platform.system() + "&pygtk=" + pygtk)
|
+ "&os=" + platform.system() + "&pygtk=" + pygtk)
|
||||||
|
|
||||||
|
f = open(common.CONFIG_DIR + '/infosent', 'w')
|
||||||
|
f.write("")
|
||||||
|
f.close
|
||||||
|
|
|
@ -123,9 +123,18 @@ class DelugeGTK:
|
||||||
def send_info():
|
def send_info():
|
||||||
import sys
|
import sys
|
||||||
py_version = sys.version[:3]
|
py_version = sys.version[:3]
|
||||||
#check if we already sent the info
|
#check if we've done this within the last week
|
||||||
file = common.INSTALL_PREFIX + '/lib/python' + py_version + '/site-packages/deluge/info.py'
|
import glob
|
||||||
os.spawnlp(os.P_NOWAIT, 'python', 'python', file, common.PROGRAM_VERSION)
|
import time
|
||||||
|
if os.path.exists(common.CONFIG_DIR + '/infosent'):
|
||||||
|
a=glob.glob(common.CONFIG_DIR + '/infosent')[0]
|
||||||
|
if time.time() - os.stat(a)[8] >= 604800:
|
||||||
|
file = common.INSTALL_PREFIX + '/lib/python' + py_version + '/site-packages/deluge/info.py'
|
||||||
|
os.spawnlp(os.P_NOWAIT, 'python', 'python', file, common.PROGRAM_VERSION)
|
||||||
|
else:
|
||||||
|
file = common.INSTALL_PREFIX + '/lib/python' + py_version + '/site-packages/deluge/info.py'
|
||||||
|
os.spawnlp(os.P_NOWAIT, 'python', 'python', file, common.PROGRAM_VERSION)
|
||||||
|
|
||||||
|
|
||||||
if self.config.get("new_releases"):
|
if self.config.get("new_releases"):
|
||||||
new_release_check()
|
new_release_check()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue