本文整理匯總了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)