Changeset 3319


Ignore:
Timestamp:
11 Mar 2008, 15:59:01 (17 years ago)
Author:
Henrik Bettermann
Message:

further improvements: error strings are now seperated by '+'

Location:
WAeUP_SRP/base
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/Upload.py

    r3316 r3319  
    1515from WAeUPImport import DepartmentImport,FacultyImport,StudentImport,VerdictImport
    1616from WAeUPImport import NO_KEY,IGNORE
    17  
     17
    1818import logging
    1919import csv,re,os
     
    8080            else:
    8181                base_path = os.path.split(csv_path)[1]
    82                 msg = 'No such file %(base_path)s' % vars()
     82                msg = '+ no such file %(base_path)s +' % vars()
    8383        else:
    8484            reader = csv.reader(open(csv_path,"rb"))
     
    8686            values = reader.next()
    8787            if "import_mode" not in headline:
    88                 msg += 'import_mode must be in heading'
     88                msg += '+ import_mode must be in heading +'
    8989            invalid_keys = importer.checkHeadline(headline)
    9090            if invalid_keys:
    91                 msg += "invalid keys in heading"
     91                msg += "+ invalid keys in heading +"
    9292            err,keys = importer.getHeadlineFields(headline,values)
    9393            if err:
     
    9595        return msg,keys
    9696    ###)
    97    
     97
    9898    security.declareProtected(View,"getFields") ###(
    9999    def getKeys(self):
     
    105105        return keys
    106106    ###)
    107    
     107
    108108    security.declareProtected(View,"getUploadFileInfo") ###(
    109109    def getUploadFileInfo(self):
     
    112112        return os.stat(os.path.join(storage_path,doc.filename))
    113113    ###)
    114    
     114
    115115    security.declareProtected(ModifyPortalContent,"editHeadline") ###(
    116116    def editHeadline(self,key_pairs):
     
    129129        writer.writerow(headline)
    130130        writer.writerows(records)
    131        
    132        
     131
     132
    133133InitializeClass(Upload)
    134134
  • WAeUP_SRP/base/WAeUPImport.py

    r3318 r3319  
    168168        while True:
    169169            if len(values) != len(import_keys):
    170                 msg += "%d fields in headline but %d values" % (len(import_keys),len(values))
     170                msg += "+ %d fields in headline but %d values +" % (len(import_keys),len(values))
    171171                break
    172172            for k in import_keys:
    173173                if k in singels:
    174174                    keys += (k,'%s' % k,values[i],'(duplicate)'),
    175                     msg += ("duplicate %s," % k)
     175                    msg += ("+ duplicate %s +" % k)
    176176                    keys[singels.index(k)] = (k,'%s' % k,values[singels.index(k)],'(duplicate)')
    177177                elif k in invalid_keys and not k.startswith(IGNORE):
  • WAeUP_SRP/base/skins/waeup_upload/uploads_form.pt

    r3318 r3319  
    7070              <tr>
    7171                <th></th>
    72                 <th>Current Column Heading</th>
     72                <th>Current Column Title</th>
    7373                <th>Possible Field Names</th>
    7474                <th colspan="3">First Record (Example)</th>
     
    9797          <br />
    9898         
    99           <font color='red'>Please see error message for further information. If there are
    100           'invalid keys in heading', you can edit the uploaded file online. Select the correct keys
    101           (column titles) from the select boxes provided, tick the box in the first column of the table and press the Edit button.
     99          <font color='red'>Please see error message for further information. If there are errors in the headline of the import file
     100          (e.g. invalid keys in heading), you can edit the uploaded file online. Select the correct field names
     101          from the select boxes provided, tick the box in the first column of the table and press the Edit button.
    102102          If you have accidentally chosen the wrong import data layout, select the correct layout and press the Edit button.  </font>
    103103                   
Note: See TracChangeset for help on using the changeset viewer.