Changeset 3162


Ignore:
Timestamp:
14 Feb 2008, 08:04:50 (17 years ago)
Author:
joachim
Message:

fix for #477

Location:
WAeUP_SRP/base
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTool.py

    r3161 r3162  
    20962096                em = 'No  %s' % os.path.split(pending_fn)
    20972097                return em
    2098             attrs = csv.reader(open(pending_fn,"rb")).next()
    20992098        else:
    21002099            import_source_fn = "%s/import/%s.csv" % (i_home,filename)
    21012100            imported_fn = "%s/import/%s_imported%s.csv" % (i_home,filename,current)
    21022101            not_imported_fn = "%s/import/%s_not_imported%s.csv" % (i_home,filename,current)
    2103             attrs = csv.reader(open(import_source_fn,"rb")).next()
     2102        if not os.path.exists(import_source_fn):
     2103            em = 'No  %s' % os.path.split(import_soure_fn)
     2104            return em
     2105        attrs = csv.reader(open(import_source_fn,"rb")).next()
    21042106        import_keys = [k.strip() for k in attrs if not (k.strip().startswith('ignore')
    21052107                                                        or k.strip() == 'Error')]
  • WAeUP_SRP/base/skins/waeup_default/get_csv_names.py

    r2282 r3162  
    77files = context.waeup_tool.get_csv_filenames()
    88if key is None:
    9     l = [(f[:-4],f) for f in files]
     9    if files:
     10        l = [(f[:-4],f) for f in files]
     11    else:
     12        l = []
     13    l.insert(0,('--','without new data'))
    1014    l.sort(cmp=lambda x,y: cmp(x[0].lower(), y[0].lower()))
    1115    return l
    1216
    13 return files[files.index("%s.csv" % key)]
    14 
     17if "%s.csv" % key in files:
     18    return files[files.index("%s.csv" % key)]
     19return ('--','without new data')
Note: See TracChangeset for help on using the changeset viewer.