Update configure() and configurable default states so that the default for

snarfers is off and all users are asked whether they would like to enable the
snarfer
This commit is contained in:
James Vega 2003-11-17 18:09:42 +00:00
parent f6e848511b
commit 31c05776c6

View File

@ -69,30 +69,29 @@ def configure(onStart, afterConnect, advanced):
if key: if key:
onStart.append('load Google') onStart.append('load Google')
onStart.append('google licensekey %s' % key) onStart.append('google licensekey %s' % key)
if 'load Alias' not in onStart:
print 'Google depends on the Alias module for some commands.'
if yn('Would you like to load the Alias module now?') == 'y':
onStart.append('load Alias')
else:
print 'You can still use the Google module, but you won\'t ' \
'be asked any further questions.'
return
onStart.append('alias googlelinux "google --restrict=linux $1"')
onStart.append('alias googlebsd "google --restrict=bsd $1"')
onStart.append('alias googlemac "google --restrict=mac $1"')
if advanced:
print 'The Google plugin has the functionality to watch for URLs' print 'The Google plugin has the functionality to watch for URLs'
print 'that match a specific pattern (we call this a snarfer).' print 'that match a specific pattern (we call this a snarfer).'
print 'When supybot sees such a URL, he will parse the web page' print 'When supybot sees such a URL, he will parse the web page'
print 'for information and reply with the results.\n' print 'for information and reply with the results.\n'
print 'Google has two available snarfers: Google Groups link' print 'Google has two available snarfers: Google Groups link'
print 'snarfing and a google search snarfer.\n' print 'snarfing and a google search snarfer.\n'
if yn('Do you want the Google Groups link snarfer enabled by '\ if yn('Do you want the Google Groups link snarfer enabled by '
'default?') == 'n': 'default?') == 'n':
onStart.append('Google config groups-snarfer off') onStart.append('Google config groups-snarfer off')
if yn('Do you want the Google search snarfer enabled by default?')\ if yn('Do you want the Google search snarfer enabled by default?')\
== 'y': == 'y':
onStart.append('Google config search-snarfer on') onStart.append('Google config search-snarfer on')
if 'load Alias' not in onStart:
print 'Google depends on the Alias module for some extra commands.'
if yn('Would you like to load the Alias module now?') == 'y':
onStart.append('load Alias')
else:
print 'You can still use the Google module, but you won\'t '\
'have these extra commands enabled.'
return
onStart.append('alias googlelinux "google --restrict=linux $1"')
onStart.append('alias googlebsd "google --restrict=bsd $1"')
onStart.append('alias googlemac "google --restrict=mac $1"')
else: else:
print 'You\'ll need to get a key before you can use this plugin.' print 'You\'ll need to get a key before you can use this plugin.'
print 'You can apply for a key at http://www.google.com/apis/' print 'You can apply for a key at http://www.google.com/apis/'