mirror of https://github.com/Mikaela/Limnoria.git
Made addlookup ignore comment lines (designated by initial '#').
This commit is contained in:
parent
2da90c99d6
commit
dba6ae9217
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue