- Timestamp:
- 10 Sep 2012, 11:05:07 (12 years ago)
- Location:
- main/waeup.kofa/branches/uli-async-update
- Files:
-
- 4 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/branches/uli-async-update
- Property svn:mergeinfo changed
-
main/waeup.kofa/branches/uli-async-update/src/waeup/kofa/utils/batching.py
r9112 r9169 304 304 finished_writer = csv.DictWriter(open(finished_path, 'wb'), 305 305 finished_headers) 306 os.chmod(finished_path, 0664) 306 307 finished_writer.writerow(dict([(x,x) for x in finished_headers])) 307 308 … … 398 399 os.path.abspath(finished_path), failed_path) 399 400 401 def get_csv_skeleton(self): 402 """Export CSV file only with a header of available fields. 403 404 A raw string with CSV data should be returned. 405 """ 406 outfile = StringIO() 407 writer = csv.DictWriter(outfile, self.available_fields) 408 writer.writerow(dict(zip(self.available_fields, self.available_fields))) # header 409 outfile.seek(0) 410 return outfile.read() 411 400 412 class ExporterBase(object): 401 413 """A base for exporters. -
main/waeup.kofa/branches/uli-async-update/src/waeup/kofa/utils/helpers.py
r8739 r9169 520 520 if exclude_methods and isinstance(descr, Method): 521 521 continue 522 if name in result: 523 continue 522 524 result.append(name) 523 525 return result … … 683 685 writer.writerow(row) 684 686 return tmp_path 685 686 # Save function used for save methods in pages687 def msave(view, **data):688 changed_fields = view.applyData(view.context, **data)689 # Turn list of lists into single list690 if changed_fields:691 changed_fields = reduce(lambda x,y: x+y, changed_fields.values())692 fields_string = ' + '.join(changed_fields)693 view.flash(_('Form has been saved.'))694 ob_class = view.__implemented__.__name__.replace('waeup.kofa.','')695 if fields_string:696 grok.getSite().logger.info('%s - saved: %s' % (ob_class, fields_string))697 return -
main/waeup.kofa/branches/uli-async-update/src/waeup/kofa/utils/utils.py
r8603 r9169 123 123 124 124 STUDY_MODES_DICT = { 125 'transfer': 'Transfer', 125 126 'ug_ft': 'Undergraduate Full-Time', 126 127 'ug_pt': 'Undergraduate Part-Time', … … 192 193 193 194 194 def sendCredentials(self, user, password=None, login_url=None, msg=None):195 def sendCredentials(self, user, password=None, url_info=None, msg=None): 195 196 """Send credentials as email. 196 197 … … 209 210 Your user name: ${d} 210 211 Your password: ${e} 211 Login page:${f}212 ${f} 212 213 213 214 Please remember your user name and keep … … 230 231 'd':user.name, 231 232 'e':password, 232 'f': login_url})233 'f':url_info}) 233 234 234 235 body = translate(text, 'waeup.kofa',
Note: See TracChangeset for help on using the changeset viewer.