def __exit__(self, type, value, tb): console.draw_line(msg=" __exit__ ") if not any([type, value, tb]): report(" closing project:", self.project.close()) report(" removing shadow", remove_recursively(self.pth_shadow)) else: report("exit with error", type, value, tb)
def extract(self, input_file_or_dir, comments=False, docstrings=False): """ extract comments, organized by container. if --docstrings is True, only docstring-style comments will be displayed. if --comments is True, only hash-mark style comments will be displayed. default is to show both. """ fpath, lst_of_comment_lsts = self._extract(input_file_or_dir,comments=comments,docstrings=docstrings) ## display results print console.blue('{fpath}'.format(fpath=fpath)) for comment_lst in lst_of_comment_lsts: owner_display = console.blue(comment_lst[0].rowner()) print '\nin "{owner}":'.format(owner=owner_display) console.draw_line() print '\n'.join([str(comment) for comment in comment_lst])
def __enter__(self): """ context manager protocol """ if self.debug: console.draw_line(msg="__enter__") return self
def __enter__(self): """ """ if self.debug: console.draw_line(msg="__enter__") return self
def __enter__(self): """ """ console.draw_line(msg="__enter__") report(" running _open") return self