本文整理汇总了Python中pymarc.record.Record.leader方法的典型用法代码示例。如果您正苦于以下问题:Python Record.leader方法的具体用法?Python Record.leader怎么用?Python Record.leader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymarc.record.Record
的用法示例。
在下文中一共展示了Record.leader方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_as_marc_with_explicit_leader
# 需要导入模块: from pymarc.record import Record [as 别名]
# 或者: from pymarc.record.Record import leader [as 别名]
def test_as_marc_with_explicit_leader(self):
"""
Test setting an explicit leader.
as_marc() should use the whole leader as set.
"""
record = Record()
record.add_field(Field(tag="245", indicators=["0", "1"], subfields=["a", "The pragmatic programmer"]))
record.leader = "00067 2200037 4500"
leader_not_touched = record.leader
transmission_format = record.as_marc()
leader_touched = record.leader
self.assertTrue(leader_not_touched == leader_touched)
示例2: test_as_marc_leader
# 需要导入模块: from pymarc.record import Record [as 别名]
# 或者: from pymarc.record.Record import leader [as 别名]
def test_as_marc_leader(self):
record = Record()
record.add_field(
Field(
tag = '245',
indicators = ['0','1'],
subfields = ['a', 'The pragmatic programmer']))
record.leader = '00067 2200037 4500'
leader_not_touched = record.leader
transmission_format = record.as_marc()
leader_touched = record.leader
self.assertTrue(leader_not_touched==leader_touched)