Use textwrap to wrap our lines to 80char, otherwise ircd cannot parse the long

comments we use (beeth is aware)


git-svn-id: svn+ssh://svn.ipng.nl/usr/share/subversion/repositories/ircnet.ipng.ch@38 c5d60b8d-fdcb-4146-b734-af4215e9eb71
This commit is contained in:
ircnet
2009-09-14 11:44:55 +00:00
parent 44a3bf1d65
commit fe19d9132d

View File

@ -21,6 +21,7 @@ import os
import getpass
import socket
import re
import textwrap
def usage():
print """Usage:
@ -169,18 +170,15 @@ def main():
ofile.write("# File generated on %s by %s@%s\n" %
(time.asctime(time.localtime(time.time())),
getpass.getuser(), socket.gethostname()))
# TODO(pim): Make these lines wrap at ~80char because the ircd config
# parser cannot take long lines :(
# ofile.write("# Commandline: %s\n" % ' '.join(sys.argv))
# ofile.write("# assets=%s asns=%s output=%s class=%s\n" %
# (','.join(_assets), ','.join(_asns), _output, _class))
ofile.write("# Commandline:\n# %s\n" %
("\n# ".join(textwrap.wrap(' '.join(sys.argv)))))
ofile.write("# Objects found: %d route/route6, %d ASn, %d as-set\n\n" %
(len(all_route_list), len(_data['asn']), len(_assets)))
# for _asset in _data['as-set']:
# ofile.write("# %s: %s\n" %
# (_asset, ', '.join(_data['as-set'][_asset])))
for _asset in _data['as-set']:
ofile.write("# %s:\n# %s\n" %
(_asset, "\n# ".join(textwrap.fill(
', '.join(_data['as-set'][_asset])))))
ofile.write("#\n\n")
output_linecount = 0