Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
86ef95d3
Commit
86ef95d3
authored
Nov 27, 2014
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #18905: "pydoc -p 0" now outputs actually used port. Based on patch by
Wieland Hoffmann.
parent
2c1f3766
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
Lib/pydoc.py
Lib/pydoc.py
+5
-3
Misc/NEWS
Misc/NEWS
+6
-0
No files found.
Lib/pydoc.py
View file @
86ef95d3
...
...
@@ -17,7 +17,8 @@ Run "pydoc -k <keyword>" to search for a keyword in the synopsis lines
of all available modules.
Run "pydoc -p <port>" to start an HTTP server on a given port on the
local machine to generate documentation web pages.
local machine to generate documentation web pages. Port number 0 can be
used to get an arbitrary unused port.
For platforms without a command line, "pydoc -g" starts the HTTP server
and also pops up a little window for controlling it.
...
...
@@ -2098,7 +2099,6 @@ pydoc</strong> by Ka-Ping Yee <ping@lfw.org></font>'''
def
__init__
(
self
,
port
,
callback
):
host
=
'localhost'
self
.
address
=
(
host
,
port
)
self
.
url
=
'http://%s:%d/'
%
(
host
,
port
)
self
.
callback
=
callback
self
.
base
.
__init__
(
self
,
self
.
address
,
self
.
handler
)
...
...
@@ -2111,6 +2111,7 @@ pydoc</strong> by Ka-Ping Yee <ping@lfw.org></font>'''
def
server_activate
(
self
):
self
.
base
.
server_activate
(
self
)
self
.
url
=
'http://%s:%d/'
%
(
self
.
address
[
0
],
self
.
server_port
)
if
self
.
callback
:
self
.
callback
(
self
)
DocServer
.
base
=
BaseHTTPServer
.
HTTPServer
...
...
@@ -2384,7 +2385,8 @@ def cli():
Search for a keyword in the synopsis lines of all available modules.
%s -p <port>
Start an HTTP server on the given port on the local machine.
Start an HTTP server on the given port on the local machine. Port
number 0 can be used to get an arbitrary unused port.
%s -g
Pop up a graphical interface for finding and serving documentation.
...
...
Misc/NEWS
View file @
86ef95d3
...
...
@@ -22,6 +22,12 @@ Documentation
- Issue #21514: The documentation of the json module now refers to new JSON RFC
7159 instead of obsoleted RFC 4627.
Tools/Demos
-----------
- Issue #18905: "pydoc -p 0" now outputs actually used port. Based on patch by
Wieland Hoffmann.
What'
s
New
in
Python
2.7.9
release
candidate
1
?
===============================================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment