Prevent scheduled downloads from happening when we're generating

docs (hopfully), and fix a userdataFilename bug introduced in the
earlier fix.
This commit is contained in:
James Vega 2004-06-20 08:14:59 +00:00
parent 9d9c3020ca
commit 1383da0f1a
4 changed files with 13 additions and 4 deletions

View File

@ -238,7 +238,8 @@ if __name__ == '__main__':
if not os.path.exists(conf.supybot.directories.data()):
os.mkdir(conf.supybot.directories.data())
userdataFilename = os.path.join(supybot.directories.conf(),'userdata.conf')
userdataFilename = os.path.join(conf.supybot.directories.conf(),
'userdata.conf')
# Let's open this now since we've got our directories setup.
if not os.path.exists(userdataFilename):
fd = file(userdataFilename, 'w')

View File

@ -293,6 +293,8 @@ class PeriodicFileDownloader(object):
self.getFile(filename)
def _downloadFile(self, filename, url, f):
if world.documenting:
return
self.currentlyDownloading.add(filename)
try:
try:

View File

@ -66,7 +66,9 @@ commandsProcessed = 0
ircs = [] # A list of all the IRCs.
def _flushUserData():
registry.close(conf.users, conf.userdataFilename, annotated=False)
userdataFilename = os.path.join(conf.supybot.directories.conf(),
'userdata.conf')
registry.close(conf.users, userdataFilename, annotated=False)
flushers = [_flushUserData] # A periodic function will flush all these.
@ -174,6 +176,7 @@ atexit.register(startDying)
##################################################
testing = False
dying = False
documenting = False
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:

View File

@ -38,10 +38,13 @@ import textwrap
import traceback
import supybot
import supybot.src.world
supybot.src.world.documenting = True
if not os.path.exists('test-conf'):
os.mkdir('test-conf')
registryFilename = os.path.join('test-conf', 'test.conf')
fd = file(registryFilename, 'w')
fd.write("""
@ -329,6 +332,6 @@ if __name__ == '__main__':
makePluginDocumentation(pluginWindow)
finishIndex()
makeCommandsIndex()
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: