Changeset 3319
- Timestamp:
- 11 Mar 2008, 15:59:01 (17 years ago)
- Location:
- WAeUP_SRP/base
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/Upload.py
r3316 r3319 15 15 from WAeUPImport import DepartmentImport,FacultyImport,StudentImport,VerdictImport 16 16 from WAeUPImport import NO_KEY,IGNORE 17 17 18 18 import logging 19 19 import csv,re,os … … 80 80 else: 81 81 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() 83 83 else: 84 84 reader = csv.reader(open(csv_path,"rb")) … … 86 86 values = reader.next() 87 87 if "import_mode" not in headline: 88 msg += ' import_mode must be in heading'88 msg += '+ import_mode must be in heading +' 89 89 invalid_keys = importer.checkHeadline(headline) 90 90 if invalid_keys: 91 msg += " invalid keys in heading"91 msg += "+ invalid keys in heading +" 92 92 err,keys = importer.getHeadlineFields(headline,values) 93 93 if err: … … 95 95 return msg,keys 96 96 ###) 97 97 98 98 security.declareProtected(View,"getFields") ###( 99 99 def getKeys(self): … … 105 105 return keys 106 106 ###) 107 107 108 108 security.declareProtected(View,"getUploadFileInfo") ###( 109 109 def getUploadFileInfo(self): … … 112 112 return os.stat(os.path.join(storage_path,doc.filename)) 113 113 ###) 114 114 115 115 security.declareProtected(ModifyPortalContent,"editHeadline") ###( 116 116 def editHeadline(self,key_pairs): … … 129 129 writer.writerow(headline) 130 130 writer.writerows(records) 131 132 131 132 133 133 InitializeClass(Upload) 134 134 -
WAeUP_SRP/base/WAeUPImport.py
r3318 r3319 168 168 while True: 169 169 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)) 171 171 break 172 172 for k in import_keys: 173 173 if k in singels: 174 174 keys += (k,'%s' % k,values[i],'(duplicate)'), 175 msg += (" duplicate %s," % k)175 msg += ("+ duplicate %s +" % k) 176 176 keys[singels.index(k)] = (k,'%s' % k,values[singels.index(k)],'(duplicate)') 177 177 elif k in invalid_keys and not k.startswith(IGNORE): -
WAeUP_SRP/base/skins/waeup_upload/uploads_form.pt
r3318 r3319 70 70 <tr> 71 71 <th></th> 72 <th>Current Column Heading</th>72 <th>Current Column Title</th> 73 73 <th>Possible Field Names</th> 74 74 <th colspan="3">First Record (Example)</th> … … 97 97 <br /> 98 98 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 keys101 (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. 102 102 If you have accidentally chosen the wrong import data layout, select the correct layout and press the Edit button. </font> 103 103
Note: See TracChangeset for help on using the changeset viewer.