Handle setting the revision in a different way.

This commit is contained in:
Andrew Resch 2008-01-21 09:25:21 +00:00
parent 0b807e8945
commit b950d28781
4 changed files with 24 additions and 7 deletions

View File

@ -56,7 +56,15 @@ def get_version():
return pkg_resources.require("Deluge")[0].version.split("r")[0]
def get_revision():
return pkg_resources.require("Deluge")[0].version.split("r")[1]
revision = ""
try:
f = open(pkg_resources.resource_filename("deluge", os.path.join("data", "revision")))
revision = f.read()
f.close()
except IOError, e:
log.debug("Could not open revision file: %s", e)
return revision
def get_config_dir(filename=None):
""" Returns the config path if no filename is specified

0
deluge/data/revision Normal file
View File

View File

@ -50,10 +50,14 @@ class AboutDialog:
"aboutdialog")
self.about.set_position(gtk.WIN_POS_CENTER)
self.about.set_name("Deluge")
try:
self.about.set_version(deluge.common.get_version() + "r" + deluge.common.get_revision())
except IndexError:
self.about.set_version(deluge.common.get_version())
# Get the version and revision numbers
rev = deluge.common.get_revision()
version = deluge.common.get_version()
if rev != "":
version = version + "r" + rev
self.about.set_version(version)
self.about.set_authors(["Andrew Resch", "Marcos Pinto"])
self.about.set_artists(["Andrew Wedderburn", "Andrew Resch"])
self.about.set_translator_credits(_("translator-credits"))

View File

@ -50,11 +50,15 @@ try:
stdout = os.popen("svn info")
for line in stdout:
if line.split(" ")[0] == "Revision:":
revision_string = "r%s" % line.split(" ")[1].strip()
revision_string = line.split(" ")[1].strip()
break
f = open("deluge/data/revision", "w")
f.write(revision_string)
f.close()
except:
pass
# The libtorrent extension
_extra_compile_args = [
"-Wno-missing-braces",
@ -173,7 +177,7 @@ for path in glob.glob('deluge/plugins/*'):
setup(
name = "deluge",
fullname = "Deluge Bittorent Client",
version = "0.6.0.0" + revision_string,
version = "0.6.0.0",
author = "Andrew Resch, Marcos Pinto",
author_email = "andrewresch@gmail.com, markybob@dipconsultants.com",
description = "GTK+ bittorrent client",
@ -183,6 +187,7 @@ setup(
package_data = {"deluge": ["ui/gtkui/glade/*.glade",
"data/pixmaps/*.png",
"data/pixmaps/deluge.svg",
"data/revision",
"plugins/*.egg",
"i18n/*.pot",
"i18n/*/LC_MESSAGES/*.mo",