Skip to content

Commit 2e83944

Browse files
committed
The py3k branch is the new trunk.
1 parent 1f98dad commit 2e83944

File tree

454 files changed

+2534
-2498
lines changed

Some content is hidden

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

454 files changed

+2534
-2498
lines changed

AUTHORS renamed to pyx/AUTHORS

File renamed without changes.

CHANGES renamed to pyx/CHANGES

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
0.???? (201?/??/??):
1+
0.???? (2013/??/??):
2+
- Requires at least Python 3.3
23
- filelocator module:
34
- cygwin LaTeX with windows python patch (thanks to Sybren A. Stüvel)
45
- graph styles:
@@ -19,6 +20,8 @@
1920
- trafos and styles are no longer canvasitems
2021
- style module:
2122
- fillrules are now fillstyles and handled within the PS/PDF context
23+
- text module:
24+
- new texenc setting (TODO documentation)
2225

2326
0.12.1 (2012/10/26):
2427
- graph styles:

INSTALL renamed to pyx/INSTALL

File renamed without changes.

LICENSE renamed to pyx/LICENSE

File renamed without changes.
File renamed without changes.

README renamed to pyx/README

File renamed without changes.

TODO renamed to pyx/TODO

File renamed without changes.

pyx/config.py

-93
This file was deleted.

contrib/callingtex.py renamed to pyx/contrib/callingtex.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ def test_installation():
1717
except ImportError:
1818
compiled_pykpathsea = False
1919

20-
print "Platform is %s" % sys.platform
21-
print "Python installation prefix is %s" % sys.prefix
22-
print "Python executable is %s" % sys.executable
23-
print "PyX comes from %s" % pyx.__file__
24-
print "PyX version %s" % pyx.__version__
20+
print("Platform is %s" % sys.platform)
21+
print("Python installation prefix is %s" % sys.prefix)
22+
print("Python executable is %s" % sys.executable)
23+
print("PyX comes from %s" % pyx.__file__)
24+
print("PyX version %s" % pyx.__version__)
2525
if compiled_pykpathsea:
26-
print "PyX pykpathsea compiled from C module"
26+
print("PyX pykpathsea compiled from C module")
2727
else:
28-
print "PyX pykpathsea python module used"
29-
print
28+
print("PyX pykpathsea python module used")
29+
print()
3030

3131
def test_commands():
3232
for command in [r"echo $0 \"$*\"",
@@ -46,12 +46,12 @@ def test_commands():
4646
r"file `which latex`",
4747
]:
4848
stdin, stdout, stderr = os.popen3(command)
49-
print "\"%22s\" -->" % (command),
49+
print("\"%22s\" -->" % (command), end=' ')
5050
for line in stdout:
51-
print " %s" % line,
51+
print(" %s" % line, end=' ')
5252
for x in [stdin, stdout, stderr]:
5353
x.close()
54-
print
54+
print()
5555

5656
def test_fontmaps():
5757
allformats = []
@@ -131,10 +131,10 @@ def test_fontmaps():
131131
mappath = pyx.pykpathsea.find_file(fontmap, form)
132132
if mappath:
133133
found = 1
134-
print "\"%s\" found at \"%s\" as format \"%s\"" % (fontmap, mappath, allnames[form])
134+
print("\"%s\" found at \"%s\" as format \"%s\"" % (fontmap, mappath, allnames[form]))
135135
if not found:
136-
print "\"%s\" not found" % fontmap
137-
print
136+
print("\"%s\" not found" % fontmap)
137+
print()
138138

139139
test_installation()
140140
test_commands()
File renamed without changes.
File renamed without changes.
File renamed without changes.

contrib/epstopng.py renamed to pyx/contrib/epstopng.py

+13-16
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,8 @@
2222
# - this is much too slow --- consider a rewrite in C
2323

2424

25-
import getopt, sys, os, StringIO, re, math
26-
try:
27-
from PIL import Image
28-
except ImportError:
29-
import Image
25+
import getopt, sys, os, io, re, math
26+
from PIL import Image
3027

3128

3229
progname = "epstopng v0.1: eps to transparent antialiased png converter"
@@ -35,7 +32,7 @@
3532
def epstopng(epsname, pngname, resolution, scale, transparent, gsname, quiet):
3633
sys.stderr.write("run ghostscript to create a %i times larger non-antialiased image ... " % scale)
3734
gsout = os.popen("%s -dEPSCrop -dNOPAUSE -dQUIET -dBATCH -sDEVICE=ppmraw -sOutputFile=- -r%i %s" % (gsname, resolution*scale, epsname))
38-
input = Image.open(StringIO.StringIO(gsout.read())).convert("RGB") # ensure rgb here
35+
input = Image.open(io.StringIO(gsout.read())).convert("RGB") # ensure rgb here
3936
output = Image.new("RGBA", [(x+scale-1)/scale for x in input.size])
4037
sys.stderr.write("done\n")
4138
sys.stderr.write("image size is %ix%i\n" % output.size)
@@ -68,16 +65,16 @@ def epstopng(epsname, pngname, resolution, scale, transparent, gsname, quiet):
6865

6966

7067
def usage():
71-
print progname
72-
print "Copyright (C) 2003 André Wobst <[email protected]>"
73-
print "usage: epstopng [options] <eps-file>"
74-
print "-h, --help: show this help"
75-
print "-q, --quiet: be quiet"
76-
print "-o, --output <file>: output file name; must be set"
77-
print "-r, --resolution <dpi>: resolution; default: 100"
78-
print "-s, --scale <scale>: input scale for antialias; default: 4"
79-
print "-t, --transparent (<r>, <g>, <b>): transparent color; default: (255, 255, 255)"
80-
print "-g, --gsname <name>: name of the gs interpreter (gs version >= 8.0 needed!); default: \"gs\""
68+
print(progname)
69+
print("Copyright (C) 2003 André Wobst <[email protected]>")
70+
print("usage: epstopng [options] <eps-file>")
71+
print("-h, --help: show this help")
72+
print("-q, --quiet: be quiet")
73+
print("-o, --output <file>: output file name; must be set")
74+
print("-r, --resolution <dpi>: resolution; default: 100")
75+
print("-s, --scale <scale>: input scale for antialias; default: 4")
76+
print("-t, --transparent (<r>, <g>, <b>): transparent color; default: (255, 255, 255)")
77+
print("-g, --gsname <name>: name of the gs interpreter (gs version >= 8.0 needed!); default: \"gs\"")
8178

8279

8380
def main():
File renamed without changes.

contrib/imgconvert.py renamed to pyx/contrib/imgconvert.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@
3737
try:
3838
im = bitmap.jpegimage(args[0])
3939
except ValueError:
40-
try:
41-
from PIL import Image
42-
except ImportError:
43-
import Image
40+
from PIL import Image
4441
im = Image.open(args[0])
4542
compressmode = "Flate"
4643
else:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from pyx import *
22
p = path.circle(0, 0, 1)
3-
print p.arclen()
3+
print(p.arclen())
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

examples/bitmap/minimal.py renamed to pyx/examples/bitmap/minimal.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from pyx import *
22

3-
image_bw = bitmap.image(2, 2, "L", "\0\377\377\0")
4-
image_rgb = bitmap.image(3, 2, "RGB", "\77\77\77\177\177\177\277\277\277"
5-
"\377\0\0\0\377\0\0\0\377")
3+
image_bw = bitmap.image(2, 2, "L", b"\0\377\377\0")
4+
image_rgb = bitmap.image(3, 2, "RGB", b"\77\77\77\177\177\177\277\277\277"
5+
b"\377\0\0\0\377\0\0\0\377")
66
bitmap_bw = bitmap.bitmap(0, 1, image_bw, height=0.8)
77
bitmap_rgb = bitmap.bitmap(0, 0, image_rgb, height=0.8)
88

File renamed without changes.

examples/bitmap/pil.py renamed to pyx/examples/bitmap/pil.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
from pyx import *
2-
3-
# support Image module either from PIL or pillow
4-
try:
5-
from PIL import Image
6-
except ImportError:
7-
import Image
2+
from PIL import Image
83

94
im = Image.new("RGB", (3, 1))
105
im.putpixel((0, 0), (255, 0, 0))
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

examples/graphs/points.py renamed to pyx/examples/graphs/points.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
g = graph.graphxy(width=8)
66
# either provide lists of the individual coordinates
7-
g.plot(graph.data.values(x=range(10), y=range(10)))
7+
g.plot(graph.data.values(x=list(range(10)), y=list(range(10))))
88
# or provide one list containing the whole points
9-
g.plot(graph.data.points(zip(range(10), range(10)), x=1, y=2))
9+
g.plot(graph.data.points(list(zip(list(range(10)), list(range(10)))), x=1, y=2))
1010
g.writeEPSfile("points")
1111
g.writePDFfile("points")
1212

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

faq/conf.py renamed to pyx/faq/conf.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
master_doc = 'index'
4343

4444
# General information about the project.
45-
project = u'pyxfaq'
46-
copyright = u'2011, Gert-Ludwig Ingold'
45+
project = 'pyxfaq'
46+
copyright = '2011, Gert-Ludwig Ingold'
4747

4848
# The version info for the project you're documenting, acts as replacement for
4949
# |version| and |release|, also used in various other places throughout the
@@ -182,8 +182,8 @@
182182
# Grouping the document tree into LaTeX files. List of tuples
183183
# (source start file, target name, title, author, documentclass [howto/manual]).
184184
latex_documents = [
185-
('index', 'pyxfaq.tex', u'Some frequently and not so frequently asked questions about PyX',
186-
u'Gert-Ludwig Ingold', 'manual'),
185+
('index', 'pyxfaq.tex', 'Some frequently and not so frequently asked questions about PyX',
186+
'Gert-Ludwig Ingold', 'manual'),
187187
]
188188

189189
# The name of an image file (relative to this directory) to place at the top of
@@ -220,7 +220,7 @@
220220
# One entry per manual page. List of tuples
221221
# (source start file, name, description, authors, manual section).
222222
man_pages = [
223-
('index', 'pyxfaq', u'pyxfaq Documentation',
224-
[u'Gert-Ludwig Ingold'], 1)
223+
('index', 'pyxfaq', 'pyxfaq Documentation',
224+
['Gert-Ludwig Ingold'], 1)
225225
]
226226

0 commit comments

Comments
 (0)