Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class GeoParserPass(Pass):
  2.     def run_with_processor(self, books, reporter, processor):
  3.         def _parse(book, para, chart_corr, notice):
  4.             mgeos = []
  5.             exc = None
  6.             for geo in notice.ast_object.action_geo:
  7.                 try:
  8.                     mgeos.append(processor.parse_meta_geo(geo))
  9.                 except Exception as e:
  10.                     exc = e
  11.             notice.geos.extend(mgeos)
  12.             if exc:
  13.                 raise exc
  14.         base_passes.for_each(_parse, books.walk("books").walk("paras").walk("chart_corrections").walk("notices")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement