mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 13:27:08 +00:00
@@ -37,14 +37,16 @@ def del_pending_remark(db, sequence):
|
|||||||
with db.conn.cursor() as cursor:
|
with db.conn.cursor() as cursor:
|
||||||
qry = "SELECT remarks FROM raw_lines WHERE sequence = %s;"
|
qry = "SELECT remarks FROM raw_lines WHERE sequence = %s;"
|
||||||
cursor.execute(qry, (sequence,))
|
cursor.execute(qry, (sequence,))
|
||||||
remarks = cursor.fetchone()[0]
|
row = cursor.fetchone()
|
||||||
rx = re.compile("^(<!-- @@DGL:PENDING@@ -->.*<!-- @@/DGL:PENDING@@ -->\n)")
|
if row is not None:
|
||||||
m = rx.match(remarks)
|
remarks = row[0]
|
||||||
if m is not None:
|
rx = re.compile("^(<!-- @@DGL:PENDING@@ -->.*<!-- @@/DGL:PENDING@@ -->\n)")
|
||||||
remarks = rx.sub("",remarks)
|
m = rx.match(remarks)
|
||||||
qry = "UPDATE raw_lines SET remarks = %s WHERE sequence = %s;"
|
if m is not None:
|
||||||
cursor.execute(qry, (remarks, sequence))
|
remarks = rx.sub("",remarks)
|
||||||
db.maybe_commit()
|
qry = "UPDATE raw_lines SET remarks = %s WHERE sequence = %s;"
|
||||||
|
cursor.execute(qry, (remarks, sequence))
|
||||||
|
db.maybe_commit()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user