Changeset 3140 for WAeUP_SRP/base


Ignore:
Timestamp:
10 Feb 2008, 16:56:16 (17 years ago)
Author:
joachim
Message:

fixes for #470

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTool.py

    r3139 r3140  
    20832083            imported_fn = "%s/import/%ss_pending_imported%s.csv" % (i_home,name,current)
    20842084            not_imported_fn = "%s/import/%ss_pending_not_imported%s.csv" % (i_home,name,current)
     2085            if not os.path.exists(pending_fn):
     2086                em = 'No  %s' % os.path.split(pending_fn)
     2087                return em
    20852088            attrs = csv.reader(open(pending_fn,"rb")).next()
    20862089        else:
     
    22152218            if error:
    22162219                item['Error'] = error
    2217                 if id and id not in pending_records.keys():
    2218                     item['id'] = id
    2219                     pending_records[id] = item
    2220                     msg = format_error % item
    2221                     logger.info("%(id)s added to pending %(msg)s" % vars())
    2222                     new_imports_pending += 1
     2220                if id:
     2221                    if id not in pending_records.keys():
     2222                        item['id'] = id
     2223                        pending_records[id] = item
     2224                        msg = format_error % item
     2225                        logger.info("%(id)s added to pending %(msg)s" % vars())
     2226                        new_imports_pending += 1
     2227                    else:
     2228                        logger.info("%(id)s already in pending %(msg)s" % vars())
    22232229                    continue
    22242230                else:
     
    22562262            pending_csv_writer.writerows(pending_records.values())
    22572263            total_pending += len(pending_records)
     2264        import_source_fn = os.path.split(import_source_fn)[1]
    22582265        msg = "Finished importing in %(mode)s mode from %(import_source_fn)s: " % vars()
    22592266        msg += "%(total_imported)d imported, %(total_not_imported)d not imported " % vars()
Note: See TracChangeset for help on using the changeset viewer.