mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 08:17:09 +00:00
Recognise PENDING status in sequence imports.
If a final sequence file or directory name matches a pattern which is recognised to indicate a ‘pending acceptance’ status, the final data (if any exists) for that sequence will be deleted and a comment added to the effect that the sequence has been marked as ‘pending’. To accept the sequence, rename its final file or directory name accordingly. Note: it is the *final* data that is searched for a matching pattern, not the raw. Closes #91.
This commit is contained in:
@@ -639,3 +639,21 @@ class Datastore:
|
||||
self.maybe_commit()
|
||||
# We do not commit if we've been passed a cursor, instead
|
||||
# we assume that we are in the middle of a transaction
|
||||
|
||||
def del_sequence_final(self, sequence, cursor = None):
|
||||
"""
|
||||
Remove final data for a sequence.
|
||||
"""
|
||||
|
||||
if cursor is None:
|
||||
cur = self.conn.cursor()
|
||||
else:
|
||||
cur = cursor
|
||||
|
||||
qry = "DELETE FROM files WHERE hash = (SELECT hash FROM final_lines_files WHERE sequence = %s);"
|
||||
cur.execute(qry, (sequence,))
|
||||
if cursor is None:
|
||||
self.maybe_commit()
|
||||
# We do not commit if we've been passed a cursor, instead
|
||||
# we assume that we are in the middle of a transaction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user