use proper os.join.path

This commit is contained in:
Marcos Pinto 2007-08-07 11:20:07 +00:00
parent 0159c18da4
commit 0ae3bdf839
3 changed files with 8 additions and 4 deletions

View File

@ -125,7 +125,8 @@ def open_url_in_browser(link):
else: else:
import os, sys import os, sys
version = sys.version[:3] version = sys.version[:3]
file = INSTALL_PREFIX + '/lib/python' + version + '/site-packages/deluge/browser.py' file = os.path.join(INSTALL_PREFIX, 'lib', 'python' \
+ version, 'site-packages', 'deluge', 'browser.py')
os.spawnlp(os.P_NOWAIT, 'python', 'python', file, link) os.spawnlp(os.P_NOWAIT, 'python', 'python', file, link)
def is_url(url): def is_url(url):

View File

@ -4,6 +4,7 @@
import urllib import urllib
import platform import platform
import gtk import gtk
import os
import common 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])
@ -12,6 +13,6 @@ 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 = open(os.path.join(common.CONFIG_DIR, 'infosent'), 'w')
f.write("") f.write("")
f.close f.close

View File

@ -129,10 +129,12 @@ class DelugeGTK:
if os.path.exists(common.CONFIG_DIR + '/infosent'): if os.path.exists(common.CONFIG_DIR + '/infosent'):
a=glob.glob(common.CONFIG_DIR + '/infosent')[0] a=glob.glob(common.CONFIG_DIR + '/infosent')[0]
if time.time() - os.stat(a)[8] >= 604800: if time.time() - os.stat(a)[8] >= 604800:
file = common.INSTALL_PREFIX + '/lib/python' + py_version + '/site-packages/deluge/info.py' 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) os.spawnlp(os.P_NOWAIT, 'python', 'python', file, common.PROGRAM_VERSION)
else: else:
file = common.INSTALL_PREFIX + '/lib/python' + py_version + '/site-packages/deluge/info.py' 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) os.spawnlp(os.P_NOWAIT, 'python', 'python', file, common.PROGRAM_VERSION)