Ignore:
Timestamp:
21 Sep 2012, 08:19:35 (12 years ago)
Author:
uli
Message:

Rollback r9209. Looks like multiple merges from trunk confuse svn when merging back into trunk.

Location:
main/waeup.kofa/branches/uli-zc-async
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/uli-zc-async

  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/utils/batching.py

    r9209 r9211  
    304304        finished_writer = csv.DictWriter(open(finished_path, 'wb'),
    305305                                         finished_headers)
    306         os.chmod(finished_path, 0664)
    307306        finished_writer.writerow(dict([(x,x) for x in finished_headers]))
    308307
     
    399398                os.path.abspath(finished_path), failed_path)
    400399
    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 
    412400class ExporterBase(object):
    413401    """A base for exporters.
     
    518506
    519507    The resulting CSV file will be stored in a new temporary directory
    520     (using :func:`tempfile.mkdtemp`). It will be named after the
    521     exporter used with `.csv` filename extension.
     508    (using :func:`tempfile.mkdtemp`).
    522509
    523510    Returns the path to the created CSV file.
     
    529516    exporter = getUtility(ICSVExporter, name=exporter_name)
    530517    output_dir = tempfile.mkdtemp()
    531     filename = '%s.csv' % exporter_name
    532     output_path = os.path.join(output_dir, filename)
     518    output_path = os.path.join(output_dir, 'export.csv')
    533519    exporter.export_all(site, filepath=output_path)
    534520    return output_path
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/utils/helpers.py

    r9209 r9211  
    520520            if exclude_methods and isinstance(descr, Method):
    521521                continue
    522             if name in result:
    523                 continue
    524522            result.append(name)
    525523    return result
     
    685683        writer.writerow(row)
    686684    return tmp_path
     685
     686# Save function used for save methods in pages
     687def msave(view, **data):
     688    changed_fields = view.applyData(view.context, **data)
     689    # Turn list of lists into single list
     690    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-zc-async/src/waeup/kofa/utils/utils.py

    r9209 r9211  
    123123
    124124    STUDY_MODES_DICT = {
    125         'transfer': 'Transfer',
    126125        'ug_ft': 'Undergraduate Full-Time',
    127126        'ug_pt': 'Undergraduate Part-Time',
     
    193192
    194193
    195     def sendCredentials(self, user, password=None, url_info=None, msg=None):
     194    def sendCredentials(self, user, password=None, login_url=None, msg=None):
    196195        """Send credentials as email.
    197196
     
    210209Your user name: ${d}
    211210Your password: ${e}
    212 ${f}
     211Login page: ${f}
    213212
    214213Please remember your user name and keep
     
    231230            'd':user.name,
    232231            'e':password,
    233             'f':url_info})
     232            'f':login_url})
    234233
    235234        body = translate(text, 'waeup.kofa',
Note: See TracChangeset for help on using the changeset viewer.