h = open(os.path.join( Config()["Dir::Templates"],
Config()["Contents::Header"] ), "r")
self.header = h.read()
- print( "header: %s" % self.header )
h.close()
except:
log.error( "error opening header file: %d\n%s" % (Config()["Contents::Header"],
traceback.format_exc() ))
self.header = False
else:
- print( "no header" )
self.header = False
return self.header
Internal method for writing all the results to a given file.
The cursor should have a result set generated from a query already.
"""
- f = gzip.open(Config()["Dir::Root"] + filename, "w")
+ filepath = Config()["Contents::Root"] + filename
+ filedir = os.path.dirname(filepath)
+ if not os.path.isdir(filedir):
+ os.makedirs(filedir)
+ f = gzip.open(filepath, "w")
try:
header = self._getHeader()
return
num_tabs = max(1,
- int( math.ceil( (self._goal_column - len(contents[0])) / 8) ) )
+ int(math.ceil((self._goal_column - len(contents[0])) / 8)))
f.write(contents[0] + ( '\t' * num_tabs ) + contents[-1] + "\n")
finally:
"Split queue/done into a date-based hierarchy"),
("stats",
"Generate statistics"),
- ("calculate-shasums",
- "Calculate missing sha1sums and sha256sums"),
("bts-categorize",
"Categorize uncategorized bugs filed against ftp.debian.org"),
("add-user",