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 os
import sys import sys
import time import time
import re
import supybot import supybot
@ -207,12 +208,16 @@ class Misc(callbacks.Plugin):
Returns the version of the current bot. Returns the version of the current bot.
""" """
try: try:
newest = utils.web.getUrl('http://supybot.sf.net/version.txt') newest = utils.web.getUrl('http://gribble.git.sourceforge.net/git/'\
newest ='The newest version available online is %s.'%newest.strip() '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: 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 ' \ 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' % \ s = 'The current (running) version of this Supybot is %s. %s' % \
(conf.version, newest) (conf.version, newest)
irc.reply(s) irc.reply(s)

View File

@ -1,3 +1,3 @@
"""stick the various versioning attributes in here, so we only have to change """stick the various versioning attributes in here, so we only have to change
them once.""" 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)'