本文整理汇总了Python中webkitpy.common.checkout.changelog.ChangeLog.parse_entries_from_file方法的典型用法代码示例。如果您正苦于以下问题:Python ChangeLog.parse_entries_from_file方法的具体用法?Python ChangeLog.parse_entries_from_file怎么用?Python ChangeLog.parse_entries_from_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webkitpy.common.checkout.changelog.ChangeLog
的用法示例。
在下文中一共展示了ChangeLog.parse_entries_from_file方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: analyze
# 需要导入模块: from webkitpy.common.checkout.changelog import ChangeLog [as 别名]
# 或者: from webkitpy.common.checkout.changelog.ChangeLog import parse_entries_from_file [as 别名]
def analyze(self):
for path in self._changelog_paths:
self._set_filename(self._filesystem.relpath(path, self._scm.checkout_root))
with self._filesystem.open_text_file_for_reading(path) as changelog:
self._print_status('Parsing entries...')
number_of_parsed_entries = self._analyze_entries(ChangeLog.parse_entries_from_file(changelog), path)
self._print_status('Done (%d entries)' % number_of_parsed_entries)
print
self._summary['contributors'] = len(self._contributors_statistics)
self._summary['contributors_with_reviews'] = sum([1 for contributor in self._contributors_statistics.values() if contributor['reviews']['total']])
self._summary['contributors_without_reviews'] = self._summary['contributors'] - self._summary['contributors_with_reviews']
示例2: _resolve_existing_entry
# 需要导入模块: from webkitpy.common.checkout.changelog import ChangeLog [as 别名]
# 或者: from webkitpy.common.checkout.changelog.ChangeLog import parse_entries_from_file [as 别名]
def _resolve_existing_entry(self, changelog_path):
# When this is called, the top entry in the ChangeLog was just created
# by prepare-ChangeLog, as an clean updated version of the one below it.
with self._tool.filesystem.open_text_file_for_reading(changelog_path) as changelog_file:
entries_gen = ChangeLog.parse_entries_from_file(changelog_file)
entries = zip(entries_gen, range(2))
if not len(entries):
raise Exception("Expected to find at least two ChangeLog entries in %s but found none." % changelog_path)
if len(entries) == 1:
# If we get here, it probably means we've just rolled over to a
# new CL file, so we don't have anything to resolve.
return
(new_entry, _), (old_entry, _) = entries
final_entry = self._merge_entries(old_entry, new_entry)
changelog = ChangeLog(changelog_path, self._tool.filesystem)
changelog.delete_entries(2)
changelog.prepend_text(final_entry)