Made addlookup ignore comment lines (designated by initial '#').

This commit is contained in:
Jeremy Fincher 2003-09-29 08:49:54 +00:00
parent 2da90c99d6
commit dba6ae9217

View File

@ -156,6 +156,8 @@ class Lookup(callbacks.Privmsg):
cursor.execute("""CREATE TABLE %s (key TEXT, value TEXT)""" % name) cursor.execute("""CREATE TABLE %s (key TEXT, value TEXT)""" % name)
sql = """INSERT INTO %s VALUES (%%s, %%s)""" % name sql = """INSERT INTO %s VALUES (%%s, %%s)""" % name
for line in fd: for line in fd:
if line.startswith('#'):
continue
line = line.rstrip('\r\n') line = line.rstrip('\r\n')
try: try:
(key, value) = line.split(':', 1) (key, value) = line.split(':', 1)