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()): if not os.path.exists(conf.supybot.directories.data()):
os.mkdir(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. # Let's open this now since we've got our directories setup.
if not os.path.exists(userdataFilename): if not os.path.exists(userdataFilename):
fd = file(userdataFilename, 'w') fd = file(userdataFilename, 'w')

View File

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

View File

@ -66,7 +66,9 @@ commandsProcessed = 0
ircs = [] # A list of all the IRCs. ircs = [] # A list of all the IRCs.
def _flushUserData(): 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. flushers = [_flushUserData] # A periodic function will flush all these.
@ -174,6 +176,7 @@ atexit.register(startDying)
################################################## ##################################################
testing = False testing = False
dying = False dying = False
documenting = False
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:

View File

@ -38,6 +38,9 @@ import textwrap
import traceback import traceback
import supybot import supybot
import supybot.src.world
supybot.src.world.documenting = True
if not os.path.exists('test-conf'): if not os.path.exists('test-conf'):
os.mkdir('test-conf') os.mkdir('test-conf')