kopia lustrzana https://github.com/ctjacobs/pyqso
Duplicates are now defined by the CALL, QSO_DATE and TIME_ON fields. Didn't seem necessary to also consider FREQ and MODE.
rodzic
65a3fe68d9
commit
75a8f0ce50
|
@ -66,6 +66,5 @@ Removing duplicate records
|
|||
--------------------------
|
||||
|
||||
PyQSO can find and delete duplicate records in a log. A record is a
|
||||
duplicate of another if its data in the Callsign, Date, Time, Frequency,
|
||||
and Mode fields are the same. Click ``Remove Duplicate Records`` in the
|
||||
duplicate of another if its data in the Callsign, Date, and Time fields are the same. Click ``Remove Duplicate Records`` in the
|
||||
``Records`` menu.
|
||||
|
|
|
@ -235,6 +235,7 @@ class Log(Gtk.ListStore):
|
|||
if(row_index in duplicates): # Is this a duplicate row? If so, delete it.
|
||||
self.delete_record(row_index, iter)
|
||||
removed += 1
|
||||
break
|
||||
iter = self.iter_next(iter) # Move on to the next row, until iter_next returns None.
|
||||
|
||||
assert(removed == len(duplicates))
|
||||
|
@ -262,7 +263,7 @@ class Log(Gtk.ListStore):
|
|||
return success
|
||||
|
||||
def get_duplicates(self):
|
||||
""" Find the duplicates in the log, based on the CALL, QSO_DATE, TIME_ON, FREQ and MODE fields.
|
||||
""" Find the duplicates in the log, based on the CALL, QSO_DATE, and TIME_ON fields.
|
||||
|
||||
:returns: A list of row IDs corresponding to the duplicate records.
|
||||
:rtype: list
|
||||
|
@ -274,7 +275,7 @@ class Log(Gtk.ListStore):
|
|||
c.execute(
|
||||
"""SELECT rowid FROM %s WHERE rowid NOT IN
|
||||
(
|
||||
SELECT MIN(rowid) FROM %s GROUP BY call, qso_date, time_on, freq, mode
|
||||
SELECT MIN(rowid) FROM %s GROUP BY call, qso_date, time_on
|
||||
)""" % (self.name, self.name))
|
||||
result = c.fetchall()
|
||||
for rowid in result:
|
||||
|
|
Ładowanie…
Reference in New Issue