示例#1
0
 def sections(self):
     _sections = []
     for item in self.article.article_sections:
         for label, sections in item.items():
             type_and_title_items = [sectitle + ' (' + sectype + ')' for sectype, sectitle in sections]
         _sections.append([label, type_and_title_items])
     return html_reports.format_list('sections:', 'ul', _sections)
示例#2
0
 def contrib_collabs(self):
     r = [a.collab for a in self.article.contrib_collabs]
     if len(r) > 0:
         r = html_reports.format_list('collabs', 'ul', r)
     else:
         r = self.display_labeled_value('collabs', 'None')
     return r
示例#3
0
def report_status(title, status, style=None):
    text = ''
    if status is not None:
        for category in sorted(status.keys()):
            _style = style
            if status.get(category) is None:
                ltype = 'ul'
                list_items = ['None']
                _style = None
            elif len(status[category]) == 0:
                ltype = 'ul'
                list_items = ['None']
                _style = None
            else:
                ltype = 'ol'
                list_items = status[category]
            text += html_reports.format_list(categories_messages.get(category, category), ltype, list_items, _style)
    if len(text) > 0:
        text = html_reports.tag('h3', title) + text
    return text
示例#4
0
 def keywords(self):
     return html_reports.format_list('keywords:', 'ol', ['(' + k['l'] + ') ' + k['k'] for k in self.article.keywords])
示例#5
0
 def contrib_names(self):
     return html_reports.format_list('authors:', 'ol', [format_author(a) for a in self.article.contrib_names])
path = curr_path + '/../../aff'

print(path)
if not os.path.isdir(path):
    os.makedirs(path)

if os.path.isdir(path):
    links = []
    labels = ['name', 'city', 'state']
    for country in sorted(countries.keys()):
        name, code = country.split(' - ')
        print(country)
        links.append(html_reports.link('./' + code + '.html', country))

        rows = []
        for items in countries[country]:
            print(items)
            org, city, state = items.split('\t')
            tr = {}
            tr['name'] = org
            tr['city'] = city
            tr['state'] = state
            rows.append(tr)
        content = html_reports.sheet(labels, rows)
        print(path + '/' + code + '.html')
        html_reports.save(path + '/' + code + '.html', country, content)

    content = html_reports.format_list('', 'ol', links)
    print(path + '/aff.html')
    html_reports.save(path + '/aff.html', 'Affiliations', content)