Example #1
0
 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)
Example #2
0
    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])
Example #3
0
 def __enter__(self):
     """ context manager protocol """
     if self.debug:
         console.draw_line(msg="__enter__")
     return self
Example #4
0
 def __enter__(self):
     """ """
     if self.debug:
         console.draw_line(msg="__enter__")
     return self
Example #5
0
 def __enter__(self):
     """ """
     console.draw_line(msg="__enter__")
     report("  running _open")
     return self