• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python template.join函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pybtex.style.template.join函数的典型用法代码示例。如果您正苦于以下问题:Python join函数的具体用法?Python join怎么用?Python join使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了join函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: format_address_organization_publisher_date

 def format_address_organization_publisher_date(
     self, e, include_organization=True):
     """Format address, organization, publisher, and date.
     Everything is optional, except the date.
     """
     # small difference from unsrt.bst here: unsrt.bst
     # starts a new sentence only if the address is missing;
     # for simplicity here we always start a new sentence
     if include_organization:
         organization = optional_field('organization')
     else:
         organization = None
     return first_of[
         # this will be rendered if there is an address
         optional [
             join(sep=' ') [
                 sentence[
                     field('address'),
                     date,
                 ],
                 sentence[
                     organization,
                     optional_field('publisher'),
                 ],
             ],
         ],
         # if there is no address then we have this
         sentence[
             organization,
             optional_field('publisher'),
             date,
         ],
     ]
开发者ID:OVii,项目名称:communityvisweb,代码行数:33,代码来源:unsrt.py


示例2: format_volume_and_series

 def format_volume_and_series(self, e, as_sentence=True):
     volume_and_series = optional [
         words [
             'volume', field('volume'), optional [
                 words ['of', field('series')]
             ]
         ]
     ]
     number_and_series = optional [
         words [
             join(sep=Symbol('nbsp')) ['number', field('number')],
             optional [
                 words ['in', field('series')]
             ]
         ]
     ]
     series = optional_field('series')
     result = first_of [
             volume_and_series,
             number_and_series,
             series,
         ]
     if as_sentence:
         return sentence(capfirst=False) [result]
     else:
         return result
开发者ID:OVii,项目名称:communityvisweb,代码行数:26,代码来源:unsrt.py


示例3: format_proceedings

 def format_proceedings(self, e):
     template = toplevel [
         first_of [
             # there are editors
             optional [
                 join(' ')[
                     self.format_editor(e),
                     sentence [
                         self.format_btitle(e, 'title', as_sentence=False),
                         self.format_volume_and_series(e, as_sentence=False),
                         self.format_address_organization_publisher_date(e),
                     ],
                 ],
             ],
             # there is no editor
             optional_field('organization'),
             sentence [
                 self.format_btitle(e, 'title', as_sentence=False),
                 self.format_volume_and_series(e, as_sentence=False),
                 self.format_address_organization_publisher_date(
                     e, include_organization=False),
             ],
         ],
         sentence(capfirst=False) [ optional_field('note') ],
     ]
     return template.format_data(e)
开发者ID:OVii,项目名称:communityvisweb,代码行数:26,代码来源:unsrt.py


示例4: format_url

 def format_url(self, e):
     # based on urlbst format.url
     return href [
         field('url'),
         join(' ') [
             'http',
             ]
         ]
开发者ID:oseledets,项目名称:pelican-bibtex,代码行数:8,代码来源:unsrt.py


示例5: format_url

 def format_url(self, e):
     # based on urlbst format.url
     return href [
         field('url'),
         join(' ') [
             'URL:',
             field('url')
             ]
         ]
开发者ID:andreas-h,项目名称:pybtex,代码行数:9,代码来源:unsrt.py


示例6: format_chapter_and_pages

 def format_chapter_and_pages(self, e):
     return join(sep=', ') [
         field('title', apply_func=dquote),
         words [
             optional [words ['chapter', field('chapter'), 'of']],
             tag('emph') [field('booktitle')]
         ],
         optional [words ['pages', pages]],
     ]
开发者ID:rybesh,项目名称:pybtex,代码行数:9,代码来源:custom.py


示例7: format_doi

 def format_doi(self, e):
     # based on urlbst format.doi
     return href [
         join [
             'http://dx.doi.org/' , 
             field('doi')
             #field('doi')
             ],
         join(' ') [
             'doi'
             ]
         ]
开发者ID:oseledets,项目名称:pelican-bibtex,代码行数:12,代码来源:unsrt.py


示例8: format_editor

 def format_editor(self, e, as_sentence=True):
     editors = self.format_names('editor', as_sentence=False)
     if 'editor' not in e.persons:
         # when parsing the template, a FieldIsMissing exception
         # will be thrown anyway; no need to do anything now,
         # just return the template that will throw the exception
         return editors
     if len(e.persons['editor']) > 1:
         word = 'editors'
     else:
         word = 'editor'
     result = join(sep=', ') [editors, word]
     if as_sentence:
         return sentence(capfirst=False) [result]
     else:
         return result
开发者ID:OVii,项目名称:communityvisweb,代码行数:16,代码来源:unsrt.py


示例9: format_volume_and_series

 def format_volume_and_series(self, e):
     volume_and_series = optional [
         sentence(capfirst=False, sep=' ') [
             'Volume', field('volume'), optional [
                 words ['of', field('series')]
             ]
         ]
     ]
     number_and_series = optional [
         sentence(capfirst=False, sep=' ') [
             join(sep=Symbol('nbsp')) ['Number', field('number')],
             optional [
                 words ['in', field('series')]
             ]
         ]
     ]
     series = optional [ sentence(capfirst=False) [field('series')] ]
     return first_of [
             volume_and_series,
             number_and_series,
             series,
         ]
开发者ID:rybesh,项目名称:pybtex,代码行数:22,代码来源:custom.py


示例10: names

def names(children, data, role, **kwargs):
    assert not children
    persons = data.persons[role]
    return join(**kwargs)[[NameStyle().format(person, abbr=True)
                           for person in persons]].format_data(data)
开发者ID:AntonyButcher,项目名称:obspy,代码行数:5,代码来源:make_citations.py


示例11: format_chapter_and_pages

 def format_chapter_and_pages(self, e):
     return join(sep=', ') [
         optional [words ['chapter', field('chapter')]],
         optional [words ['pages', pages]],
     ]
开发者ID:OVii,项目名称:communityvisweb,代码行数:5,代码来源:unsrt.py


示例12: format_isbn

 def format_isbn(self, e):
     return join(sep=' ') [ 'ISBN', field('isbn') ]
开发者ID:himito,项目名称:pelican-bibtex,代码行数:2,代码来源:mystyle.py


示例13: toplevel

def toplevel(children, data):
    return join(sep=Symbol('newblock')) [children].format_data(data)
开发者ID:OVii,项目名称:communityvisweb,代码行数:2,代码来源:__init__.py


示例14: toplevel

def toplevel(children, data):
    return join(sep=' ') [children].format_data(data)
开发者ID:DTU-TES,项目名称:CoolProp_mixing_rules,代码行数:2,代码来源:BibtexParser.py



注:本文中的pybtex.style.template.join函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python template.optional_field函数代码示例发布时间:2022-05-25
下一篇:
Python template.field函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap