Skip to content

Commit 5865d1c

Browse files
committed
an effort to make it working under python 2.7 and 3.x
1 parent fb9a7e7 commit 5865d1c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+6240
-2176
lines changed

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Editor junk
2+
*.swp
3+
*.bkp
4+
*.bak
5+
*~
6+
7+
# Files generated by build system
8+
/.api-html.up2date
9+
/.examples.up2date
10+
/html/
11+
/profile.out
12+
13+
# Pipenv, setuptools, etc.
14+
/pipenv
15+
.venv/
16+
/dist/
17+
/build/
18+
/wheelhouse/
19+
/epydoc-*
20+
*.egg-info
21+
*.tox
22+
*.deb
23+
/MANIFEST
24+
25+
# Python generated stuff
26+
*.py[cod]
27+
__pycache__
28+
29+
30+
nothing added to commit but untracked files present (use "git add" to track)
31+
32+
# vim: set syntax=conf tabstop=2 expandtab nospell:

Makefile

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@
88
## Configuration variables
99
##//////////////////////////////////////////////////////////////////////
1010

11+
# What version of python to use?
12+
PYTHON = python2.7 # 2018-11-17: python2.7 is the oldest version available
13+
export PYTHONPATH=src
14+
1115
# Python source files (don't include src/epydoc/test?)
12-
PY_SRC = src/epydoc/
13-
PY_SRCFILES = $(shell find $(PY_SRC) -name '*.py')
16+
PY_SRC = src/epydoc
17+
PY_SRCFILES = $(shell find $(PY_SRC)/ -name '*.py')
1418
EXAMPLES_SRC = $(wildcard doc/*.py)
1519
DOCDIR = doc
1620
DOCS = $(wildcard $(DOCDIR)/*)
17-
DOCTESTS = $(wildcard src/epydoc/test/*.doctest)
21+
PYX = $(shell $(PYTHON) -c 'import sys; print("py%d" % sys.version_info[0])')
22+
DOCTESTS = $(wildcard $(PY_SRC)/test/*.doctest $(PY_SRC)/test/$(PYX)/*.doctest)
1823
MANUAL_SRC = $(wildcard doc/manual-*.txt)
1924

20-
# What version of python to use?
21-
PYTHON = python2.5
22-
export PYTHONPATH=src/
23-
2425
# The location of the webpage.
2526
HOST = shell.sf.net
2627
DIR = /home/groups/e/ep/epydoc/htdocs
@@ -49,7 +50,7 @@ MKDISPATCH = $(PYTHON) src/tools/mkdispatch.py
4950
STY2HTML = $(PYTHON) src/tools/sty2html.py
5051

5152
DOCTEST_HTML_FILES := \
52-
$(DOCTESTS:src/epydoc/test/%.doctest=$(HTML_DOCTEST)/%.html)
53+
$(DOCTESTS:$(PY_SRC)/test/%.doctest=$(HTML_DOCTEST)/%.html)
5354

5455
MANUAL_HTML_FILES := $(HTML_MANUAL)/epydoc.html \
5556
$(MANUAL_SRC:doc/manual-%.txt=$(HTML_MANUAL)/manual-%.html)
@@ -122,7 +123,7 @@ $(HTML_MANUAL)/manual-%.html: doc/manual-%.txt doc/epydoc-style-list.txt
122123

123124
checkdoc: checkdocs
124125
checkdocs:
125-
epydoc --check --tests=vars,types $(PY_SRC)
126+
$(EPYDOC) --check --tests=vars,types $(PY_SRC)/
126127

127128
.webpage.up2date: .api-html.up2date .examples.up2date .api-pdf.up2date \
128129
$(DOCTEST_HTML_FILES) doc/epydoc-man.html \
@@ -150,7 +151,7 @@ api-html: .api-html.up2date
150151
--url http://epydoc.sourceforge.net --pstat profile.out \
151152
--inheritance=listed --navlink "epydoc $(VERSION)"\
152153
--include-log \
153-
--docformat plaintext -v --graph all --debug $(PY_SRC)
154+
--docformat plaintext -v --graph all --debug $(PY_SRC)/
154155
touch .api-html.up2date
155156

156157
api-pdf: .api-pdf.up2date
@@ -159,12 +160,12 @@ api-pdf: .api-pdf.up2date
159160
rm -f $(LATEX_API)
160161
$(EPYDOC) --pdf -o $(LATEX_API) --docformat plaintext \
161162
--no-submodule-list --graph classtree --sty shaded \
162-
--name "Epydoc $(VERSION)" $(PY_SRC) -v --debug
163+
--name "Epydoc $(VERSION)" $(PY_SRC)/ -v --debug
163164
touch .api-pdf.up2date
164165

165166
# Convert doctest files to HTML, using rst2html.
166167
doctest-html: doctest-html-mkdir $(DOCTEST_HTML_FILES)
167-
doctest-html-mkdir:
168+
doctest-html-mkdir:
168169
mkdir -p $(HTML_DOCTEST)
169170
$(HTML_DOCTEST)/%.html: src/epydoc/test/%.doctest
170171
mkdir -p $(HTML_DOCTEST)
@@ -234,7 +235,7 @@ profile.out: $(PY_SRCFILES)
234235
--url http://epydoc.sourceforge.net --profile-epydoc \
235236
--inheritance=listed --navlink "epydoc $(VERSION)"\
236237
--include-log \
237-
--docformat plaintext -v --graph all $(PY_SRC)
238+
--docformat plaintext -v --graph all $(PY_SRC)/
238239
rm -rf profile.tmp hotshot.out
239240

240241
# Convert builtin latex style files to html

doc/configfile.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ <h1>Sample Configuration File</h1>
146146
<a class="nav" href="epytext.html">
147147
Epytext</a></td></a>
148148
<td align="center" width="20%" class="nav">
149-
150-
<A href="http://sourceforge.net/projects/epydoc">
151-
<IMG src="sflogo.png"
149+
150+
<A href="http://sourceforge.net/projects/epydoc">
151+
<IMG src="sflogo.png"
152152
width="88" height="26" border="0" alt="SourceForge"
153153
align="top"/></A></td>
154154
</tr>

doc/docstrings.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ <h1> Python Docstrings </h1>
7777
<a class="nav" href="epytext.html">
7878
Epytext</a></td></a>
7979
<td align="center" width="20%" class="nav">
80-
81-
<A href="http://sourceforge.net/projects/epydoc">
82-
<IMG src="sflogo.png"
80+
81+
<A href="http://sourceforge.net/projects/epydoc">
82+
<IMG src="sflogo.png"
8383
width="88" height="26" border="0" alt="SourceForge"
8484
align="top"/></A></td>
8585
</tr>

doc/doctest/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h2 class="box-title">Regression Tests</h2>
3939
of the Javadoc markup language.</li>
4040
<li> <a href="plaintext.html">Plaintext</a> -- Tests for epydoc's support
4141
of plaintext markup.</li>
42-
<li> <a href="restructuredtext.html">reStructuredText</a> -- Tests
42+
<li> <a href="restructuredtext.html">reStructuredText</a> -- Tests
4343
for epydoc's support of the reStructuredText markup language.</li>
4444
<li> <a href="pyval_repr.html">Value Representations</a> -- Tests
4545
for epydoc's formatting & syntax highlighting of variable's
@@ -71,9 +71,9 @@ <h2 class="box-title">Regression Tests</h2>
7171
<a class="nav" href="../epytext.html">
7272
Epytext</a></td></a>
7373
<td align="center" width="20%" class="nav">
74-
75-
<A href="http://sourceforge.net/projects/epydoc">
76-
<IMG src="../sflogo.png"
74+
75+
<A href="http://sourceforge.net/projects/epydoc">
76+
<IMG src="../sflogo.png"
7777
width="88" height="26" border="0" alt="SourceForge"
7878
align="top"/></A></td>
7979
</tr>

doc/epytext.html

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ <h2> 2. Block Structure </h2>
5050
unordered list items, and "<code>&gt;&gt;&gt;</code>" is used to
5151
mark doctest blocks. </li>
5252
</ul>
53-
53+
5454
<p> The following sections describe how to use each type of block
5555
structure. </p>
5656

@@ -71,7 +71,7 @@ <h3> 2.1. Paragraphs </h3>
7171
This is a paragraph. Paragraphs can
7272
span multiple lines, and can contain
7373
I{inline markup}.
74-
74+
7575

7676
This is another paragraph. Paragraphs
7777
are separated by blank lines.
@@ -85,8 +85,8 @@ <h3> 2.1. Paragraphs </h3>
8585
other by blank lines. </p>
8686
</td></tr>
8787
</table>
88-
89-
<a name="list"/>
88+
89+
<a name="list"/>
9090
<h3> 2.2. Lists </h3>
9191

9292
<p> Epytext supports both ordered and unordered lists. A list
@@ -157,10 +157,10 @@ <h3> 2.2. Lists </h3>
157157
<i>[...]</i>
158158
</pre>
159159
</td><td>
160-
This is a paragraph.
160+
This is a paragraph.
161161
<ol>
162162
<li> This is a list item. </li>
163-
<li> This is a second list item.
163+
<li> This is a second list item.
164164
<ul><li>This is a sublist.</li></ul></li>
165165
</ol>
166166
</td></tr>
@@ -202,7 +202,7 @@ <h3> 2.2. Lists </h3>
202202
- This is a sublist.
203203
- The sublist contains two
204204
items.
205-
- The second item of the
205+
- The second item of the
206206
sublist has its own sublist.
207207

208208
2. This list item contains two
@@ -216,7 +216,7 @@ <h3> 2.2. Lists </h3>
216216
<i>[...]</i>
217217
</pre>
218218
</td><td>
219-
This is a paragraph.
219+
This is a paragraph.
220220
<ol>
221221
<li> This is a list item. </li>
222222
<ul>
@@ -352,7 +352,7 @@ <h3> 2.4. Literal Blocks </h3>
352352
<code class="keyword">def</code> <code class="function">example</code>():
353353
<code class="string">"""
354354
The following is a literal block::
355-
355+
356356
Literal /
357357
/ Block
358358

@@ -395,7 +395,7 @@ <h3> 2.5. Doctest Blocks </h3>
395395
<code class="keyword">def</code> <code class="function">example</code>():
396396
<code class="string">"""
397397
The following is a doctest block:
398-
398+
399399
&gt;&gt;&gt; print (1+3,
400400
... 3+5)
401401
(4, 8)
@@ -472,7 +472,7 @@ <h3> 2.6. Fields </h3>
472472
</td><td>
473473
<dl><dt><b>Parameters:</b></dt>
474474
<dd><code><b>x</b></code> -
475-
This is a description of the parameter x to a function. Note that the
475+
This is a description of the parameter x to a function. Note that the
476476
description is indented four spaces.
477477
<br><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
478478
(type=This is a description of x's type.)</i>
@@ -563,10 +563,10 @@ <h3> 3.1. Basic Inline Markup </h3>
563563
<i><b>Inline markup</b> may be nested; and it may span</i>
564564
multiple lines.
565565
<ul>
566-
<li> <i>Italicized text</i> </li>
567-
<li> <b>Bold-faced text</b> </li>
568-
<li> <code>Source code</code> </li>
569-
<li> Math: <i>m*x+b</i> </li>
566+
<li> <i>Italicized text</i> </li>
567+
<li> <b>Bold-faced text</b> </li>
568+
<li> <code>Source code</code> </li>
569+
<li> Math: <i>m*x+b</i> </li>
570570
</ul>
571571
Without the capital letter, matching
572572
braces are not interpreted as markup:
@@ -925,7 +925,7 @@ <h2> 5. Warnings and Errors </h2>
925925

926926
<h3> 5.1. Epytext Warnings </h3>
927927
<ul>
928-
928+
929929
<li><b class="error">Possible mal-formatted field item.</b> <br />
930930
Epytext detected a line that looks like a field item, but is not
931931
correctly formatted. This typically occurs when the trailing colon
@@ -941,7 +941,7 @@ <h3> 5.1. Epytext Warnings </h3>
941941
</ul>
942942
<h3> 5.2. Field Warnings </h3>
943943
<ul>
944-
944+
945945
<li><b class="error"><code>@param</code> for unknown parameter <i>param</i>.</b> <br />
946946
A <code>@param</code> field was used to specify the type for a parameter that is
947947
not included in the function's signature. This is typically caused
@@ -971,9 +971,9 @@ <h3> 5.2. Field Warnings </h3>
971971
<li><b class="error">Redefinition of <i>field</i>.</b> <br />
972972
Multiple field tags define the value of <i>field</i> in the same
973973
docstring, but <i>field</i> can only take a single value.
974-
974+
975975
</ul>
976-
<h3> 5.3. Epytext Errors </h3>
976+
<h3> 5.3. Epytext Errors </h3>
977977
<ul>
978978

979979
<li><b class="error">Bad link target.</b> <br />
@@ -1022,7 +1022,7 @@ <h3> 5.3. Epytext Errors </h3>
10221022
If you intended the latter, then change the word-wrapping of the
10231023
paragraph, or escape the first character of the word that looks like
10241024
a bullet.
1025-
1025+
10261026
<li><b class="error">Unbalanced '{'.</b> <br />
10271027
The docstring contains unbalanced braces. Epytext requires that all
10281028
braces must be balanced. To include a single unbalanced brace, use
@@ -1065,9 +1065,9 @@ <h3> 5.3. Epytext Errors </h3>
10651065
<a class="nav" href="epytext.html">
10661066
Epytext</a></td></a>
10671067
<td align="center" width="20%" class="nav">
1068-
1069-
<A href="http://sourceforge.net/projects/epydoc">
1070-
<IMG src="sflogo.png"
1068+
1069+
<A href="http://sourceforge.net/projects/epydoc">
1070+
<IMG src="sflogo.png"
10711071
width="88" height="26" border="0" alt="SourceForge"
10721072
align="top"/></A></td>
10731073
</tr>

doc/epytextintro.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ <h1> A Brief Introduction to Epytext </h1>
7979
<a class="nav" href="epytext.html">
8080
Epytext</a></td></a>
8181
<td align="center" width="20%" class="nav">
82-
83-
<A href="http://sourceforge.net/projects/epydoc">
84-
<IMG src="sflogo.png"
82+
83+
<A href="http://sourceforge.net/projects/epydoc">
84+
<IMG src="sflogo.png"
8585
width="88" height="26" border="0" alt="SourceForge"
8686
align="top"/></A></td>
8787
</tr>

doc/faq.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ <h2>Extracting Documentation</h2>
167167
then it may not be possible to import and introspect it; but the
168168
parser can still examine its contents. </li>
169169

170-
<li> If importing a module has significant side effects, then
170+
<li> If importing a module has significant side effects, then
171171
introspecting it might not be desirable; but the parser can
172172
still examine its contents. </li>
173173

@@ -289,7 +289,7 @@ <h2>Generated Output</h2>
289289
me know.</p></dd>
290290

291291
<!-- QUESTION --><a name="graphs" />
292-
<dt><p><b>Q:</b> How can I include graphs in the generated output?
292+
<dt><p><b>Q:</b> How can I include graphs in the generated output?
293293
</p></dt>
294294

295295
<dd><p>Epydoc can automatically generate a variety of graphs,
@@ -302,7 +302,7 @@ <h2>Generated Output</h2>
302302
classes, or functions. For example, using
303303
<code>--graph&nbsp;classtree</code> will replace the text-based
304304
class tree with a graphical class tree on all module pages.
305-
See the <a href="using.html#cli">command line usage</a>
305+
See the <a href="using.html#cli">command line usage</a>
306306
documentation for more information.</li>
307307

308308
<li> Graphs may be explicitly created by docstrings, using
@@ -317,7 +317,7 @@ <h2>Generated Output</h2>
317317
href="othermarkup.html#restructuredtext">using reStructuredText
318318
with epydoc. </a>.</li>
319319
</ul>
320-
320+
321321

322322
<p> Graph generation requires the <a
323323
href="http://www.graphviz.org/">Graphviz package</a>. If the
@@ -444,9 +444,9 @@ <h2>Development of Epydoc</h2>
444444
<a class="nav" href="epytext.html">
445445
Epytext</a></td></a>
446446
<td align="center" width="20%" class="nav">
447-
448-
<A href="http://sourceforge.net/projects/epydoc">
449-
<IMG src="sflogo.png"
447+
448+
<A href="http://sourceforge.net/projects/epydoc">
449+
<IMG src="sflogo.png"
450450
width="88" height="26" border="0" alt="SourceForge"
451451
align="top"/></A></td>
452452
</tr>

0 commit comments

Comments
 (0)