Logo Search packages:      
Sourcecode: zope-cmfbibliographyat version File versions  Download package

def CMFBibliographyAT::content::folder::BaseBibliographyFolder::buildReportLine (   self,
  import_status,
  entry,
  url = None,
  relations = None 
) [inherited]

format a line to be added in the import report 

Definition at line 101 of file folder.py.

00101                                                                              :
        """ format a line to be added in the import report """

        if entry.has_key('authors'):
            authors = entry.get('authors')
            authors_list = []
            for author in authors:
                firstname = author.get('firstname')
                middlename = author.get('middlename', '')
                lastname = author.get('lastname')
                authors_list.append('%s %s %s' %(firstname,
                                                 middlename,
                                                 lastname))
            ref_authors = ', '.join(authors_list)
        else:
            ref_authors = 'Anonymous'

        ref_authors = _decode(ref_authors)
        ref_title = _decode(entry.get('title'))
        for car in ['\n','\r','\t','  ','  ']:
            ref_title = ref_title.replace(car,'')
        line = u'%s - %s' % (ref_authors, ref_title)

        if entry.has_key('publication_year'):
            line = u'%s (%s)' %(line, entry.get('publication_year'))

        if import_status == 'ok':
            line = u'Successfully Imported: %s' % line
        if import_status == 'ok' and relations:
            relations = _decode(relations)
            line = u'%s (Inferred author references: %s)' \
                   % (line, relations)
        if import_status == 'ok' and url:
            line = u'%s [<a href="%s">view</a>], ' \
                   u'[<a href="%s">edit</a>]' \
                   % (line, url, url+'/edit')
        else:
            line = u'%s: %s' % (import_status, line)
        return _encode(line + '.\n')

    security.declareProtected(AddPortalContent, 'processSingleImport')
    def processSingleImport(self, entry, infer_references=True):


Generated by  Doxygen 1.6.0   Back to index