Ignore:
Timestamp:
Feb 24, 2010, 1:01:34 PM (10 years ago)
Author:
Nick Burch
Message:

Tweak the count display

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/scripts/generic-python-import/generic_importer.py

    r734 r735  
    197197                sth.execute(sql, source_id)
    198198
    199         # Loop over all rows. Non-deleted come last, so it doesn't matter
    200         #  if we override early occurances of a postcode
     199                # Loop over all rows. Non-deleted come last, so it doesn't matter
     200                #  if we override early occurances of a postcode
    201201                spcs = {}
    202202                while 1:
     
    211211
    212212                # And for interest, the count of deleted ones
    213                 sql = "SELECT COUNT(id) FROM postcodes WHERE source = %s AND deleted"
     213                sql = "SELECT COUNT(distinct outward||inward) FROM postcodes WHERE source = %s AND deleted"
    214214                sth = dbh.cursor()
    215215                sth.execute(sql, source_id)
     
    217217                sth.close()
    218218
    219                 print "There are currently %d entries in the database from the %s. (Additionally, there are %d deleted ones)" % (count-deleted_count, self.source_name, deleted_count)
     219                print "There are currently %d entries in the database from the %s." % (count, self.source_name)
     220                print " Of these, %d are live, and %d are deleted" % (count-deleted_count, deleted_count)
    220221                print "The new import contains %d entries" % len(postcodes)
    221222
Note: See TracChangeset for help on using the changeset viewer.