diff --git a/src/info.py b/src/info.py index bc865f4d1..5b2b88f54 100644 --- a/src/info.py +++ b/src/info.py @@ -4,8 +4,14 @@ import urllib import platform import gtk +import common + 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=" + \ platform.machine() + "&python=" + platform.python_version() \ + "&os=" + platform.system() + "&pygtk=" + pygtk) + +f = open(common.CONFIG_DIR + '/infosent', 'w') +f.write("") +f.close diff --git a/src/interface.py b/src/interface.py index f7d9dd41c..d1b65c866 100644 --- a/src/interface.py +++ b/src/interface.py @@ -123,9 +123,18 @@ class DelugeGTK: def send_info(): import sys py_version = sys.version[:3] - #check if we already sent the info - file = common.INSTALL_PREFIX + '/lib/python' + py_version + '/site-packages/deluge/info.py' - os.spawnlp(os.P_NOWAIT, 'python', 'python', file, common.PROGRAM_VERSION) + #check if we've done this within the last week + import glob + 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"): new_release_check()