Misc: update version command to get latest version from gribble git.

Note: if this is ever merged into upstream supybot, should change url
to point at supybot gitweb, rather than gribble.
This commit is contained in:
Daniel Folkinshteyn 2010-09-02 18:31:42 -04:00
parent 567e72488d
commit 0fe7912628
2 changed files with 10 additions and 5 deletions

View File

@ -31,6 +31,7 @@
import os
import sys
import time
import re
import supybot
@ -207,12 +208,16 @@ class Misc(callbacks.Plugin):
Returns the version of the current bot.
"""
try:
newest = utils.web.getUrl('http://supybot.sf.net/version.txt')
newest ='The newest version available online is %s.'%newest.strip()
newest = utils.web.getUrl('http://gribble.git.sourceforge.net/git/'\
'gitweb.cgi?p=gribble/gribble;a=blob_plain;'\
'f=src/version.py;hb=HEAD')
m = re.search(r"^version = '([^']+)'$", newest, re.M)
newest = 'The newest version available in the gribble git '\
'repository is %s.' % (m.group(1),)
except utils.web.Error, e:
self.log.info('Couldn\'t get website version: %s', e)
self.log.info('Couldn\'t get newest version: %s', e)
newest = 'I couldn\'t fetch the newest version ' \
'from the Supybot website.'
'from the gribble git repository website.'
s = 'The current (running) version of this Supybot is %s. %s' % \
(conf.version, newest)
irc.reply(s)

View File

@ -1,3 +1,3 @@
"""stick the various versioning attributes in here, so we only have to change
them once."""
version = '0.83.4.1+gribble (2010-09-02T09:14:22-0400)'
version = '0.83.4.1+gribble (2010-09-02T18:31:42-0400)'