def cli_docs(): """ CLI option for invoking pydoc. """ import pydoc pydoc.browse() return 0
def start_serv(): # Redirect standard file descriptors. dev_null = open("/dev/null", "r") sys.stdout.flush() sys.stderr.flush() os.dup2(OUT_LOG.fileno(), sys.stdout.fileno()) os.dup2(ERR_LOG.fileno(), sys.stderr.fileno()) os.dup2(dev_null.fileno(), sys.stdin.fileno()) # TODO Python 2 support # pydoc.serve(PORT) pydoc.browse(PORT, open_browser=False)
def update_event(self, inp=-1): self.set_output_val(0, pydoc.browse(self.input(0)))