1 |
commit: b6fa82c3c387c0f9a12a0671ebff55b75d9133ac |
2 |
Author: Gerion Entrup <gerion.entrup <AT> flump <DOT> de> |
3 |
AuthorDate: Fri Jul 13 21:25:47 2018 +0000 |
4 |
Commit: gerion <gerion.entrup <AT> flump <DOT> de> |
5 |
CommitDate: Fri Jul 13 21:25:47 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/user/gerislay.git/commit/?id=b6fa82c3 |
7 |
|
8 |
cleanup a bunch of old stuff |
9 |
|
10 |
app-arch/hardlink/ChangeLog | 13 - |
11 |
app-arch/hardlink/Manifest | 4 - |
12 |
app-arch/hardlink/hardlink-0.1.2.ebuild | 17 - |
13 |
app-arch/hardlink/metadata.xml | 7 - |
14 |
app-text/calibre/Manifest | 10 - |
15 |
app-text/calibre/calibre-3.26.1.ebuild | 293 - |
16 |
...libre-2.83.0-lzxd-bounds-error-bug-540596.patch | 37 - |
17 |
.../files/calibre-2.9.0-no_updates_dialog.patch | 27 - |
18 |
.../calibre/files/calibre-disable_plugins.patch | 17 - |
19 |
app-text/calibre/files/calibre-server-3.conf | 13 - |
20 |
app-text/calibre/files/calibre-server-3.init | 58 - |
21 |
app-text/calibre/files/calibre-server.conf | 13 - |
22 |
app-text/calibre/files/calibre-server.init | 58 - |
23 |
app-text/calibre/metadata.xml | 13 - |
24 |
dev-libs/jansson/Manifest | 2 - |
25 |
dev-libs/jansson/jansson-2.7-r1.ebuild | 38 - |
26 |
dev-python/PyPDF2/ChangeLog | 108 - |
27 |
dev-python/PyPDF2/ChangeLog-2015 | 21 - |
28 |
dev-python/PyPDF2/Manifest | 5 - |
29 |
dev-python/PyPDF2/PyPDF2-1.26.0.ebuild | 31 - |
30 |
dev-python/PyPDF2/metadata.xml | 12 - |
31 |
dev-python/flask-login/Manifest | 4 - |
32 |
.../flask-login-0.3.2-fix-tests-python2.patch | 29 - |
33 |
dev-python/flask-login/flask-login-0.4.0.ebuild | 32 - |
34 |
dev-python/flask-login/metadata.xml | 11 - |
35 |
dev-python/imdbpy/ChangeLog | 95 - |
36 |
dev-python/imdbpy/Manifest | 6 - |
37 |
.../imdbpy/files/imdbpy-4.6-data_location.patch | 11 - |
38 |
dev-python/imdbpy/files/updateToPython3.patch | 6966 -------------------- |
39 |
dev-python/imdbpy/imdbpy-4.9-r2.ebuild | 44 - |
40 |
dev-python/imdbpy/metadata.xml | 8 - |
41 |
media-gfx/blender/Manifest | 5 - |
42 |
media-gfx/blender/blender-2.78a-r2.ebuild | 295 - |
43 |
.../blender/files/blender-2.78-eigen-3.3.1.patch | 25 - |
44 |
.../blender/files/blender-fix-install-rules.patch | 16 - |
45 |
media-gfx/blender/metadata.xml | 101 - |
46 |
media-sound/patchage/Manifest | 8 +- |
47 |
...ge-1.0.0-r1.ebuild => patchage-1.0.0-r2.ebuild} | 0 |
48 |
media-sound/rosegarden/Manifest | 3 - |
49 |
media-sound/rosegarden/metadata.xml | 11 - |
50 |
media-sound/rosegarden/rosegarden-17.04-r1.ebuild | 60 - |
51 |
media-video/dvdstyler/ChangeLog | 276 - |
52 |
media-video/dvdstyler/Manifest | 7 - |
53 |
media-video/dvdstyler/dvdstyler-2.3.ebuild | 65 - |
54 |
.../dvdstyler/files/dvdstyler-1.7.4-autoconf.patch | 77 - |
55 |
.../dvdstyler/files/dvdstyler-1.8.1-cast.patch | 11 - |
56 |
.../files/dvdstyler-1.8.1-fix_enum_error.patch | 11 - |
57 |
media-video/dvdstyler/metadata.xml | 5 - |
58 |
net-news/rssguard/Manifest | 3 - |
59 |
net-news/rssguard/rssguard-3.4.0.ebuild | 39 - |
60 |
net-news/rssguard/rssguard-9999.ebuild | 39 - |
61 |
51 files changed, 4 insertions(+), 9056 deletions(-) |
62 |
|
63 |
diff --git a/app-arch/hardlink/ChangeLog b/app-arch/hardlink/ChangeLog |
64 |
deleted file mode 100644 |
65 |
index 7e6f7cb..0000000 |
66 |
--- a/app-arch/hardlink/ChangeLog |
67 |
+++ /dev/null |
68 |
@@ -1,13 +0,0 @@ |
69 |
-# ChangeLog for app-arch/hardlink |
70 |
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 |
71 |
-# $Header: /var/cvsroot/gentoo-x86/app-arch/hardlink/ChangeLog,v 1.2 2009/10/23 09:18:39 robbat2 Exp $ |
72 |
- |
73 |
- 23 Oct 2009; Robin H. Johnson <robbat2@g.o> hardlink-0.1.1.ebuild: |
74 |
- Build fixup. |
75 |
- |
76 |
-*hardlink-0.1.1 (22 Oct 2009) |
77 |
- |
78 |
- 22 Oct 2009; Robin H. Johnson <robbat2@g.o> +hardlink-0.1.1.ebuild, |
79 |
- +metadata.xml: |
80 |
- Initial commit. Ebuild by Robin H. Johnson <robbat2@g.o>. |
81 |
- |
82 |
|
83 |
diff --git a/app-arch/hardlink/Manifest b/app-arch/hardlink/Manifest |
84 |
deleted file mode 100644 |
85 |
index 72c6d18..0000000 |
86 |
--- a/app-arch/hardlink/Manifest |
87 |
+++ /dev/null |
88 |
@@ -1,4 +0,0 @@ |
89 |
-DIST hardlink_0.1.2.tar.gz 6840 RMD160 c5d10211cdcff03617e50fadc49d6e5e91454f4c SHA1 55fa3d69d48c059315eaaf2df5621ecd1d0c1ac5 SHA256 76181794b41c4dbdb418a91d18c5d5e627df1ace7799e088685632e20fc60d1c |
90 |
-EBUILD hardlink-0.1.2.ebuild 531 RMD160 b2475e6ce15a1d47674cf7bb8e576d00c09c0b30 SHA1 af12f406e3149f8144b20dcd7c839827d0a1dc6e SHA256 3e366009d4f58b9c605bf2c01dccbad85430cde785e0b3f31d061f2dc46cd6d9 |
91 |
-MISC ChangeLog 493 RMD160 93d6ffdf6c913cba97153d5bca2d2ede8959a315 SHA1 1193df31873234cb55e867e3e05b4f2441fb56b6 SHA256 22157bf388bcf39a290b01702f5f89501fdbe7a8d3d505c5dd06f5cb8efeb039 |
92 |
-MISC metadata.xml 202 RMD160 ca69c6e7044d6681415f1e86a1c084f890ff08ef SHA1 62ab18bf0e1da311494ca0912e5a79daeceb46ad SHA256 76dbb4a720140d78f0ddfb2b2782c03852169c201c1f507eb17ef4d2a82f212a |
93 |
|
94 |
diff --git a/app-arch/hardlink/hardlink-0.1.2.ebuild b/app-arch/hardlink/hardlink-0.1.2.ebuild |
95 |
deleted file mode 100644 |
96 |
index 541b7a2..0000000 |
97 |
--- a/app-arch/hardlink/hardlink-0.1.2.ebuild |
98 |
+++ /dev/null |
99 |
@@ -1,17 +0,0 @@ |
100 |
-# Copyright 1999-2009 Gentoo Foundation |
101 |
-# Distributed under the terms of the GNU General Public License v2 |
102 |
-# $Header: /var/cvsroot/gentoo-x86/app-arch/hardlink/hardlink-0.1.1.ebuild,v 1.2 2009/10/23 09:18:39 robbat2 Exp $ |
103 |
- |
104 |
-DESCRIPTION="replace file copies using hardlinks" |
105 |
-HOMEPAGE="http://jak-linux.org/projects/hardlink/" |
106 |
-SRC_URI="${HOMEPAGE}/${P/-/_}.tar.gz" |
107 |
-LICENSE="MIT" |
108 |
-SLOT="0" |
109 |
-KEYWORDS="~x86 ~amd64" |
110 |
-IUSE="" |
111 |
-DEPEND="" |
112 |
-RDEPEND="dev-lang/python" |
113 |
- |
114 |
-src_install() { |
115 |
- emake DESTDIR="${D}" install || die "Failed emake install" |
116 |
-} |
117 |
|
118 |
diff --git a/app-arch/hardlink/metadata.xml b/app-arch/hardlink/metadata.xml |
119 |
deleted file mode 100644 |
120 |
index c6d8628..0000000 |
121 |
--- a/app-arch/hardlink/metadata.xml |
122 |
+++ /dev/null |
123 |
@@ -1,7 +0,0 @@ |
124 |
-<?xml version="1.0" encoding="UTF-8"?> |
125 |
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
126 |
-<pkgmetadata> |
127 |
-<maintainer> |
128 |
- <email>robbat2@g.o</email> |
129 |
-</maintainer> |
130 |
-</pkgmetadata> |
131 |
|
132 |
diff --git a/app-text/calibre/Manifest b/app-text/calibre/Manifest |
133 |
deleted file mode 100644 |
134 |
index b90e137..0000000 |
135 |
--- a/app-text/calibre/Manifest |
136 |
+++ /dev/null |
137 |
@@ -1,10 +0,0 @@ |
138 |
-AUX calibre-2.83.0-lzxd-bounds-error-bug-540596.patch 1296 BLAKE2B a600a8777868b7f73c95d62de9097382cb1d3e076ea756b589811f5e33aa86f1724f93177d82247132a85779ff82960f178cc325b497f8b7f1391ff113729c69 SHA512 fba16c95a69b38113d4331faceae4a81f2319ae1631a03662bd3483ad6f1b687d16db28f9df019990a3bc6918c75f4a4492ca7ef772168a575cb06ff0761bddf |
139 |
-AUX calibre-2.9.0-no_updates_dialog.patch 1661 BLAKE2B c75fc49a621e8dbd16ee1bad748110399cf09a404b4a905d3f723bac1827787e4749f464ba026700b6e5b3cc0ee646a92de00f1f58d10cf12dc9bc91195ee8b6 SHA512 9663b95ed64bdc2bc40692922384d1c6073177eee58a49c412883c4d2ae098e4e0b4ea51b80443108b7c0c3e4f3fda60c00fc3be4d0b62a5d79d982697927235 |
140 |
-AUX calibre-disable_plugins.patch 1042 BLAKE2B 92a56016c2c54f1b156bc91031420594445545b98b701f7cce99cf4bb86847eebad1ccebdc20a0d1b67f9fa88a9250fc4926d7c04cb36405323388b3171cf502 SHA512 c152ddd92728a89db10c75a4d00a968bf119bef68da8b9116c76827e3cdc8f8a7e5c45fbb973f6ca8db1f79e461518351ce2d47e5e059c282f36d2df499d1629 |
141 |
-AUX calibre-server-3.conf 541 BLAKE2B 06593633721e6adf2cf2077dffa83953eea46ccdcdc857ad468a9b74788326e9424f6ab9058be344dbbac8e49d343f5a1e53ddb486f2018b77319a7f8f713cf4 SHA512 12ef793a5b6ffd4413f780a13cad63927a95f15d17d85d4229eb5005ead68e51779abb822f9898ab5ae8c2094affeec1f9e85c34f109499739e6726b7641542a |
142 |
-AUX calibre-server-3.init 1796 BLAKE2B f87d785d6f6fc10fa648d40944ec8538027854bb872d9a3be6b5b35b0abf3cda1e4e93874a9422914da5eb4287f193459733956e3f1e25e61bec0c214c552c99 SHA512 88110ded1b9c6cf8d3bfc3d5889654f77578f9d299e88daea9023767b930082e00fbddbb92a6e43c46d900248f3684232d93396ec1d0e784c7ec14b44783f98a |
143 |
-AUX calibre-server.conf 523 BLAKE2B a9fb65a327656f9b2f54eab27dcaf2cdfbcbe5f0d637204ea39f891c515ae899da156098609bc99398354337524843afbf45409bbb1098605f293661bb8381e7 SHA512 4595786d9b6ed7662a1124e8acc32e03e0149f614a07890f9df08d05811a1b8de51cc33cc1bfbf30b072c7ad75dc3b8247e9de53d20ee2b45017cb4160437058 |
144 |
-AUX calibre-server.init 1811 BLAKE2B fe22257128896d4299c5d5edab6ac63cdcf79da483f4afc49b0d1649b17599389dd4b9f88c35a964e289cbe6d961136f1e5760a2244137c404e573510899bd60 SHA512 760aa7a8f51b23b116ba07749855737869ff2313f0528d67e5a46bc362e5c0a04a7e1f46c32dd6e82add4fa5dc41d397db32dbd1a09c912008e0890d1a133eeb |
145 |
-DIST calibre-3.26.1.tar.xz 39109660 BLAKE2B 0e98c273b8a5dfafea7a7027de3f83ad25ab835edadedf78b7e9bc356bcac8937d915944f2ab6503b414c49b4e792e090e7bd2433a4e86373bf115720ed78b0a SHA512 893e36b101defaca29281b4bd072aafc1c4cb20a9cd3ee06a0b68fbe6b39cab34952799939ac4f54c77148c87861c5ab4ddff84f5ec8c2274ae7fa6424259ff5 |
146 |
-EBUILD calibre-3.26.1.ebuild 9280 BLAKE2B ef7557d2f7416658a93850dd09766fbb2e784c512c8fa7296137df0b0737afc151ba22c285fa2b4de49b726cdf3e58a1956757fccc9295ce1b5e40f5c2b615cd SHA512 035dc539a854fa30d2216c6bb66b69f5878c6f1e34cd05a6c4d50afbe00aa15e6450666961201abbff3317febea405ac28f8e11d4ad7ab392eb4327aff34196e |
147 |
-MISC metadata.xml 382 BLAKE2B 87fa7e63a6ed7a4ea55247b362288b43f7edd312cc3085bb8c1b947402ae4aa0df01fac4f6646d260653ff8af7fe28d3dabb8a213dbf3e206181b69835b33d5f SHA512 8503e0a4a48d93682c386eb1d6507b4b26585afc9d62b7cd52bc00b457a887bd17422a03669ff404570ff7f5ff6f0bba14ee935979f8b54722870d6620097de5 |
148 |
|
149 |
diff --git a/app-text/calibre/calibre-3.26.1.ebuild b/app-text/calibre/calibre-3.26.1.ebuild |
150 |
deleted file mode 100644 |
151 |
index c8832bf..0000000 |
152 |
--- a/app-text/calibre/calibre-3.26.1.ebuild |
153 |
+++ /dev/null |
154 |
@@ -1,293 +0,0 @@ |
155 |
-# Copyright 1999-2018 Gentoo Foundation |
156 |
-# Distributed under the terms of the GNU General Public License v2 |
157 |
- |
158 |
-EAPI=6 |
159 |
- |
160 |
-PYTHON_COMPAT=( python2_7 ) |
161 |
-PYTHON_REQ_USE="sqlite,ssl" |
162 |
- |
163 |
-inherit eutils bash-completion-r1 gnome2-utils multilib toolchain-funcs python-single-r1 xdg-utils |
164 |
- |
165 |
-DESCRIPTION="Ebook management application" |
166 |
-HOMEPAGE="https://calibre-ebook.com/" |
167 |
-SRC_URI="https://download.calibre-ebook.com/${PV}/${P}.tar.xz" |
168 |
- |
169 |
-LICENSE=" |
170 |
- GPL-3+ |
171 |
- GPL-3 |
172 |
- GPL-2+ |
173 |
- GPL-2 |
174 |
- GPL-1+ |
175 |
- LGPL-3+ |
176 |
- LGPL-2.1+ |
177 |
- LGPL-2.1 |
178 |
- BSD |
179 |
- MIT |
180 |
- Old-MIT |
181 |
- Apache-2.0 |
182 |
- public-domain |
183 |
- || ( Artistic GPL-1+ ) |
184 |
- CC-BY-3.0 |
185 |
- OFL-1.1 |
186 |
- PSF-2 |
187 |
- unRAR |
188 |
-" |
189 |
-KEYWORDS="~amd64" |
190 |
-SLOT="0" |
191 |
-IUSE="ios +udisks" |
192 |
- |
193 |
-REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
194 |
- |
195 |
-COMMON_DEPEND="${PYTHON_DEPS} |
196 |
- >=app-text/podofo-0.8.2:= |
197 |
- >=app-text/poppler-0.26.5[qt5] |
198 |
- >=dev-libs/chmlib-0.40:= |
199 |
- dev-libs/glib:2= |
200 |
- >=dev-libs/icu-57.1:= |
201 |
- dev-libs/libinput:= |
202 |
- >=dev-python/apsw-3.13.0[${PYTHON_USEDEP}] |
203 |
- >=dev-python/beautifulsoup-3.0.5:python-2[${PYTHON_USEDEP}] |
204 |
- dev-python/chardet[${PYTHON_USEDEP}] |
205 |
- >=dev-python/cssselect-0.7.1[${PYTHON_USEDEP}] |
206 |
- >=dev-python/cssutils-1.0.1[${PYTHON_USEDEP}] |
207 |
- >=dev-python/dbus-python-1.2.4[${PYTHON_USEDEP}] |
208 |
- >=dev-libs/dbus-glib-0.106 |
209 |
- >=sys-apps/dbus-1.10.8 |
210 |
- dev-python/html5-parser[${PYTHON_USEDEP}] |
211 |
- >=dev-python/lxml-3.2.1[${PYTHON_USEDEP}] |
212 |
- >=dev-python/mechanize-0.2.5[${PYTHON_USEDEP}] |
213 |
- dev-python/msgpack[${PYTHON_USEDEP}] |
214 |
- dev-python/netifaces[${PYTHON_USEDEP}] |
215 |
- dev-python/pillow[${PYTHON_USEDEP}] |
216 |
- dev-python/psutil[${PYTHON_USEDEP}] |
217 |
- >=dev-python/pygments-2.1.3[${PYTHON_USEDEP}] |
218 |
- >=dev-python/python-dateutil-2.5.3[${PYTHON_USEDEP}] |
219 |
- >=dev-python/PyQt5-5.8[gui,svg,webkit,widgets,network,printsupport,${PYTHON_USEDEP}] |
220 |
- dev-python/regex[${PYTHON_USEDEP}] |
221 |
- dev-qt/qtcore:5= |
222 |
- dev-qt/qtdbus:5= |
223 |
- dev-qt/qtgui:5= |
224 |
- dev-qt/qtwidgets:5= |
225 |
- dev-util/desktop-file-utils |
226 |
- dev-util/gtk-update-icon-cache |
227 |
- media-fonts/liberation-fonts |
228 |
- media-libs/fontconfig:= |
229 |
- >=media-libs/freetype-2:= |
230 |
- >=media-libs/libmtp-1.1.11:= |
231 |
- >=media-libs/libwmf-0.2.8 |
232 |
- >=media-gfx/optipng-0.7.6 |
233 |
- sys-libs/zlib:= |
234 |
- virtual/libusb:1= |
235 |
- virtual/python-dnspython[${PYTHON_USEDEP}] |
236 |
- x11-libs/libxkbcommon:= |
237 |
- x11-libs/libX11:= |
238 |
- x11-libs/libXext:= |
239 |
- x11-libs/libXrender:= |
240 |
- x11-misc/shared-mime-info |
241 |
- >=x11-misc/xdg-utils-1.0.2-r2 |
242 |
- ios? ( |
243 |
- >=app-pda/usbmuxd-1.0.8 |
244 |
- >=app-pda/libimobiledevice-1.2.0 |
245 |
- ) |
246 |
- udisks? ( virtual/libudev )" |
247 |
-RDEPEND="${COMMON_DEPEND} |
248 |
- udisks? ( || ( sys-fs/udisks:2 sys-fs/udisks:0 ) )" |
249 |
-DEPEND="${COMMON_DEPEND} |
250 |
- >=dev-python/setuptools-23.1.0[${PYTHON_USEDEP}] |
251 |
- >=virtual/podofo-build-0.9.4 |
252 |
- virtual/pkgconfig" |
253 |
- |
254 |
-pkg_pretend() { |
255 |
- if [[ ${MERGE_TYPE} != binary && $(gcc-major-version) -lt 6 ]]; then |
256 |
- eerror "Calibre cannot be built with this version of gcc." |
257 |
- eerror "You need at least gcc-6.0" |
258 |
- die "Your C compiler is too old for this package." |
259 |
- fi |
260 |
-} |
261 |
- |
262 |
-src_prepare() { |
263 |
- # no_updates: do not annoy user with "new version is availible all the time |
264 |
- # disable_plugins: walking sec-hole, wait for upstream to use GHNS interface |
265 |
- eapply \ |
266 |
- "${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \ |
267 |
- "${FILESDIR}/${PN}-disable_plugins.patch" |
268 |
- |
269 |
- eapply_user |
270 |
- |
271 |
- # Fix outdated version constant. |
272 |
- #sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \ |
273 |
- # -i src/calibre/constants.py || \ |
274 |
- # die "sed failed to patch constants.py" |
275 |
- |
276 |
- # Avoid sandbox violation in /usr/share/gnome/apps when linux.py |
277 |
- # calls xdg-* (bug #258938). |
278 |
- sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \ |
279 |
- -e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \ |
280 |
- -e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \ |
281 |
- -e "s|, PreserveMIMEDefaults():|:|" \ |
282 |
- -e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \ |
283 |
- -e "s|cmd\[2\]|cmd[4]|" \ |
284 |
- -e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \ |
285 |
- -e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \ |
286 |
- -i src/calibre/linux.py || die "sed failed to patch linux.py" |
287 |
- |
288 |
- # Disable unnecessary privilege dropping for bug #287067. |
289 |
- sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \ |
290 |
- -i setup/install.py || die "sed failed to patch install.py" |
291 |
- |
292 |
- sed -e "/^ self.check_call(\\[QMAKE\\] + qmc + \\[proname\\])$/a\ |
293 |
-\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \ |
294 |
-'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \ |
295 |
-'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \ |
296 |
-'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \ |
297 |
-'-i', 'Makefile'])" \ |
298 |
- -i setup/build.py || die "sed failed to patch build.py" |
299 |
- |
300 |
- # use system beautifulsoup, instead of bundled |
301 |
- rm -f "${S}"/src/calibre/ebooks/BeautifulSoup.py \ |
302 |
- || die "could not remove bundled beautifulsoup" |
303 |
- find "${S}" -type f -name \*.py -exec \ |
304 |
- sed -e 's/calibre.ebooks.BeautifulSoup/BeautifulSoup/' -i {} + \ |
305 |
- || die "could not sed bundled beautifulsoup out of the source tree" |
306 |
- |
307 |
- # avoid failure of xdg tools to recognize vendor prefix |
308 |
- sed -e "s|xdg-icon-resource install|xdg-icon-resource install --novendor|" \ |
309 |
- -e "s|'xdg-mime', 'install'|'xdg-mime', 'install', '--novendor'|" \ |
310 |
- -e "s|'xdg-desktop-menu', 'install'|'xdg-desktop-menu', 'install', '--novendor'|" \ |
311 |
- -i "${S}"/src/calibre/linux.py || die 'sed failed' |
312 |
- |
313 |
- # don't create/install uninstaller |
314 |
- sed '/self\.create_uninstaller()/d' -i src/calibre/linux.py || die |
315 |
-} |
316 |
- |
317 |
-src_install() { |
318 |
- # Bypass kbuildsycoca and update-mime-database in order to |
319 |
- # avoid sandbox violations if xdg-mime tries to call them. |
320 |
- cat - > "${T}/kbuildsycoca" <<-EOF |
321 |
- #!${BASH} |
322 |
- echo $0 : $@ |
323 |
- exit 0 |
324 |
- EOF |
325 |
- |
326 |
- cp "${T}"/{kbuildsycoca,update-mime-database} || die |
327 |
- chmod +x "${T}"/{kbuildsycoca,update-mime-database} || die |
328 |
- |
329 |
- export QMAKE="${EPREFIX}/usr/$(get_libdir)/qt5/bin/qmake" |
330 |
- |
331 |
- # Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox |
332 |
- # violation with kbuildsycoca as in bug #287067, comment #13. |
333 |
- export -n DISPLAY |
334 |
- |
335 |
- # Bug #352625 - Some LANGUAGE values can trigger the following ValueError: |
336 |
- # File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale |
337 |
- # return _parse_localename(localename) |
338 |
- # File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename |
339 |
- # raise ValueError, 'unknown locale: %s' % localename |
340 |
- #ValueError: unknown locale: 46 |
341 |
- export -n LANGUAGE |
342 |
- |
343 |
- # Bug #295672 - Avoid sandbox violation in ~/.config by forcing |
344 |
- # variables to point to our fake temporary $HOME. |
345 |
- export HOME="${T}/fake_homedir" |
346 |
- export XDG_CONFIG_HOME="${HOME}/.config" |
347 |
- export XDG_DATA_HOME="${HOME}/.local/share" |
348 |
- export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre" |
349 |
- mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die |
350 |
- |
351 |
- tc-export CC CXX |
352 |
- # Bug #334243 - respect LDFLAGS when building extensions |
353 |
- export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS" |
354 |
- local libdir=$(get_libdir) |
355 |
- [[ -n $libdir ]] || die "get_libdir returned an empty string" |
356 |
- |
357 |
- # Bug #472690 - Avoid sandbox violation for /dev/dri/card0. |
358 |
- local x |
359 |
- for x in /dev/dri/card[0-9] ; do |
360 |
- [[ -e ${x} ]] && addpredict ${x} |
361 |
- done |
362 |
- |
363 |
- #dodir "/usr/$(get_libdir)/python2.7/site-packages" # for init_calibre.py |
364 |
- #dodir $(python_get_sitedir) |
365 |
- PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \ |
366 |
- "${PYTHON}" setup.py install \ |
367 |
- --root="${D}" \ |
368 |
- --prefix="${EPREFIX}/usr" \ |
369 |
- --libdir="${EPREFIX}/usr/${libdir}" \ |
370 |
- --staging-root="${ED}usr" \ |
371 |
- --staging-libdir="${ED}usr/${libdir}" || die |
372 |
- |
373 |
- # The menu entries end up here due to '--mode user' being added to |
374 |
- # xdg-* options in src_prepare. |
375 |
- dodir /usr/share/mime/packages |
376 |
- chmod -fR a+rX,u+w,g-w,o-w "${HOME}"/.local |
377 |
- mv "${HOME}"/.local/share/mime/packages/* "${ED}"usr/share/mime/packages/ || |
378 |
- die "failed to register mime types" |
379 |
- dodir /usr/share/icons |
380 |
- mv "${HOME}"/.local/share/icons/* "${ED}"usr/share/icons/ || |
381 |
- die "failed to install icon files" |
382 |
- |
383 |
- domenu "${HOME}"/.local/share/applications/*.desktop || |
384 |
- die "failed to install .desktop menu files" |
385 |
- |
386 |
- find "${ED}"usr/share -type d -empty -delete |
387 |
- |
388 |
- cd "${ED}"/usr/share/calibre/fonts/liberation || die |
389 |
- local x |
390 |
- for x in * ; do |
391 |
- [[ -f ${EPREFIX}usr/share/fonts/liberation-fonts/${x} ]] || continue |
392 |
- ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die |
393 |
- done |
394 |
- |
395 |
- einfo "Converting python shebangs" |
396 |
- python_fix_shebang "${ED}" |
397 |
- |
398 |
- einfo "Compiling python modules" |
399 |
- python_optimize "${ED}"usr/lib/calibre |
400 |
- |
401 |
- newinitd "${FILESDIR}"/calibre-server-3.init calibre-server |
402 |
- newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server |
403 |
- |
404 |
- bashcomp_alias calibre \ |
405 |
- lrfviewer \ |
406 |
- calibre-debug \ |
407 |
- ebook-meta \ |
408 |
- calibre-server \ |
409 |
- ebook-viewer \ |
410 |
- ebook-polish \ |
411 |
- fetch-ebook-metadata \ |
412 |
- lrf2lrs \ |
413 |
- ebook-convert \ |
414 |
- ebook-edit \ |
415 |
- calibre-smtp \ |
416 |
- ebook-device |
417 |
- |
418 |
-} |
419 |
- |
420 |
-pkg_preinst() { |
421 |
- gnome2_icon_savelist |
422 |
- # Indentify stray directories from upstream's "Binary install" |
423 |
- # method (see bug 622728). |
424 |
- CALIBRE_LIB_DIR=/usr/$(get_libdir)/calibre |
425 |
- CALIBRE_LIB_CONTENT=$(for x in "${ED%/}${CALIBRE_LIB_DIR}"/*; do |
426 |
- printf -- "${x##*/} "; done) || die "Failed to list ${ED%/}${CALIBRE_LIB_DIR}" |
427 |
-} |
428 |
- |
429 |
-pkg_postinst() { |
430 |
- [[ -n ${CALIBRE_LIB_DIR} ]] || die "CALIBRE_LIB_DIR is unset" |
431 |
- local x |
432 |
- for x in "${EROOT%/}${CALIBRE_LIB_DIR}"/*; do |
433 |
- if [[ " ${CALIBRE_LIB_CONTENT} " != *" ${x##*/} "* ]]; then |
434 |
- elog "Purging '${x}'" |
435 |
- rm -rf "${x}" |
436 |
- fi |
437 |
- done |
438 |
- xdg_desktop_database_update |
439 |
- xdg_mimeinfo_database_update |
440 |
- gnome2_icon_cache_update |
441 |
-} |
442 |
- |
443 |
-pkg_postrm() { |
444 |
- xdg_desktop_database_update |
445 |
- xdg_mimeinfo_database_update |
446 |
- gnome2_icon_cache_update |
447 |
-} |
448 |
|
449 |
diff --git a/app-text/calibre/files/calibre-2.83.0-lzxd-bounds-error-bug-540596.patch b/app-text/calibre/files/calibre-2.83.0-lzxd-bounds-error-bug-540596.patch |
450 |
deleted file mode 100644 |
451 |
index 5f7d5a4..0000000 |
452 |
--- a/app-text/calibre/files/calibre-2.83.0-lzxd-bounds-error-bug-540596.patch |
453 |
+++ /dev/null |
454 |
@@ -1,37 +0,0 @@ |
455 |
-From f335c8719b224d3ca7a967b6e91cebd5b26684fe Mon Sep 17 00:00:00 2001 |
456 |
-From: Zac Medico <zmedico@g.o> |
457 |
-Date: Sun, 23 Apr 2017 16:13:00 -0700 |
458 |
-Subject: [PATCH] Fix bounds error in lzxd_static_init |
459 |
- |
460 |
-https://bugs.gentoo.org/show_bug.cgi?id=540596 |
461 |
-https://github.com/kovidgoyal/calibre/pull/650 |
462 |
- |
463 |
-This includes the changes from the following upstream commits: |
464 |
- |
465 |
-https://github.com/kyz/libmspack/commit/6a42ddd1d472afeaf0f7da91e16b60ab2063fb92 |
466 |
-https://github.com/kyz/libmspack/commit/ce3cc03aa500dd9c0b6b820f9519f6b6b9dede05 |
467 |
---- |
468 |
- src/calibre/utils/lzx/lzxd.c | 3 ++- |
469 |
- 1 file changed, 2 insertions(+), 1 deletion(-) |
470 |
- |
471 |
-diff --git a/src/calibre/utils/lzx/lzxd.c b/src/calibre/utils/lzx/lzxd.c |
472 |
-index e683a9e..c531aaa 100644 |
473 |
---- a/src/calibre/utils/lzx/lzxd.c |
474 |
-+++ b/src/calibre/utils/lzx/lzxd.c |
475 |
-@@ -357,11 +357,12 @@ static unsigned char extra_bits[51]; |
476 |
- static void lzxd_static_init(void) { |
477 |
- int i, j; |
478 |
- |
479 |
-- for (i = 0, j = 0; i < 51; i += 2) { |
480 |
-+ for (i = 0, j = 0; i < 50; i += 2) { |
481 |
- extra_bits[i] = j; /* 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7... */ |
482 |
- extra_bits[i+1] = j; |
483 |
- if ((i != 0) && (j < 17)) j++; /* 0,0,1,2,3,4...15,16,17,17,17,17... */ |
484 |
- } |
485 |
-+ extra_bits[50] = 17; |
486 |
- |
487 |
- for (i = 0, j = 0; i < 51; i++) { |
488 |
- position_base[i] = j; /* 0,1,2,3,4,6,8,12,16,24,32,... */ |
489 |
--- |
490 |
-2.10.2 |
491 |
- |
492 |
|
493 |
diff --git a/app-text/calibre/files/calibre-2.9.0-no_updates_dialog.patch b/app-text/calibre/files/calibre-2.9.0-no_updates_dialog.patch |
494 |
deleted file mode 100644 |
495 |
index 4d37c3b..0000000 |
496 |
--- a/app-text/calibre/files/calibre-2.9.0-no_updates_dialog.patch |
497 |
+++ /dev/null |
498 |
@@ -1,27 +0,0 @@ |
499 |
-diff -burN calibre-2.9.0.orig/src/calibre/gui2/main.py calibre-2.9.0/src/calibre/gui2/main.py |
500 |
---- calibre-2.9.0.orig/src/calibre/gui2/main.py 2014-11-09 20:09:54.081231882 +0800 |
501 |
-+++ calibre-2.9.0/src/calibre/gui2/main.py 2014-11-09 20:15:48.193033844 +0800 |
502 |
-@@ -37,8 +37,9 @@ |
503 |
- help=_('Start minimized to system tray.')) |
504 |
- parser.add_option('-v', '--verbose', default=0, action='count', |
505 |
- help=_('Ignored, do not use. Present only for legacy reasons')) |
506 |
-- parser.add_option('--no-update-check', default=False, action='store_true', |
507 |
-- help=_('Do not check for updates')) |
508 |
-+ parser.add_option('--update-check', dest='no_update_check', default=True, |
509 |
-+ action='store_false', |
510 |
-+ help=_('Check for updates')) |
511 |
- parser.add_option('--ignore-plugins', default=False, action='store_true', |
512 |
- help=_('Ignore custom plugins, useful if you installed a plugin' |
513 |
- ' that is preventing calibre from starting')) |
514 |
-diff -burN calibre-2.9.0.orig/src/calibre/gui2/update.py calibre-2.9.0/src/calibre/gui2/update.py |
515 |
---- calibre-2.9.0.orig/src/calibre/gui2/update.py 2014-11-09 20:09:54.082231864 +0800 |
516 |
-+++ calibre-2.9.0/src/calibre/gui2/update.py 2014-11-09 20:17:49.954767115 +0800 |
517 |
-@@ -154,6 +154,8 @@ |
518 |
- self.update_checker.signal.update_found.connect(self.update_found, |
519 |
- type=Qt.QueuedConnection) |
520 |
- self.update_checker.start() |
521 |
-+ else: |
522 |
-+ self.update_checker = None |
523 |
- |
524 |
- def recalc_update_label(self, number_of_plugin_updates): |
525 |
- self.update_found(self.last_newest_calibre_version, number_of_plugin_updates) |
526 |
|
527 |
diff --git a/app-text/calibre/files/calibre-disable_plugins.patch b/app-text/calibre/files/calibre-disable_plugins.patch |
528 |
deleted file mode 100644 |
529 |
index 9ef1dd0..0000000 |
530 |
--- a/app-text/calibre/files/calibre-disable_plugins.patch |
531 |
+++ /dev/null |
532 |
@@ -1,17 +0,0 @@ |
533 |
-Description: Disable plugin dialog. It uses a totally non-authenticated and non-trusted way of installing arbitrary code. |
534 |
-Author: Martin Pitt <mpitt@××××××.org> |
535 |
-Bug-Debian: http://bugs.debian.org/640026 |
536 |
- |
537 |
-Index: calibre-0.8.29+dfsg/src/calibre/gui2/actions/preferences.py |
538 |
-=================================================================== |
539 |
---- calibre-0.8.29+dfsg.orig/src/calibre/gui2/actions/preferences.py 2011-12-16 05:49:14.000000000 +0100 |
540 |
-+++ calibre-0.8.29+dfsg/src/calibre/gui2/actions/preferences.py 2011-12-20 19:29:04.798468930 +0100 |
541 |
-@@ -28,8 +28,6 @@ |
542 |
- pm.addAction(QIcon(I('config.png')), _('Preferences'), self.do_config) |
543 |
- cm('welcome wizard', _('Run welcome wizard'), |
544 |
- icon='wizard.png', triggered=self.gui.run_wizard) |
545 |
-- cm('plugin updater', _('Get plugins to enhance calibre'), |
546 |
-- icon='plugins/plugin_updater.png', triggered=self.get_plugins) |
547 |
- if not DEBUG: |
548 |
- pm.addSeparator() |
549 |
- cm('restart', _('Restart in debug mode'), icon='debug.png', |
550 |
|
551 |
diff --git a/app-text/calibre/files/calibre-server-3.conf b/app-text/calibre/files/calibre-server-3.conf |
552 |
deleted file mode 100644 |
553 |
index bb456e8..0000000 |
554 |
--- a/app-text/calibre/files/calibre-server-3.conf |
555 |
+++ /dev/null |
556 |
@@ -1,13 +0,0 @@ |
557 |
-# /etc/conf.d/calibre-server |
558 |
-# Change this to the user you want to run calibre-server as. |
559 |
-# You may specify a group too, after a colon |
560 |
-# NOTE: This must be set and not to root! |
561 |
-CALIBRE_USER= |
562 |
- |
563 |
-# Set the path of the library to serve. |
564 |
-# Defaults to the default location for CALIBRE_USER. |
565 |
-#CALIBRE_LIBRARY='<user home directory>/Calibre Library' |
566 |
- |
567 |
-# Extra options to pass to calibre-server. |
568 |
-# See the calibre-server man page for more options. |
569 |
-#CALIBRE_SERVER_OPTS="--userdb /srv/calibre/users.sqlite --enable-auth --worker-count 10 --port 8080" |
570 |
|
571 |
diff --git a/app-text/calibre/files/calibre-server-3.init b/app-text/calibre/files/calibre-server-3.init |
572 |
deleted file mode 100644 |
573 |
index 049d3e4..0000000 |
574 |
--- a/app-text/calibre/files/calibre-server-3.init |
575 |
+++ /dev/null |
576 |
@@ -1,58 +0,0 @@ |
577 |
-#!/sbin/openrc-run |
578 |
-# Copyright 1999-2012 Gentoo Foundation |
579 |
-# Distributed under the terms of the GNU General Public License, v2 or later |
580 |
- |
581 |
-depend() { |
582 |
- need net |
583 |
- need localmount |
584 |
- after bootmisc |
585 |
-} |
586 |
- |
587 |
-checkconfig() { |
588 |
- if [ "${CALIBRE_USER}" = "" -o "${CALIBRE_USER}" = "root" ] ; then |
589 |
- eerror "Please edit /etc/conf.d/calibre-server" |
590 |
- eerror "You have to specify a user to run calibre-server as, as we will not run it as root!" |
591 |
- eerror "Modify CALIBRE_USER to your needs (you can also add a group, after a colon)" |
592 |
- return 1 |
593 |
- fi |
594 |
- if ! getent passwd "${CALIBRE_USER%:*}" >/dev/null ; then |
595 |
- eerror "Please edit /etc/conf.d/calibre-server" |
596 |
- eerror "Your user has to exist!" |
597 |
- return 1 |
598 |
- fi |
599 |
- if [ "${CALIBRE_USER%:*}" != "${CALIBRE_USER}" ] ; then |
600 |
- if ! getent group "${CALIBRE_USER#*:}" >/dev/null ; then |
601 |
- eerror "Please edit /etc/conf.d/calibre-server" |
602 |
- eerror "Your group has to exist too!" |
603 |
- return 1 |
604 |
- fi |
605 |
- fi |
606 |
- if [ "${CALIBRE_LIBRARY}" = "" ] ; then |
607 |
- CALIBRE_USER_HOME=$(getent passwd "${CALIBRE_USER%:*}" | cut -d ':' -f 6) |
608 |
- CALIBRE_LIBRARY="${CALIBRE_USER_HOME}/Calibre Library" |
609 |
- fi |
610 |
- if [ ! -d "${CALIBRE_LIBRARY}" ] ; then |
611 |
- eerror "Please edit /etc/conf.d/calibre-server" |
612 |
- eerror "The Calibre library, '${CALIBRE_LIBRARY},' does not exist." |
613 |
- eerror "Please modify CALIBRE_LIBRARY to point to a valid library." |
614 |
- return 1 |
615 |
- fi |
616 |
- return 0 |
617 |
-} |
618 |
- |
619 |
-start() { |
620 |
- checkconfig || return $? |
621 |
- local pidfile=/var/run/calibre-server.pid |
622 |
- ebegin "Starting calibre-server" |
623 |
- start-stop-daemon --user "${CALIBRE_USER}" \ |
624 |
- --pidfile "${pidfile}" --make-pidfile --background --exec /usr/bin/calibre-server \ |
625 |
- -- ${CALIBRE_OPTS} "${CALIBRE_LIBRARY}" |
626 |
- eend $? |
627 |
-} |
628 |
- |
629 |
-stop() { |
630 |
- ebegin "Stopping calibre-server" |
631 |
- start-stop-daemon --stop --user "${CALIBRE_USER}" \ |
632 |
- --pidfile /var/run/calibre-server.pid |
633 |
- eend $? |
634 |
-} |
635 |
|
636 |
diff --git a/app-text/calibre/files/calibre-server.conf b/app-text/calibre/files/calibre-server.conf |
637 |
deleted file mode 100644 |
638 |
index c1bed84..0000000 |
639 |
--- a/app-text/calibre/files/calibre-server.conf |
640 |
+++ /dev/null |
641 |
@@ -1,13 +0,0 @@ |
642 |
-# /etc/conf.d/calibre-server |
643 |
-# Change this to the user you want to run calibre-server as. |
644 |
-# You may specify a group too, after a colon |
645 |
-# NOTE: This must be set and not to root! |
646 |
-CALIBRE_USER= |
647 |
- |
648 |
-# Set the path of the library to serve. |
649 |
-# Defaults to the default location for CALIBRE_USER. |
650 |
-#CALIBRE_LIBRARY='<user home directory>/Calibre Library' |
651 |
- |
652 |
-# Extra options to pass to calibre-server. |
653 |
-# See the calibre-server man page for more options. |
654 |
-#CALIBRE_OPTS="--username calibre --password password --thread-pool 10 --port 8080" |
655 |
|
656 |
diff --git a/app-text/calibre/files/calibre-server.init b/app-text/calibre/files/calibre-server.init |
657 |
deleted file mode 100644 |
658 |
index 2f90542..0000000 |
659 |
--- a/app-text/calibre/files/calibre-server.init |
660 |
+++ /dev/null |
661 |
@@ -1,58 +0,0 @@ |
662 |
-#!/sbin/openrc-run |
663 |
-# Copyright 1999-2012 Gentoo Foundation |
664 |
-# Distributed under the terms of the GNU General Public License, v2 or later |
665 |
- |
666 |
-depend() { |
667 |
- need net |
668 |
- need localmount |
669 |
- after bootmisc |
670 |
-} |
671 |
- |
672 |
-checkconfig() { |
673 |
- if [ "${CALIBRE_USER}" = "" -o "${CALIBRE_USER}" = "root" ] ; then |
674 |
- eerror "Please edit /etc/conf.d/calibre-server" |
675 |
- eerror "You have to specify a user to run calibre-server as, as we will not run it as root!" |
676 |
- eerror "Modify CALIBRE_USER to your needs (you can also add a group, after a colon)" |
677 |
- return 1 |
678 |
- fi |
679 |
- if ! getent passwd "${CALIBRE_USER%:*}" >/dev/null ; then |
680 |
- eerror "Please edit /etc/conf.d/calibre-server" |
681 |
- eerror "Your user has to exist!" |
682 |
- return 1 |
683 |
- fi |
684 |
- if [ "${CALIBRE_USER%:*}" != "${CALIBRE_USER}" ] ; then |
685 |
- if ! getent group "${CALIBRE_USER#*:}" >/dev/null ; then |
686 |
- eerror "Please edit /etc/conf.d/calibre-server" |
687 |
- eerror "Your group has to exist too!" |
688 |
- return 1 |
689 |
- fi |
690 |
- fi |
691 |
- if [ "${CALIBRE_LIBRARY}" = "" ] ; then |
692 |
- CALIBRE_USER_HOME=$(getent passwd "${CALIBRE_USER%:*}" | cut -d ':' -f 6) |
693 |
- CALIBRE_LIBRARY="${CALIBRE_USER_HOME}/Calibre Library" |
694 |
- fi |
695 |
- if [ ! -d "${CALIBRE_LIBRARY}" ] ; then |
696 |
- eerror "Please edit /etc/conf.d/calibre-server" |
697 |
- eerror "The Calibre library, '${CALIBRE_LIBRARY},' does not exist." |
698 |
- eerror "Please modify CALIBRE_LIBRARY to point to a valid library." |
699 |
- return 1 |
700 |
- fi |
701 |
- return 0 |
702 |
-} |
703 |
- |
704 |
-start() { |
705 |
- checkconfig || return $? |
706 |
- local pidfile=/var/run/calibre-server.pid |
707 |
- ebegin "Starting calibre-server" |
708 |
- start-stop-daemon --user "${CALIBRE_USER}" \ |
709 |
- --pidfile "${pidfile}" --make-pidfile --background --exec /usr/bin/calibre-server \ |
710 |
- -- --with-library "${CALIBRE_LIBRARY}" ${CALIBRE_OPTS} |
711 |
- eend $? |
712 |
-} |
713 |
- |
714 |
-stop() { |
715 |
- ebegin "Stopping calibre-server" |
716 |
- start-stop-daemon --stop --user "${CALIBRE_USER}" \ |
717 |
- --pidfile /var/run/calibre-server.pid |
718 |
- eend $? |
719 |
-} |
720 |
|
721 |
diff --git a/app-text/calibre/metadata.xml b/app-text/calibre/metadata.xml |
722 |
deleted file mode 100644 |
723 |
index 2196cbe..0000000 |
724 |
--- a/app-text/calibre/metadata.xml |
725 |
+++ /dev/null |
726 |
@@ -1,13 +0,0 @@ |
727 |
-<?xml version="1.0" encoding="UTF-8"?> |
728 |
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
729 |
-<pkgmetadata> |
730 |
- <maintainer type="person"> |
731 |
- <email>axs@g.o</email> |
732 |
- </maintainer> |
733 |
- <maintainer type="person"> |
734 |
- <email>zmedico@g.o</email> |
735 |
- </maintainer> |
736 |
- <upstream> |
737 |
- <remote-id type="sourceforge">calibre</remote-id> |
738 |
- </upstream> |
739 |
-</pkgmetadata> |
740 |
|
741 |
diff --git a/dev-libs/jansson/Manifest b/dev-libs/jansson/Manifest |
742 |
deleted file mode 100644 |
743 |
index 3d7001f..0000000 |
744 |
--- a/dev-libs/jansson/Manifest |
745 |
+++ /dev/null |
746 |
@@ -1,2 +0,0 @@ |
747 |
-DIST jansson-2.7.tar.gz 445179 SHA256 7905e6590fb316c0ff943df3dc6a21cd81a59cff7a6d12514054c359d04d78d7 SHA512 657b715868c2fbf8da1e41befee2691524190e12255214c472652ca3e3793b03e2b384dc3aedb1071b67b0b8cb57fd495103979983fe21a2404f12cd70295a28 WHIRLPOOL 684c0a1cae8cbd86d1a4e19bcfa59f36bf6094853ce5e18bd600fcb27fb1afac250e52c1983f888fcae06437c6e142b2ea3823c911b5a2923f4775494d26690f |
748 |
-EBUILD jansson-2.7-r1.ebuild 837 SHA256 5d71796b6f00ffe4532fdaae0808b7fb49a8caa74715fcc5256f865b6e4e146c SHA512 3c4d40da0f539d4f3b09df9fa1a33ca5e228226c4e3ba11057e89f58874e13cdb4a2140275e5107ca539909d5f900a29f62113f400f45ee16d84ea94e2923822 WHIRLPOOL 6813b9169c0096bf4ddbdd6d16165622e1fd6266263ba0aed3b4676ce51bc153e98bdad7e20b7fca597c8ab9848aeee38ba4baa2654c10b2c68c441b2e841d07 |
749 |
|
750 |
diff --git a/dev-libs/jansson/jansson-2.7-r1.ebuild b/dev-libs/jansson/jansson-2.7-r1.ebuild |
751 |
deleted file mode 100644 |
752 |
index 1b6d049..0000000 |
753 |
--- a/dev-libs/jansson/jansson-2.7-r1.ebuild |
754 |
+++ /dev/null |
755 |
@@ -1,38 +0,0 @@ |
756 |
-# Copyright 1999-2015 Gentoo Foundation |
757 |
-# Distributed under the terms of the GNU General Public License v2 |
758 |
-# $Id$ |
759 |
- |
760 |
-EAPI="5" |
761 |
-AUTOTOOLS_AUTORECONF=1 |
762 |
- |
763 |
-inherit autotools-multilib |
764 |
- |
765 |
-DESCRIPTION="C library for encoding, decoding and manipulating JSON data" |
766 |
-HOMEPAGE="http://www.digip.org/jansson/" |
767 |
-SRC_URI="http://www.digip.org/jansson/releases/${P}.tar.gz" |
768 |
- |
769 |
-LICENSE="MIT" |
770 |
-SLOT="0" |
771 |
-KEYWORDS="~amd64 ~x86" |
772 |
-IUSE="doc static-libs" |
773 |
- |
774 |
-DEPEND="doc? ( >=dev-python/sphinx-1.0.4 )" |
775 |
-RDEPEND="" |
776 |
- |
777 |
-DOCS=(CHANGES README.rst) |
778 |
- |
779 |
-multilib_src_prepare() { |
780 |
- sed -ie 's/-Werror//' src/Makefile.am || die |
781 |
- autotools-utils_src_prepare |
782 |
-} |
783 |
- |
784 |
-multilib_src_compile() { |
785 |
- autotools-utils_src_compile |
786 |
- |
787 |
- use doc && autotools-utils_src_compile html |
788 |
-} |
789 |
- |
790 |
-multilib_src_install_all() { |
791 |
- use doc && HTML_DOCS=("${AUTOTOOLS_BUILD_DIR}/doc/_build/html/") |
792 |
- autotools-utils_src_install |
793 |
-} |
794 |
|
795 |
diff --git a/dev-python/PyPDF2/ChangeLog b/dev-python/PyPDF2/ChangeLog |
796 |
deleted file mode 100644 |
797 |
index 196c6f7..0000000 |
798 |
--- a/dev-python/PyPDF2/ChangeLog |
799 |
+++ /dev/null |
800 |
@@ -1,108 +0,0 @@ |
801 |
-# ChangeLog for dev-python/PyPDF2 |
802 |
-# Copyright 1999-2016 Gentoo Foundation; Distributed under the GPL v2 |
803 |
-# (auto-generated from git log) |
804 |
- |
805 |
-*PyPDF2-1.24 (09 Aug 2015) |
806 |
- |
807 |
- 09 Aug 2015; Robin H. Johnson <robbat2@g.o> +PyPDF2-1.24.ebuild, |
808 |
- +metadata.xml: |
809 |
- proj/gentoo: Initial commit |
810 |
- |
811 |
- This commit represents a new era for Gentoo: |
812 |
- Storing the gentoo-x86 tree in Git, as converted from CVS. |
813 |
- |
814 |
- This commit is the start of the NEW history. |
815 |
- Any historical data is intended to be grafted onto this point. |
816 |
- |
817 |
- Creation process: |
818 |
- 1. Take final CVS checkout snapshot |
819 |
- 2. Remove ALL ChangeLog* files |
820 |
- 3. Transform all Manifests to thin |
821 |
- 4. Remove empty Manifests |
822 |
- 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ |
823 |
- 5.1. Do not touch files with -kb/-ko keyword flags. |
824 |
- |
825 |
- Signed-off-by: Robin H. Johnson <robbat2@g.o> |
826 |
- X-Thanks: Alec Warner <antarus@g.o> - did the GSoC 2006 migration |
827 |
- tests |
828 |
- X-Thanks: Robin H. Johnson <robbat2@g.o> - infra guy, herding this |
829 |
- project |
830 |
- X-Thanks: Nguyen Thai Ngoc Duy <pclouds@g.o> - Former Gentoo |
831 |
- developer, wrote Git features for the migration |
832 |
- X-Thanks: Brian Harring <ferringb@g.o> - wrote much python to improve |
833 |
- cvs2svn |
834 |
- X-Thanks: Rich Freeman <rich0@g.o> - validation scripts |
835 |
- X-Thanks: Patrick Lauer <patrick@g.o> - Gentoo dev, running new 2014 |
836 |
- work in migration |
837 |
- X-Thanks: Michał Górny <mgorny@g.o> - scripts, QA, nagging |
838 |
- X-Thanks: All of other Gentoo developers - many ideas and lots of paint on |
839 |
- the bikeshed |
840 |
- |
841 |
-*PyPDF2-1.25.1 (16 Aug 2015) |
842 |
- |
843 |
- 16 Aug 2015; Ian Delaney <idella4@g.o> +PyPDF2-1.25.1.ebuild: |
844 |
- bump |
845 |
- |
846 |
- Package-Manager: portage-2.2.20 |
847 |
- |
848 |
- 18 Aug 2015; Justin Lecher <jlec@g.o> metadata.xml: |
849 |
- Add missing remote-id entries to metadata.xml |
850 |
- |
851 |
- Signed-off-by: Justin Lecher <jlec@g.o> |
852 |
- |
853 |
- 21 Aug 2015; Ian Delaney <idella4@g.o> PyPDF2-1.25.1.ebuild: |
854 |
- Unrestrict test phase in response to reply from upstream |
855 |
- |
856 |
- Package-Manager: portage-2.2.20 |
857 |
- |
858 |
- 21 Aug 2015; Ian Delaney <idella4@g.o> PyPDF2-1.25.1.ebuild: |
859 |
- remove witespace |
860 |
- |
861 |
- Package-Manager: portage-2.2.20 |
862 |
- |
863 |
- 24 Aug 2015; Justin Lecher <jlec@g.o> PyPDF2-1.24.ebuild, |
864 |
- PyPDF2-1.25.1.ebuild: |
865 |
- Use https by default |
866 |
- |
867 |
- Signed-off-by: Justin Lecher <jlec@g.o> |
868 |
- |
869 |
- 24 Aug 2015; Justin Lecher <jlec@g.o> metadata.xml: |
870 |
- Use https by default |
871 |
- |
872 |
- Convert all URLs for sites supporting encrypted connections from http to |
873 |
- https |
874 |
- |
875 |
- Signed-off-by: Justin Lecher <jlec@g.o> |
876 |
- |
877 |
- 24 Aug 2015; Justin Lecher <jlec@g.o> PyPDF2-1.24.ebuild: |
878 |
- Use https by default |
879 |
- |
880 |
- Convert all URLs for sites supporting encrypted connections from http to |
881 |
- https |
882 |
- |
883 |
- Signed-off-by: Justin Lecher <jlec@g.o> |
884 |
- |
885 |
- 24 Aug 2015; Mike Gilbert <floppym@g.o> metadata.xml: |
886 |
- Revert DOCTYPE SYSTEM https changes in metadata.xml |
887 |
- |
888 |
- repoman does not yet accept the https version. |
889 |
- This partially reverts eaaface92ee81f30a6ac66fe7acbcc42c00dc450. |
890 |
- |
891 |
- Bug: https://bugs.gentoo.org/552720 |
892 |
- |
893 |
- 15 Sep 2015; Justin Lecher <jlec@g.o> PyPDF2-1.25.1.ebuild: |
894 |
- Fix Malformed Id header on line: 3 |
895 |
- |
896 |
- Convert Header to Id |
897 |
- |
898 |
- Signed-off-by: Justin Lecher <jlec@g.o> |
899 |
- |
900 |
- 24 Jan 2016; Michał Górny <mgorny@g.o> metadata.xml: |
901 |
- Replace all herds with appropriate projects (GLEP 67) |
902 |
- |
903 |
- Replace all uses of herd with appropriate project maintainers, or no |
904 |
- maintainers in case of herds requested to be disbanded. |
905 |
- |
906 |
- 24 Jan 2016; Michał Górny <mgorny@g.o> metadata.xml: |
907 |
- Set appropriate maintainer types in metadata.xml (GLEP 67) |
908 |
- |
909 |
|
910 |
diff --git a/dev-python/PyPDF2/ChangeLog-2015 b/dev-python/PyPDF2/ChangeLog-2015 |
911 |
deleted file mode 100644 |
912 |
index e644b5c..0000000 |
913 |
--- a/dev-python/PyPDF2/ChangeLog-2015 |
914 |
+++ /dev/null |
915 |
@@ -1,21 +0,0 @@ |
916 |
-# ChangeLog for dev-python/PyPDF2 |
917 |
-# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 |
918 |
-# $Header: /var/cvsroot/gentoo-x86/dev-python/PyPDF2/ChangeLog,v 1.4 2015/06/03 21:05:27 jlec Exp $ |
919 |
- |
920 |
- 03 Jun 2015; Justin Lecher <jlec@g.o> metadata.xml: |
921 |
- Add pypi to remote-id in metadata.xml |
922 |
- |
923 |
- 08 Mar 2015; Pacho Ramos <pacho@g.o> PyPDF2-1.24.ebuild: |
924 |
- x86 stable, bug 540290 |
925 |
- |
926 |
- 06 Mar 2015; Pacho Ramos <pacho@g.o> PyPDF2-1.24.ebuild: |
927 |
- amd64 stable, bug 540290 |
928 |
- |
929 |
-*PyPDF2-1.24 (03 Jan 2015) |
930 |
- |
931 |
- 03 Jan 2015; Ian Delaney <idella4@g.o> +PyPDF2-1.24.ebuild, |
932 |
- +metadata.xml: |
933 |
- ebuild written by me, Jan 3. Required in the bump of xhtml2pdf-0.0.6 to |
934 |
- substitute dev-python/pyPdf, of which PyPDF2 is a fork. The original name |
935 |
- using camel case is retained since it poses no problem once installed. |
936 |
- Conversion to lowercase causes far more pain than it cures. |
937 |
|
938 |
diff --git a/dev-python/PyPDF2/Manifest b/dev-python/PyPDF2/Manifest |
939 |
deleted file mode 100644 |
940 |
index 167e93f..0000000 |
941 |
--- a/dev-python/PyPDF2/Manifest |
942 |
+++ /dev/null |
943 |
@@ -1,5 +0,0 @@ |
944 |
-DIST PyPDF2-1.26.0.tar.gz 77556 SHA256 e28f902f2f0a1603ea95ebe21dff311ef09be3d0f0ef29a3e44a932729564385 SHA512 7b427f1d099dcd687a718fb8d86e6f677ad45257414c6367e4dfacd8dfef7e3dbe3816027359868764981f36a30721f1731b4c23cbe2f35cfab1c64fb290b034 WHIRLPOOL 0f96818874f77bfef9d60e3bb84a648ec5366911fbb365d2e9ce965ef7321df845a85fede714e14dcb73e87d85bdc72af38ce40c2ed3ae096bd9daf07a7204b2 |
945 |
-EBUILD PyPDF2-1.26.0.ebuild 904 SHA256 310e413afc44462f67ae8479c14ab40306fb550a6d3fb67e970dd721b1f203e7 SHA512 fe4f3ce545b7ec607c99f60a7a32bed667a3361dd621f3ba9ab2b521c0ab3f8ee1515f4ecc6ca21514c602958155f2781ddb4c74e289381f88d3615fb159ef3a WHIRLPOOL dce5fd158c14ac5ee6dab2c5c8f287d65804459cde34135b892763de7f5978a1d35a5119223584dffc9fc6b62be18867d884625c753f1375d1c2d059b10bf6ad |
946 |
-MISC ChangeLog 3589 SHA256 94a11ba16031e82247de9e3aff96001a717f1fbe1776f535149745e1e62baea2 SHA512 836dac6d422b156de2deee6a28846c078158971ec9371d74cbbdcabd2848952429cc3c19b4db830d06609e2028a6c85d5ed6775a2ef963bc3b0eded201d9e3a6 WHIRLPOOL eae12ad954ed3da8d3216165615c18dbc661bf31ee6f7dbe4330887a9223b8af949e733306854da8c259c9d5b7550c4a89dd5dd1971806e6be44cd4302d3b9b2 |
947 |
-MISC ChangeLog-2015 893 SHA256 abf37acddf61c2bce90aaf24f15d9ef77b7661c590d1d6c9b5b38f12c1287ef8 SHA512 adbe760a519c675d59716ea91530a191f325c6a2fb251a545da03142f2a502b2bf9f05f764e9fd11c950636f69e480419c532ed2b3cfffdb9e55291612a5a949 WHIRLPOOL 3aff6f09178eb58194a2e08063b46a1cd4e560f7059b4f12260e62dec6eef4122462b4714fd509b31512444b9c577f1571ec3d8f2c52cb6ec64340c9a958752d |
948 |
-MISC metadata.xml 375 SHA256 58f6dbefe2ab40ebf233a8ef60f81403bff0d6727c8c01e083d1cf7577353359 SHA512 9da6355a60e212e6e5ee3ac1c5cd1c357b243ab3131b2f6d261a4039c6cbc67c1e375be8685c900c533a0273b017b6d4428c7521539b917a2c380f9435b3cefa WHIRLPOOL a46741f32910e9fb4d63648af45c2937d51d396c5afd917a507e02d3b31899adf9b02a8bdae54063230afad736f551df04e2d48ad8e79849ff4c3bd2ce6f86ee |
949 |
|
950 |
diff --git a/dev-python/PyPDF2/PyPDF2-1.26.0.ebuild b/dev-python/PyPDF2/PyPDF2-1.26.0.ebuild |
951 |
deleted file mode 100644 |
952 |
index b2940e0..0000000 |
953 |
--- a/dev-python/PyPDF2/PyPDF2-1.26.0.ebuild |
954 |
+++ /dev/null |
955 |
@@ -1,31 +0,0 @@ |
956 |
-# Copyright 1999-2015 Gentoo Foundation |
957 |
-# Distributed under the terms of the GNU General Public License v2 |
958 |
-# $Id$ |
959 |
- |
960 |
-EAPI="5" |
961 |
-PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} ) |
962 |
- |
963 |
-inherit distutils-r1 |
964 |
- |
965 |
-DESCRIPTION="Python library to work with pdf files" |
966 |
-HOMEPAGE="https://pypi.python.org/pypi/${PN}/ https://github.com/mstamy2/PyPDF2" |
967 |
-SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz" |
968 |
- |
969 |
-LICENSE="BSD-2" |
970 |
-SLOT="0" |
971 |
-KEYWORDS="~amd64 ~x86" |
972 |
-IUSE="examples" |
973 |
- |
974 |
-python_test() { |
975 |
- # https://github.com/mstamy2/PyPDF2/issues/216 |
976 |
- einfo ""; einfo "According to the author, this 1 failed test is an" |
977 |
- einfo "expected failure meaning the installation of PyPDF2 is working" |
978 |
- einfo "He plans to update the causative file to see it pass"; einfo "" |
979 |
- |
980 |
- "${PYTHON}" -m unittest Tests.tests || die "Tests failed under ${EPYTHON}" |
981 |
-} |
982 |
- |
983 |
-python_install_all() { |
984 |
- use examples && local EXAMPLES=( Sample_Code/. ) |
985 |
- distutils-r1_python_install_all |
986 |
-} |
987 |
|
988 |
diff --git a/dev-python/PyPDF2/metadata.xml b/dev-python/PyPDF2/metadata.xml |
989 |
deleted file mode 100644 |
990 |
index ad27f68..0000000 |
991 |
--- a/dev-python/PyPDF2/metadata.xml |
992 |
+++ /dev/null |
993 |
@@ -1,12 +0,0 @@ |
994 |
-<?xml version="1.0" encoding="UTF-8"?> |
995 |
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
996 |
-<pkgmetadata> |
997 |
- <maintainer type="project"> |
998 |
- <email>python@g.o</email> |
999 |
- <name>Python</name> |
1000 |
- </maintainer> |
1001 |
- <upstream> |
1002 |
- <remote-id type="pypi">PyPDF2</remote-id> |
1003 |
- <remote-id type="github">mstamy2/PyPDF2</remote-id> |
1004 |
- </upstream> |
1005 |
-</pkgmetadata> |
1006 |
|
1007 |
diff --git a/dev-python/flask-login/Manifest b/dev-python/flask-login/Manifest |
1008 |
deleted file mode 100644 |
1009 |
index 7cc8894..0000000 |
1010 |
--- a/dev-python/flask-login/Manifest |
1011 |
+++ /dev/null |
1012 |
@@ -1,4 +0,0 @@ |
1013 |
-AUX flask-login-0.3.2-fix-tests-python2.patch 1115 BLAKE2B 138cab48cbf144a3d4d4704ae293db79e9d41b30326bb2ec28c1c00e75ceec42a2b0eb46bf61ac369bd863406b9fa4a3d7bdb81421e1288ef19d03871e7f5d02 SHA512 2796244a27b504feba773d29cf394ed04b8d7812d8989aca9a5dcd58207c3b192545531c23883f9d6828320adfb09f31388e92af72da5d5a2d2e6df05b89282c |
1014 |
-DIST flask-login-0.4.0.tar.gz 40606 BLAKE2B 042c30e1c076e5d9cfaebd3ec5f1893adae4f267460ba5f5c071da473e01f8ff1b42ccf11662b867f446bc77efbed5b0af63f3a6b7060ec166c0efd431e5aa04 SHA512 cd3b611eb6f2caf50a3fcb52ffffce4fc40520cb88bb87af10328ceb3a309b42b03b61ba686b6c4a000c866baa013bb2a3a7585dcfc477d702aa329bea63af3d |
1015 |
-EBUILD flask-login-0.4.0.ebuild 851 BLAKE2B 8bffaa2d0c0c97d8cc781240e8712955ee205210fe3d4a11e0a4e8b42edf429a6e68fa563b8aa79d65067500b386ef93ce705425c817725f6dd2e2a0e5ac767c SHA512 5e3a1b40a083d9c4e13378d6c59b67c99150eb1aa426843e425d24ff71ad766da7cadebb7ad0c9fbbdfe6c193f3fb94d6655f5bf85f7172b40eae8f6ea5054f6 |
1016 |
-MISC metadata.xml 314 BLAKE2B 6da22c7d637811e8c20945ef154626520ad1643cd4624c90d0d20e507301004812dda4ac89af12966cea1d69eebb73007a78955da9c700d4a9e4323c09f0cc40 SHA512 6031f60cb6209103f927d4886d2dc62ac519936242f7b72689a308757353e6b7e0fa376fdbcfa7d9e88c0a96916a4b8a783e25c0fc9a64d31bbc133738fd0069 |
1017 |
|
1018 |
diff --git a/dev-python/flask-login/files/flask-login-0.3.2-fix-tests-python2.patch b/dev-python/flask-login/files/flask-login-0.3.2-fix-tests-python2.patch |
1019 |
deleted file mode 100644 |
1020 |
index 33811ab..0000000 |
1021 |
--- a/dev-python/flask-login/files/flask-login-0.3.2-fix-tests-python2.patch |
1022 |
+++ /dev/null |
1023 |
@@ -1,29 +0,0 @@ |
1024 |
-diff --git a/test_login.py b/test_login.py |
1025 |
-index 3f110e0..0c060f5 100644 |
1026 |
---- a/test_login.py |
1027 |
-+++ b/test_login.py |
1028 |
-@@ -39,6 +39,7 @@ from flask.ext.login import (LoginManager, UserMixin, AnonymousUserMixin, |
1029 |
- if str is not bytes: |
1030 |
- unicode = str |
1031 |
- |
1032 |
-+werkzeug_version = tuple(int(i) for i in werkzeug_version.split('.')) |
1033 |
- |
1034 |
- @contextmanager |
1035 |
- def listen_to(signal): |
1036 |
-@@ -1073,14 +1074,14 @@ class LoginTestCase(unittest.TestCase): |
1037 |
- # |
1038 |
- # Misc |
1039 |
- # |
1040 |
-- @unittest.skipIf(werkzeug_version.startswith("0.9"), |
1041 |
-+ @unittest.skipIf(werkzeug_version >= (0, 9), |
1042 |
- "wait for upstream implementing RFC 5987") |
1043 |
- def test_chinese_user_agent(self): |
1044 |
- with self.app.test_client() as c: |
1045 |
- result = c.get('/', headers=[('User-Agent', u'中文')]) |
1046 |
- self.assertEqual(u'Welcome!', result.data.decode('utf-8')) |
1047 |
- |
1048 |
-- @unittest.skipIf(werkzeug_version.startswith("0.9"), |
1049 |
-+ @unittest.skipIf(werkzeug_version >= (0, 9), |
1050 |
- "wait for upstream implementing RFC 5987") |
1051 |
- def test_russian_cp1251_user_agent(self): |
1052 |
- with self.app.test_client() as c: |
1053 |
|
1054 |
diff --git a/dev-python/flask-login/flask-login-0.4.0.ebuild b/dev-python/flask-login/flask-login-0.4.0.ebuild |
1055 |
deleted file mode 100644 |
1056 |
index eefb217..0000000 |
1057 |
--- a/dev-python/flask-login/flask-login-0.4.0.ebuild |
1058 |
+++ /dev/null |
1059 |
@@ -1,32 +0,0 @@ |
1060 |
-# Copyright 1999-2017 Gentoo Foundation |
1061 |
-# Distributed under the terms of the GNU General Public License v2 |
1062 |
-# $Id$ |
1063 |
- |
1064 |
-EAPI=6 |
1065 |
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy ) |
1066 |
- |
1067 |
-inherit distutils-r1 |
1068 |
- |
1069 |
-DESCRIPTION="Login session support for Flask" |
1070 |
-HOMEPAGE="https://pypi.python.org/pypi/Flask-Login" |
1071 |
-SRC_URI="https://github.com/maxcountryman/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" |
1072 |
-# pypi tarball is missing tests |
1073 |
- |
1074 |
-LICENSE="BSD" |
1075 |
-SLOT="0" |
1076 |
-KEYWORDS="~amd64" |
1077 |
-IUSE="test" |
1078 |
- |
1079 |
-RDEPEND=">=dev-python/flask-0.10[${PYTHON_USEDEP}]" |
1080 |
-DEPEND="${RDEPEND} |
1081 |
- dev-python/setuptools[${PYTHON_USEDEP}] |
1082 |
- test? ( |
1083 |
- dev-python/nose[${PYTHON_USEDEP}] |
1084 |
- dev-python/mock[${PYTHON_USEDEP}] |
1085 |
- dev-python/blinker[${PYTHON_USEDEP}] |
1086 |
- $(python_gen_cond_dep 'dev-python/unittest2[${PYTHON_USEDEP}]' 'python2*' pypy) |
1087 |
- )" |
1088 |
- |
1089 |
-python_test() { |
1090 |
- nosetests -v || die "Tests fail with ${EPYTHON}" |
1091 |
-} |
1092 |
|
1093 |
diff --git a/dev-python/flask-login/metadata.xml b/dev-python/flask-login/metadata.xml |
1094 |
deleted file mode 100644 |
1095 |
index d14744a..0000000 |
1096 |
--- a/dev-python/flask-login/metadata.xml |
1097 |
+++ /dev/null |
1098 |
@@ -1,11 +0,0 @@ |
1099 |
-<?xml version="1.0" encoding="UTF-8"?> |
1100 |
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
1101 |
-<pkgmetadata> |
1102 |
- <maintainer type="project"> |
1103 |
- <email>python@g.o</email> |
1104 |
- <name>Python</name> |
1105 |
- </maintainer> |
1106 |
- <upstream> |
1107 |
- <remote-id type="pypi">Flask-Login</remote-id> |
1108 |
- </upstream> |
1109 |
-</pkgmetadata> |
1110 |
|
1111 |
diff --git a/dev-python/imdbpy/ChangeLog b/dev-python/imdbpy/ChangeLog |
1112 |
deleted file mode 100644 |
1113 |
index 7654d62..0000000 |
1114 |
--- a/dev-python/imdbpy/ChangeLog |
1115 |
+++ /dev/null |
1116 |
@@ -1,95 +0,0 @@ |
1117 |
-# ChangeLog for dev-python/imdbpy |
1118 |
-# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 |
1119 |
-# $Header: /var/cvsroot/gentoo-x86/dev-python/imdbpy/ChangeLog,v 1.20 2013/06/23 17:43:11 idella4 Exp $ |
1120 |
- |
1121 |
-*imdbpy-4.9-r1 (23 Jun 2013) |
1122 |
- |
1123 |
- 23 Jun 2013; Ian Delaney <idella4@g.o> +imdbpy-4.9-r1.ebuild: |
1124 |
- revbump; migrate -> distutils-r1 |
1125 |
- |
1126 |
-*imdbpy-4.9 (04 Nov 2012) |
1127 |
- |
1128 |
- 04 Nov 2012; Ian Delaney <idella4@g.o> +imdbpy-4.9.ebuild, |
1129 |
- -imdbpy-4.7-r1.ebuild, -imdbpy-4.7.ebuild: |
1130 |
- bumped to imdbpy-4.9, dropped imdbpy-4.7 |
1131 |
- |
1132 |
- 13 Jul 2012; Mike Gilbert <floppym@g.o> imdbpy-4.7-r1.ebuild, |
1133 |
- imdbpy-4.8.2.ebuild: |
1134 |
- Update DISTUTILS_GLOBAL_OPTIONS to match EAPI 4 logic in distutils.eclass as |
1135 |
- suggested by Arfrever. |
1136 |
- |
1137 |
-*imdbpy-4.8.2 (19 Apr 2012) |
1138 |
- |
1139 |
- 19 Apr 2012; Patrick Lauer <patrick@g.o> +imdbpy-4.8.2.ebuild: |
1140 |
- Bump |
1141 |
- |
1142 |
- 22 Feb 2012; Patrick Lauer <patrick@g.o> imdbpy-4.7-r1.ebuild, |
1143 |
- imdbpy-4.7.ebuild: |
1144 |
- Restricting jython too |
1145 |
- |
1146 |
- 22 Feb 2012; Patrick Lauer <patrick@g.o> imdbpy-4.7-r1.ebuild, |
1147 |
- imdbpy-4.7.ebuild: |
1148 |
- Restricting pypy |
1149 |
- |
1150 |
- 14 Dec 2011; Mike Gilbert <floppym@g.o> imdbpy-4.7.ebuild: |
1151 |
- Fix stable ebuild as well. |
1152 |
- |
1153 |
-*imdbpy-4.7-r1 (14 Dec 2011) |
1154 |
- |
1155 |
- 14 Dec 2011; Mike Gilbert <floppym@g.o> +imdbpy-4.7-r1.ebuild: |
1156 |
- Bump EAPI to 4. Don't install icons as docs. Thanks to Ian Delaney for doing |
1157 |
- the research. |
1158 |
- |
1159 |
- 12 Mar 2011; Arfrever Frehtes Taifersar Arahesis <arfrever@g.o> |
1160 |
- -imdbpy-4.6.ebuild: |
1161 |
- Delete. |
1162 |
- |
1163 |
- 12 Mar 2011; Thomas Kahle <tomka@g.o> imdbpy-4.7.ebuild: |
1164 |
- x86 stable per bug 356439 |
1165 |
- |
1166 |
- 27 Feb 2011; Markos Chandras <hwoarang@g.o> imdbpy-4.7.ebuild: |
1167 |
- Stable on amd64 wrt bug #356439 |
1168 |
- |
1169 |
-*imdbpy-4.7 (26 Jan 2011) |
1170 |
- |
1171 |
- 26 Jan 2011; Arfrever Frehtes Taifersar Arahesis <arfrever@g.o> |
1172 |
- +imdbpy-4.7.ebuild: |
1173 |
- Version bump. |
1174 |
- |
1175 |
- 26 Dec 2010; Arfrever Frehtes Taifersar Arahesis <arfrever@g.o> |
1176 |
- -files/4.5.1-no-docs.patch, -imdbpy-4.5.1.ebuild: |
1177 |
- Delete. |
1178 |
- |
1179 |
- 01 Aug 2010; Markos Chandras <hwoarang@g.o> imdbpy-4.6.ebuild: |
1180 |
- Stable on amd64 wrt bug #323745 |
1181 |
- |
1182 |
- 26 Jul 2010; Christian Faulhammer <fauli@g.o> imdbpy-4.6.ebuild: |
1183 |
- stable x86, bug 323745 |
1184 |
- |
1185 |
-*imdbpy-4.6 (21 Jun 2010) |
1186 |
- |
1187 |
- 21 Jun 2010; Arfrever Frehtes Taifersar Arahesis <arfrever@g.o> |
1188 |
- +imdbpy-4.6.ebuild, +files/imdbpy-4.6-data_location.patch: |
1189 |
- Version bump. |
1190 |
- |
1191 |
- 07 Jun 2010; Dirkjan Ochtman <djc@g.o> +files/4.5.1-no-docs.patch, |
1192 |
- imdbpy-4.5.1.ebuild: |
1193 |
- Prevent installation of files in /usr/share/doc directly (bug 315983). |
1194 |
- |
1195 |
-*imdbpy-4.5.1 (01 Mar 2010) |
1196 |
- |
1197 |
- 01 Mar 2010; Arfrever Frehtes Taifersar Arahesis <arfrever@g.o> |
1198 |
- +imdbpy-4.5.1.ebuild: |
1199 |
- Version bump. |
1200 |
- |
1201 |
-*imdbpy-4.4 (09 Jan 2010) |
1202 |
- |
1203 |
- 09 Jan 2010; Arfrever Frehtes Taifersar Arahesis <arfrever@g.o> |
1204 |
- +imdbpy-4.4.ebuild: |
1205 |
- Version bump. |
1206 |
- |
1207 |
-*imdbpy-4.3 (21 Nov 2009) |
1208 |
- |
1209 |
- 21 Nov 2009; Doug Goldstein <cardoe@g.o> +imdbpy-4.3.ebuild, |
1210 |
- +metadata.xml: |
1211 |
- add initial version to the tree. bug #109719 |
1212 |
|
1213 |
diff --git a/dev-python/imdbpy/Manifest b/dev-python/imdbpy/Manifest |
1214 |
deleted file mode 100644 |
1215 |
index f0589a5..0000000 |
1216 |
--- a/dev-python/imdbpy/Manifest |
1217 |
+++ /dev/null |
1218 |
@@ -1,6 +0,0 @@ |
1219 |
-AUX imdbpy-4.6-data_location.patch 386 SHA256 22c59416cc2481aab25ab924b6ad2467ec9556a3206c0dce6d2af2899acedb56 SHA512 b6846126cf3eab62f454b1d8073d068a356ee792895939c9a4ee67eacd46616d0173bc85e52f6930f3ee8d96b95913afcc07b5b384a205559bce105e37038567 WHIRLPOOL 06fdd41f098ba290df40860f65582e5c4f59de724951bf634d5d4cb8fc9dfff4b90dbbc68c886bafcc82b4c08de0c22d2b55df66c3778c2fc517d86b61ce42bf |
1220 |
-AUX updateToPython3.patch 293426 SHA256 8c7642ca62560b4349d8d4d8777839224d408b5b74d50aa596ac9d469ec24c8e SHA512 ce3ae3df47ede0a801188fd5a93781c4aedaffa2ad49282f30be36a770ca0957893e091edb4e5c0a5d333b0bc2afb73bb4e04b620586c19ae852d6c917c743aa WHIRLPOOL 157babc75d49a7df41d3cbba3d3e7a914508173da532c46eef6d80a6646124c10c56888d6dbee1f0b0b85edbf9a86a70e7088cdbed1930d0b86edcb5079843cd |
1221 |
-DIST IMDbPY-4.9.tar.gz 307726 SHA256 01e90dce4fe19aeca99c9d3eb14052769467b177e3fb8acc240f9c51c5f477d2 SHA512 1f46ea504e7ca61b0e8ba85bd2bfd88ef2ddc87f085d70336773d840401b03d6a8b807544ee665f4211ca093dc23dbc69619b5c04cab0b5024e73105179be8f4 WHIRLPOOL bb289000fe267124dfa1ee331a0c48722c5799b241d281e39483e73a8650804596d37922d516ad92ca2ca4ef140ff59d80bda99fbd2cbbd67e9bbe8222bbabb6 |
1222 |
-EBUILD imdbpy-4.9-r2.ebuild 1141 SHA256 88d63fb339b9e9be9b3ace7d37ba820b8ed708aec7f16cddd147e924b1a9f57d SHA512 d42f5b1828d739dd540d64a7ac57d8d984f34a5d4ad4ee7f3c66c017f9ffe44c7f92cd395c367f2b267577cdd64fa3f2a8bf036f4e1e8362ccfea2d0ce5e68cb WHIRLPOOL 5f9f5efad3fd3353c17b38d95a6af275dcd14d2114cdd8afe6278e37d31920c364937e0004074d9d0a5ad3550e0070cc339b47a8aedd2c78a242f798c4c4dfba |
1223 |
-MISC ChangeLog 2950 SHA256 3cc11d617a998858c242566711ab65d4440c68f07c3b8b7bf5350abd4be2b3e1 SHA512 a189566f54db7bb63e0a9d9922aa02851e96b34626b67d79b4bb5b65302fd51ecf40d06bdfaa199b053b31c75bb5e592cf80a73b548d57e8a7615441cc152647 WHIRLPOOL 0e41fc5f0edad9c3c2ba6b29487660e0d4a0bcff31eefc0700f7ec8b1a4021bab9aaea3a8ba2840308aa04622a5512715287e9423476ff21bd6350ce292b4182 |
1224 |
-MISC metadata.xml 229 SHA256 25e4989a4acfca1775e6e9f549f95896b987ba930f025cf9f5a665442bd75561 SHA512 b98105060ceaf1f4cd90bb491eaf0306b0bb1e0d654ecfc55985a7bb522d2763e0671997cbcfcfe405a2c4ec5ee599e376a61beacf7550378d6231d1746a72fd WHIRLPOOL 3432d5668885e5f77ac871e83100b442b87746bb825f3be7a15c63b0917949391c39ac18300983740c26f7a8813bfca1bc2493aaba3bbc2f3e2fa3acd7aa1ed9 |
1225 |
|
1226 |
diff --git a/dev-python/imdbpy/files/imdbpy-4.6-data_location.patch b/dev-python/imdbpy/files/imdbpy-4.6-data_location.patch |
1227 |
deleted file mode 100644 |
1228 |
index 90dc467..0000000 |
1229 |
--- a/dev-python/imdbpy/files/imdbpy-4.6-data_location.patch |
1230 |
+++ /dev/null |
1231 |
@@ -1,11 +0,0 @@ |
1232 |
---- setup.py |
1233 |
-+++ setup.py |
1234 |
-@@ -70,7 +70,7 @@ |
1235 |
- |
1236 |
- # XXX: I'm not sure that 'etc' is a good idea. Making it an absolute |
1237 |
- # path seems a recipe for a disaster (with bdist_egg, at least). |
1238 |
--data_files = [('doc', setuptools.findall('docs')), ('etc', ['docs/imdbpy.cfg'])] |
1239 |
-+data_files = [('/etc', ['docs/imdbpy.cfg'])] |
1240 |
- |
1241 |
- |
1242 |
- # Defining these 'features', it's possible to run commands like: |
1243 |
|
1244 |
diff --git a/dev-python/imdbpy/files/updateToPython3.patch b/dev-python/imdbpy/files/updateToPython3.patch |
1245 |
deleted file mode 100644 |
1246 |
index 1ff0385..0000000 |
1247 |
--- a/dev-python/imdbpy/files/updateToPython3.patch |
1248 |
+++ /dev/null |
1249 |
@@ -1,6966 +0,0 @@ |
1250 |
-diff --git a/bin/get_character.py b/bin/get_character.py |
1251 |
-index ab33f6e..9724cf4 100755 |
1252 |
---- a/bin/get_character.py |
1253 |
-+++ b/bin/get_character.py |
1254 |
-@@ -15,13 +15,13 @@ import sys |
1255 |
- try: |
1256 |
- import imdb |
1257 |
- except ImportError: |
1258 |
-- print 'You bad boy! You need to install the IMDbPY package!' |
1259 |
-+ print('You bad boy! You need to install the IMDbPY package!') |
1260 |
- sys.exit(1) |
1261 |
- |
1262 |
- |
1263 |
- if len(sys.argv) != 2: |
1264 |
-- print 'Only one argument is required:' |
1265 |
-- print ' %s "characterID"' % sys.argv[0] |
1266 |
-+ print('Only one argument is required:') |
1267 |
-+ print(' %s "characterID"' % sys.argv[0]) |
1268 |
- sys.exit(2) |
1269 |
- |
1270 |
- characterID = sys.argv[1] |
1271 |
-@@ -34,14 +34,14 @@ try: |
1272 |
- # Get a character object with the data about the character identified by |
1273 |
- # the given characterID. |
1274 |
- character = i.get_character(characterID) |
1275 |
--except imdb.IMDbError, e: |
1276 |
-- print "Probably you're not connected to Internet. Complete error report:" |
1277 |
-- print e |
1278 |
-+except imdb.IMDbError as e: |
1279 |
-+ print("Probably you're not connected to Internet. Complete error report:") |
1280 |
-+ print(e) |
1281 |
- sys.exit(3) |
1282 |
- |
1283 |
- |
1284 |
- if not character: |
1285 |
-- print 'It seems that there\'s no character with characterID "%s"' % characterID |
1286 |
-+ print('It seems that there\'s no character with characterID "%s"' % characterID) |
1287 |
- sys.exit(4) |
1288 |
- |
1289 |
- # XXX: this is the easier way to print the main info about a character; |
1290 |
-@@ -51,6 +51,6 @@ if not character: |
1291 |
- # to access the data stored in a character object, so look below; the |
1292 |
- # commented lines show some ways to retrieve information from a |
1293 |
- # character object. |
1294 |
--print character.summary().encode(out_encoding, 'replace') |
1295 |
-+print(character.summary().encode(out_encoding, 'replace')) |
1296 |
- |
1297 |
- |
1298 |
-diff --git a/bin/get_company.py b/bin/get_company.py |
1299 |
-index 5792c1f..82c54cf 100755 |
1300 |
---- a/bin/get_company.py |
1301 |
-+++ b/bin/get_company.py |
1302 |
-@@ -15,13 +15,13 @@ import sys |
1303 |
- try: |
1304 |
- import imdb |
1305 |
- except ImportError: |
1306 |
-- print 'You bad boy! You need to install the IMDbPY package!' |
1307 |
-+ print('You bad boy! You need to install the IMDbPY package!') |
1308 |
- sys.exit(1) |
1309 |
- |
1310 |
- |
1311 |
- if len(sys.argv) != 2: |
1312 |
-- print 'Only one argument is required:' |
1313 |
-- print ' %s "companyID"' % sys.argv[0] |
1314 |
-+ print('Only one argument is required:') |
1315 |
-+ print(' %s "companyID"' % sys.argv[0]) |
1316 |
- sys.exit(2) |
1317 |
- |
1318 |
- companyID = sys.argv[1] |
1319 |
-@@ -34,14 +34,14 @@ try: |
1320 |
- # Get a company object with the data about the company identified by |
1321 |
- # the given companyID. |
1322 |
- company = i.get_company(companyID) |
1323 |
--except imdb.IMDbError, e: |
1324 |
-- print "Probably you're not connected to Internet. Complete error report:" |
1325 |
-- print e |
1326 |
-+except imdb.IMDbError as e: |
1327 |
-+ print("Probably you're not connected to Internet. Complete error report:") |
1328 |
-+ print(e) |
1329 |
- sys.exit(3) |
1330 |
- |
1331 |
- |
1332 |
- if not company: |
1333 |
-- print 'It seems that there\'s no company with companyID "%s"' % companyID |
1334 |
-+ print('It seems that there\'s no company with companyID "%s"' % companyID) |
1335 |
- sys.exit(4) |
1336 |
- |
1337 |
- # XXX: this is the easier way to print the main info about a company; |
1338 |
-@@ -51,6 +51,6 @@ if not company: |
1339 |
- # to access the data stored in a company object, so look below; the |
1340 |
- # commented lines show some ways to retrieve information from a |
1341 |
- # company object. |
1342 |
--print company.summary().encode(out_encoding, 'replace') |
1343 |
-+print(company.summary().encode(out_encoding, 'replace')) |
1344 |
- |
1345 |
- |
1346 |
-diff --git a/bin/get_first_character.py b/bin/get_first_character.py |
1347 |
-index f434ee0..7773077 100755 |
1348 |
---- a/bin/get_first_character.py |
1349 |
-+++ b/bin/get_first_character.py |
1350 |
-@@ -13,13 +13,13 @@ import sys |
1351 |
- try: |
1352 |
- import imdb |
1353 |
- except ImportError: |
1354 |
-- print 'You bad boy! You need to install the IMDbPY package!' |
1355 |
-+ print('You bad boy! You need to install the IMDbPY package!') |
1356 |
- sys.exit(1) |
1357 |
- |
1358 |
- |
1359 |
- if len(sys.argv) != 2: |
1360 |
-- print 'Only one argument is required:' |
1361 |
-- print ' %s "character name"' % sys.argv[0] |
1362 |
-+ print('Only one argument is required:') |
1363 |
-+ print(' %s "character name"' % sys.argv[0]) |
1364 |
- sys.exit(2) |
1365 |
- |
1366 |
- name = sys.argv[1] |
1367 |
-@@ -30,21 +30,21 @@ i = imdb.IMDb() |
1368 |
- in_encoding = sys.stdin.encoding or sys.getdefaultencoding() |
1369 |
- out_encoding = sys.stdout.encoding or sys.getdefaultencoding() |
1370 |
- |
1371 |
--name = unicode(name, in_encoding, 'replace') |
1372 |
-+name = str(name, in_encoding, 'replace') |
1373 |
- try: |
1374 |
- # Do the search, and get the results (a list of character objects). |
1375 |
- results = i.search_character(name) |
1376 |
--except imdb.IMDbError, e: |
1377 |
-- print "Probably you're not connected to Internet. Complete error report:" |
1378 |
-- print e |
1379 |
-+except imdb.IMDbError as e: |
1380 |
-+ print("Probably you're not connected to Internet. Complete error report:") |
1381 |
-+ print(e) |
1382 |
- sys.exit(3) |
1383 |
- |
1384 |
- if not results: |
1385 |
-- print 'No matches for "%s", sorry.' % name.encode(out_encoding, 'replace') |
1386 |
-+ print('No matches for "%s", sorry.' % name.encode(out_encoding, 'replace')) |
1387 |
- sys.exit(0) |
1388 |
- |
1389 |
- # Print only the first result. |
1390 |
--print ' Best match for "%s"' % name.encode(out_encoding, 'replace') |
1391 |
-+print(' Best match for "%s"' % name.encode(out_encoding, 'replace')) |
1392 |
- |
1393 |
- # This is a character instance. |
1394 |
- character = results[0] |
1395 |
-@@ -53,7 +53,7 @@ character = results[0] |
1396 |
- # name; retrieve main information: |
1397 |
- i.update(character) |
1398 |
- |
1399 |
--print character.summary().encode(out_encoding, 'replace') |
1400 |
-+print(character.summary().encode(out_encoding, 'replace')) |
1401 |
- |
1402 |
- |
1403 |
- |
1404 |
-diff --git a/bin/get_first_company.py b/bin/get_first_company.py |
1405 |
-index c3b3a06..bc6dc8a 100755 |
1406 |
---- a/bin/get_first_company.py |
1407 |
-+++ b/bin/get_first_company.py |
1408 |
-@@ -13,13 +13,13 @@ import sys |
1409 |
- try: |
1410 |
- import imdb |
1411 |
- except ImportError: |
1412 |
-- print 'You bad boy! You need to install the IMDbPY package!' |
1413 |
-+ print('You bad boy! You need to install the IMDbPY package!') |
1414 |
- sys.exit(1) |
1415 |
- |
1416 |
- |
1417 |
- if len(sys.argv) != 2: |
1418 |
-- print 'Only one argument is required:' |
1419 |
-- print ' %s "company name"' % sys.argv[0] |
1420 |
-+ print('Only one argument is required:') |
1421 |
-+ print(' %s "company name"' % sys.argv[0]) |
1422 |
- sys.exit(2) |
1423 |
- |
1424 |
- name = sys.argv[1] |
1425 |
-@@ -30,21 +30,21 @@ i = imdb.IMDb() |
1426 |
- in_encoding = sys.stdin.encoding or sys.getdefaultencoding() |
1427 |
- out_encoding = sys.stdout.encoding or sys.getdefaultencoding() |
1428 |
- |
1429 |
--name = unicode(name, in_encoding, 'replace') |
1430 |
-+name = str(name, in_encoding, 'replace') |
1431 |
- try: |
1432 |
- # Do the search, and get the results (a list of company objects). |
1433 |
- results = i.search_company(name) |
1434 |
--except imdb.IMDbError, e: |
1435 |
-- print "Probably you're not connected to Internet. Complete error report:" |
1436 |
-- print e |
1437 |
-+except imdb.IMDbError as e: |
1438 |
-+ print("Probably you're not connected to Internet. Complete error report:") |
1439 |
-+ print(e) |
1440 |
- sys.exit(3) |
1441 |
- |
1442 |
- if not results: |
1443 |
-- print 'No matches for "%s", sorry.' % name.encode(out_encoding, 'replace') |
1444 |
-+ print('No matches for "%s", sorry.' % name.encode(out_encoding, 'replace')) |
1445 |
- sys.exit(0) |
1446 |
- |
1447 |
- # Print only the first result. |
1448 |
--print ' Best match for "%s"' % name.encode(out_encoding, 'replace') |
1449 |
-+print(' Best match for "%s"' % name.encode(out_encoding, 'replace')) |
1450 |
- |
1451 |
- # This is a company instance. |
1452 |
- company = results[0] |
1453 |
-@@ -53,7 +53,7 @@ company = results[0] |
1454 |
- # name; retrieve main information: |
1455 |
- i.update(company) |
1456 |
- |
1457 |
--print company.summary().encode(out_encoding, 'replace') |
1458 |
-+print(company.summary().encode(out_encoding, 'replace')) |
1459 |
- |
1460 |
- |
1461 |
- |
1462 |
-diff --git a/bin/get_first_movie.py b/bin/get_first_movie.py |
1463 |
-index b757a45..fd1dcd4 100755 |
1464 |
---- a/bin/get_first_movie.py |
1465 |
-+++ b/bin/get_first_movie.py |
1466 |
-@@ -13,13 +13,13 @@ import sys |
1467 |
- try: |
1468 |
- import imdb |
1469 |
- except ImportError: |
1470 |
-- print 'You bad boy! You need to install the IMDbPY package!' |
1471 |
-+ print('You bad boy! You need to install the IMDbPY package!') |
1472 |
- sys.exit(1) |
1473 |
- |
1474 |
- |
1475 |
- if len(sys.argv) != 2: |
1476 |
-- print 'Only one argument is required:' |
1477 |
-- print ' %s "movie title"' % sys.argv[0] |
1478 |
-+ print('Only one argument is required:') |
1479 |
-+ print(' %s "movie title"' % sys.argv[0]) |
1480 |
- sys.exit(2) |
1481 |
- |
1482 |
- title = sys.argv[1] |
1483 |
-@@ -30,21 +30,21 @@ i = imdb.IMDb() |
1484 |
- in_encoding = sys.stdin.encoding or sys.getdefaultencoding() |
1485 |
- out_encoding = sys.stdout.encoding or sys.getdefaultencoding() |
1486 |
- |
1487 |
--title = unicode(title, in_encoding, 'replace') |
1488 |
-+title = str(title, in_encoding, 'replace') |
1489 |
- try: |
1490 |
- # Do the search, and get the results (a list of Movie objects). |
1491 |
- results = i.search_movie(title) |
1492 |
--except imdb.IMDbError, e: |
1493 |
-- print "Probably you're not connected to Internet. Complete error report:" |
1494 |
-- print e |
1495 |
-+except imdb.IMDbError as e: |
1496 |
-+ print("Probably you're not connected to Internet. Complete error report:") |
1497 |
-+ print(e) |
1498 |
- sys.exit(3) |
1499 |
- |
1500 |
- if not results: |
1501 |
-- print 'No matches for "%s", sorry.' % title.encode(out_encoding, 'replace') |
1502 |
-+ print('No matches for "%s", sorry.' % title.encode(out_encoding, 'replace')) |
1503 |
- sys.exit(0) |
1504 |
- |
1505 |
- # Print only the first result. |
1506 |
--print ' Best match for "%s"' % title.encode(out_encoding, 'replace') |
1507 |
-+print(' Best match for "%s"' % title.encode(out_encoding, 'replace')) |
1508 |
- |
1509 |
- # This is a Movie instance. |
1510 |
- movie = results[0] |
1511 |
-@@ -53,7 +53,7 @@ movie = results[0] |
1512 |
- # title and the year; retrieve main information: |
1513 |
- i.update(movie) |
1514 |
- |
1515 |
--print movie.summary().encode(out_encoding, 'replace') |
1516 |
-+print(movie.summary().encode(out_encoding, 'replace')) |
1517 |
- |
1518 |
- |
1519 |
- |
1520 |
-diff --git a/bin/get_first_person.py b/bin/get_first_person.py |
1521 |
-index 4499485..2100425 100755 |
1522 |
---- a/bin/get_first_person.py |
1523 |
-+++ b/bin/get_first_person.py |
1524 |
-@@ -13,13 +13,13 @@ import sys |
1525 |
- try: |
1526 |
- import imdb |
1527 |
- except ImportError: |
1528 |
-- print 'You bad boy! You need to install the IMDbPY package!' |
1529 |
-+ print('You bad boy! You need to install the IMDbPY package!') |
1530 |
- sys.exit(1) |
1531 |
- |
1532 |
- |
1533 |
- if len(sys.argv) != 2: |
1534 |
-- print 'Only one argument is required:' |
1535 |
-- print ' %s "person name"' % sys.argv[0] |
1536 |
-+ print('Only one argument is required:') |
1537 |
-+ print(' %s "person name"' % sys.argv[0]) |
1538 |
- sys.exit(2) |
1539 |
- |
1540 |
- name = sys.argv[1] |
1541 |
-@@ -30,21 +30,21 @@ i = imdb.IMDb() |
1542 |
- in_encoding = sys.stdin.encoding or sys.getdefaultencoding() |
1543 |
- out_encoding = sys.stdout.encoding or sys.getdefaultencoding() |
1544 |
- |
1545 |
--name = unicode(name, in_encoding, 'replace') |
1546 |
-+name = str(name, in_encoding, 'replace') |
1547 |
- try: |
1548 |
- # Do the search, and get the results (a list of Person objects). |
1549 |
- results = i.search_person(name) |
1550 |
--except imdb.IMDbError, e: |
1551 |
-- print "Probably you're not connected to Internet. Complete error report:" |
1552 |
-- print e |
1553 |
-+except imdb.IMDbError as e: |
1554 |
-+ print("Probably you're not connected to Internet. Complete error report:") |
1555 |
-+ print(e) |
1556 |
- sys.exit(3) |
1557 |
- |
1558 |
- if not results: |
1559 |
-- print 'No matches for "%s", sorry.' % name.encode(out_encoding, 'replace') |
1560 |
-+ print('No matches for "%s", sorry.' % name.encode(out_encoding, 'replace')) |
1561 |
- sys.exit(0) |
1562 |
- |
1563 |
- # Print only the first result. |
1564 |
--print ' Best match for "%s"' % name.encode(out_encoding, 'replace') |
1565 |
-+print(' Best match for "%s"' % name.encode(out_encoding, 'replace')) |
1566 |
- |
1567 |
- # This is a Person instance. |
1568 |
- person = results[0] |
1569 |
-@@ -53,7 +53,7 @@ person = results[0] |
1570 |
- # name; retrieve main information: |
1571 |
- i.update(person) |
1572 |
- |
1573 |
--print person.summary().encode(out_encoding, 'replace') |
1574 |
-+print(person.summary().encode(out_encoding, 'replace')) |
1575 |
- |
1576 |
- |
1577 |
- |
1578 |
-diff --git a/bin/get_keyword.py b/bin/get_keyword.py |
1579 |
-index becbf03..6a0b2b2 100755 |
1580 |
---- a/bin/get_keyword.py |
1581 |
-+++ b/bin/get_keyword.py |
1582 |
-@@ -13,13 +13,13 @@ import sys |
1583 |
- try: |
1584 |
- import imdb |
1585 |
- except ImportError: |
1586 |
-- print 'You bad boy! You need to install the IMDbPY package!' |
1587 |
-+ print('You bad boy! You need to install the IMDbPY package!') |
1588 |
- sys.exit(1) |
1589 |
- |
1590 |
- |
1591 |
- if len(sys.argv) != 2: |
1592 |
-- print 'Only one argument is required:' |
1593 |
-- print ' %s "keyword"' % sys.argv[0] |
1594 |
-+ print('Only one argument is required:') |
1595 |
-+ print(' %s "keyword"' % sys.argv[0]) |
1596 |
- sys.exit(2) |
1597 |
- |
1598 |
- name = sys.argv[1] |
1599 |
-@@ -30,24 +30,24 @@ i = imdb.IMDb() |
1600 |
- in_encoding = sys.stdin.encoding or sys.getdefaultencoding() |
1601 |
- out_encoding = sys.stdout.encoding or sys.getdefaultencoding() |
1602 |
- |
1603 |
--name = unicode(name, in_encoding, 'replace') |
1604 |
-+name = str(name, in_encoding, 'replace') |
1605 |
- try: |
1606 |
- # Do the search, and get the results (a list of movies). |
1607 |
- results = i.get_keyword(name, results=20) |
1608 |
--except imdb.IMDbError, e: |
1609 |
-- print "Probably you're not connected to Internet. Complete error report:" |
1610 |
-- print e |
1611 |
-+except imdb.IMDbError as e: |
1612 |
-+ print("Probably you're not connected to Internet. Complete error report:") |
1613 |
-+ print(e) |
1614 |
- sys.exit(3) |
1615 |
- |
1616 |
- # Print the results. |
1617 |
--print ' %s result%s for "%s":' % (len(results), |
1618 |
-+print(' %s result%s for "%s":' % (len(results), |
1619 |
- ('', 's')[len(results) != 1], |
1620 |
-- name.encode(out_encoding, 'replace')) |
1621 |
--print ' : movie title' |
1622 |
-+ name.encode(out_encoding, 'replace'))) |
1623 |
-+print(' : movie title') |
1624 |
- |
1625 |
- # Print the long imdb title for every movie. |
1626 |
- for idx, movie in enumerate(results): |
1627 |
-- outp = u'%d: %s' % (idx+1, movie['long imdb title']) |
1628 |
-- print outp.encode(out_encoding, 'replace') |
1629 |
-+ outp = '%d: %s' % (idx+1, movie['long imdb title']) |
1630 |
-+ print(outp.encode(out_encoding, 'replace')) |
1631 |
- |
1632 |
- |
1633 |
-diff --git a/bin/get_movie.py b/bin/get_movie.py |
1634 |
-index 54e9a7f..195c303 100755 |
1635 |
---- a/bin/get_movie.py |
1636 |
-+++ b/bin/get_movie.py |
1637 |
-@@ -15,13 +15,13 @@ import sys |
1638 |
- try: |
1639 |
- import imdb |
1640 |
- except ImportError: |
1641 |
-- print 'You bad boy! You need to install the IMDbPY package!' |
1642 |
-+ print('You bad boy! You need to install the IMDbPY package!') |
1643 |
- sys.exit(1) |
1644 |
- |
1645 |
- |
1646 |
- if len(sys.argv) != 2: |
1647 |
-- print 'Only one argument is required:' |
1648 |
-- print ' %s "movieID"' % sys.argv[0] |
1649 |
-+ print('Only one argument is required:') |
1650 |
-+ print(' %s "movieID"' % sys.argv[0]) |
1651 |
- sys.exit(2) |
1652 |
- |
1653 |
- movieID = sys.argv[1] |
1654 |
-@@ -34,14 +34,14 @@ try: |
1655 |
- # Get a Movie object with the data about the movie identified by |
1656 |
- # the given movieID. |
1657 |
- movie = i.get_movie(movieID) |
1658 |
--except imdb.IMDbError, e: |
1659 |
-- print "Probably you're not connected to Internet. Complete error report:" |
1660 |
-- print e |
1661 |
-+except imdb.IMDbError as e: |
1662 |
-+ print("Probably you're not connected to Internet. Complete error report:") |
1663 |
-+ print(e) |
1664 |
- sys.exit(3) |
1665 |
- |
1666 |
- |
1667 |
- if not movie: |
1668 |
-- print 'It seems that there\'s no movie with movieID "%s"' % movieID |
1669 |
-+ print('It seems that there\'s no movie with movieID "%s"' % movieID) |
1670 |
- sys.exit(4) |
1671 |
- |
1672 |
- # XXX: this is the easier way to print the main info about a movie; |
1673 |
-@@ -51,7 +51,7 @@ if not movie: |
1674 |
- # to access the data stored in a Movie object, so look below; the |
1675 |
- # commented lines show some ways to retrieve information from a |
1676 |
- # Movie object. |
1677 |
--print movie.summary().encode(out_encoding, 'replace') |
1678 |
-+print(movie.summary().encode(out_encoding, 'replace')) |
1679 |
- |
1680 |
- # Show some info about the movie. |
1681 |
- # This is only a short example; you can get a longer summary using |
1682 |
-diff --git a/bin/get_person.py b/bin/get_person.py |
1683 |
-index 16f50e6..93dd202 100755 |
1684 |
---- a/bin/get_person.py |
1685 |
-+++ b/bin/get_person.py |
1686 |
-@@ -15,13 +15,13 @@ import sys |
1687 |
- try: |
1688 |
- import imdb |
1689 |
- except ImportError: |
1690 |
-- print 'You bad boy! You need to install the IMDbPY package!' |
1691 |
-+ print('You bad boy! You need to install the IMDbPY package!') |
1692 |
- sys.exit(1) |
1693 |
- |
1694 |
- |
1695 |
- if len(sys.argv) != 2: |
1696 |
-- print 'Only one argument is required:' |
1697 |
-- print ' %s "personID"' % sys.argv[0] |
1698 |
-+ print('Only one argument is required:') |
1699 |
-+ print(' %s "personID"' % sys.argv[0]) |
1700 |
- sys.exit(2) |
1701 |
- |
1702 |
- personID = sys.argv[1] |
1703 |
-@@ -34,14 +34,14 @@ try: |
1704 |
- # Get a Person object with the data about the person identified by |
1705 |
- # the given personID. |
1706 |
- person = i.get_person(personID) |
1707 |
--except imdb.IMDbError, e: |
1708 |
-- print "Probably you're not connected to Internet. Complete error report:" |
1709 |
-- print e |
1710 |
-+except imdb.IMDbError as e: |
1711 |
-+ print("Probably you're not connected to Internet. Complete error report:") |
1712 |
-+ print(e) |
1713 |
- sys.exit(3) |
1714 |
- |
1715 |
- |
1716 |
- if not person: |
1717 |
-- print 'It seems that there\'s no person with personID "%s"' % personID |
1718 |
-+ print('It seems that there\'s no person with personID "%s"' % personID) |
1719 |
- sys.exit(4) |
1720 |
- |
1721 |
- # XXX: this is the easier way to print the main info about a person; |
1722 |
-@@ -51,7 +51,7 @@ if not person: |
1723 |
- # to access the data stored in a Person object, so look below; the |
1724 |
- # commented lines show some ways to retrieve information from a |
1725 |
- # Person object. |
1726 |
--print person.summary().encode(out_encoding, 'replace') |
1727 |
-+print(person.summary().encode(out_encoding, 'replace')) |
1728 |
- |
1729 |
- # Show some info about the person. |
1730 |
- # This is only a short example; you can get a longer summary using |
1731 |
-diff --git a/bin/get_top_bottom_movies.py b/bin/get_top_bottom_movies.py |
1732 |
-index 594ee71..b815ffd 100755 |
1733 |
---- a/bin/get_top_bottom_movies.py |
1734 |
-+++ b/bin/get_top_bottom_movies.py |
1735 |
-@@ -13,12 +13,12 @@ import sys |
1736 |
- try: |
1737 |
- import imdb |
1738 |
- except ImportError: |
1739 |
-- print 'You bad boy! You need to install the IMDbPY package!' |
1740 |
-+ print('You bad boy! You need to install the IMDbPY package!') |
1741 |
- sys.exit(1) |
1742 |
- |
1743 |
- |
1744 |
- if len(sys.argv) != 1: |
1745 |
-- print 'No arguments are required.' |
1746 |
-+ print('No arguments are required.') |
1747 |
- sys.exit(2) |
1748 |
- |
1749 |
- i = imdb.IMDb() |
1750 |
-@@ -29,11 +29,11 @@ bottom100 = i.get_bottom100_movies() |
1751 |
- out_encoding = sys.stdout.encoding or sys.getdefaultencoding() |
1752 |
- |
1753 |
- for label, ml in [('top 10', top250[:10]), ('bottom 10', bottom100[:10])]: |
1754 |
-- print '' |
1755 |
-- print '%s movies' % label |
1756 |
-- print 'rating\tvotes\ttitle' |
1757 |
-+ print('') |
1758 |
-+ print('%s movies' % label) |
1759 |
-+ print('rating\tvotes\ttitle') |
1760 |
- for movie in ml: |
1761 |
-- outl = u'%s\t%s\t%s' % (movie.get('rating'), movie.get('votes'), |
1762 |
-+ outl = '%s\t%s\t%s' % (movie.get('rating'), movie.get('votes'), |
1763 |
- movie['long imdb title']) |
1764 |
-- print outl.encode(out_encoding, 'replace') |
1765 |
-+ print(outl.encode(out_encoding, 'replace')) |
1766 |
- |
1767 |
-diff --git a/bin/imdbpy2sql.py b/bin/imdbpy2sql.py |
1768 |
-index 9a527e3..f35cb7b 100755 |
1769 |
---- a/bin/imdbpy2sql.py |
1770 |
-+++ b/bin/imdbpy2sql.py |
1771 |
-@@ -29,9 +29,9 @@ import getopt |
1772 |
- import time |
1773 |
- import re |
1774 |
- import warnings |
1775 |
--import anydbm |
1776 |
-+import dbm |
1777 |
- from itertools import islice, chain |
1778 |
--try: import cPickle as pickle |
1779 |
-+try: import pickle as pickle |
1780 |
- except ImportError: import pickle |
1781 |
- try: from hashlib import md5 |
1782 |
- except ImportError: from md5 import md5 |
1783 |
-@@ -172,9 +172,9 @@ try: |
1784 |
- 'csv-only-load', |
1785 |
- 'csv=', 'csv-ext=', |
1786 |
- 'imdbids=', 'help']) |
1787 |
--except getopt.error, e: |
1788 |
-- print 'Troubles with arguments.' |
1789 |
-- print HELP |
1790 |
-+except getopt.error as e: |
1791 |
-+ print('Troubles with arguments.') |
1792 |
-+ print(HELP) |
1793 |
- sys.exit(2) |
1794 |
- |
1795 |
- for opt in optlist: |
1796 |
-@@ -190,11 +190,11 @@ for opt in optlist: |
1797 |
- IMDBIDS_METHOD = opt[1] |
1798 |
- elif opt[0] in ('-e', '--execute'): |
1799 |
- if opt[1].find(':') == -1: |
1800 |
-- print 'WARNING: wrong command syntax: "%s"' % opt[1] |
1801 |
-+ print('WARNING: wrong command syntax: "%s"' % opt[1]) |
1802 |
- continue |
1803 |
- when, cmd = opt[1].split(':', 1) |
1804 |
- if when not in ALLOWED_TIMES: |
1805 |
-- print 'WARNING: unknown time: "%s"' % when |
1806 |
-+ print('WARNING: unknown time: "%s"' % when) |
1807 |
- continue |
1808 |
- if when == 'BEFORE_EVERY_TODB': |
1809 |
- for nw in ('BEFORE_MOVIES_TODB', 'BEFORE_PERSONS_TODB', |
1810 |
-@@ -217,27 +217,27 @@ for opt in optlist: |
1811 |
- elif opt[0] == '--csv-only-load': |
1812 |
- CSV_ONLY_LOAD = True |
1813 |
- elif opt[0] in ('-h', '--help'): |
1814 |
-- print HELP |
1815 |
-+ print(HELP) |
1816 |
- sys.exit(0) |
1817 |
- |
1818 |
- if IMDB_PTDF_DIR is None: |
1819 |
-- print 'You must supply the directory with the plain text data files' |
1820 |
-- print HELP |
1821 |
-+ print('You must supply the directory with the plain text data files') |
1822 |
-+ print(HELP) |
1823 |
- sys.exit(2) |
1824 |
- |
1825 |
- if URI is None: |
1826 |
-- print 'You must supply the URI for the database connection' |
1827 |
-- print HELP |
1828 |
-+ print('You must supply the URI for the database connection') |
1829 |
-+ print(HELP) |
1830 |
- sys.exit(2) |
1831 |
- |
1832 |
- if IMDBIDS_METHOD not in (None, 'dbm', 'table'): |
1833 |
-- print 'the method to (re)store imdbIDs must be one of "dbm" or "table"' |
1834 |
-- print HELP |
1835 |
-+ print('the method to (re)store imdbIDs must be one of "dbm" or "table"') |
1836 |
-+ print(HELP) |
1837 |
- sys.exit(2) |
1838 |
- |
1839 |
- if (CSV_ONLY_WRITE or CSV_ONLY_LOAD) and not CSV_DIR: |
1840 |
-- print 'You must specify the CSV directory with the -c argument' |
1841 |
-- print HELP |
1842 |
-+ print('You must specify the CSV directory with the -c argument') |
1843 |
-+ print(HELP) |
1844 |
- sys.exit(3) |
1845 |
- |
1846 |
- |
1847 |
-@@ -247,44 +247,44 @@ URIlower = URI.lower() |
1848 |
- if URIlower.startswith('mysql'): |
1849 |
- if '--mysql-force-myisam' in sys.argv[1:] and \ |
1850 |
- '--mysql-innodb' in sys.argv[1:]: |
1851 |
-- print '\nWARNING: there is no sense in mixing the --mysql-innodb and\n'\ |
1852 |
-- '--mysql-force-myisam command line options!\n' |
1853 |
-+ print('\nWARNING: there is no sense in mixing the --mysql-innodb and\n'\ |
1854 |
-+ '--mysql-force-myisam command line options!\n') |
1855 |
- elif '--mysql-innodb' in sys.argv[1:]: |
1856 |
-- print "\nNOTICE: you've specified the --mysql-innodb command line\n"\ |
1857 |
-+ print("\nNOTICE: you've specified the --mysql-innodb command line\n"\ |
1858 |
- "option; you should do this ONLY IF your system uses InnoDB\n"\ |
1859 |
- "tables or you really want to use InnoDB; if you're running\n"\ |
1860 |
- "a MyISAM-based database, please omit any option; if you\n"\ |
1861 |
- "want to force MyISAM usage on a InnoDB-based database,\n"\ |
1862 |
-- "try the --mysql-force-myisam command line option, instead.\n" |
1863 |
-+ "try the --mysql-force-myisam command line option, instead.\n") |
1864 |
- elif '--mysql-force-myisam' in sys.argv[1:]: |
1865 |
-- print "\nNOTICE: you've specified the --mysql-force-myisam command\n"\ |
1866 |
-+ print("\nNOTICE: you've specified the --mysql-force-myisam command\n"\ |
1867 |
- "line option; you should do this ONLY IF your system uses\n"\ |
1868 |
-- "InnoDB tables and you want to use MyISAM tables, instead.\n" |
1869 |
-+ "InnoDB tables and you want to use MyISAM tables, instead.\n") |
1870 |
- else: |
1871 |
-- print "\nNOTICE: IF you're using InnoDB tables, data insertion can\n"\ |
1872 |
-+ print("\nNOTICE: IF you're using InnoDB tables, data insertion can\n"\ |
1873 |
- "be very slow; you can switch to MyISAM tables - forcing it\n"\ |
1874 |
- "with the --mysql-force-myisam option - OR use the\n"\ |
1875 |
- "--mysql-innodb command line option, but DON'T USE these if\n"\ |
1876 |
- "you're already working on MyISAM tables, because it will\n"\ |
1877 |
-- "force MySQL to use InnoDB, and performances will be poor.\n" |
1878 |
-+ "force MySQL to use InnoDB, and performances will be poor.\n") |
1879 |
- elif URIlower.startswith('mssql') and \ |
1880 |
- '--ms-sqlserver' not in sys.argv[1:]: |
1881 |
-- print "\nWARNING: you're using MS SQLServer without the --ms-sqlserver\n"\ |
1882 |
-- "command line option: if something goes wrong, try using it.\n" |
1883 |
-+ print("\nWARNING: you're using MS SQLServer without the --ms-sqlserver\n"\ |
1884 |
-+ "command line option: if something goes wrong, try using it.\n") |
1885 |
- elif URIlower.startswith('sqlite') and \ |
1886 |
- '--sqlite-transactions' not in sys.argv[1:]: |
1887 |
-- print "\nWARNING: you're using SQLite without the --sqlite-transactions\n"\ |
1888 |
-+ print("\nWARNING: you're using SQLite without the --sqlite-transactions\n"\ |
1889 |
- "command line option: you'll have very poor performances! Try\n"\ |
1890 |
-- "using it.\n" |
1891 |
-+ "using it.\n") |
1892 |
- if ('--mysql-force-myisam' in sys.argv[1:] and |
1893 |
- not URIlower.startswith('mysql')) or ('--mysql-innodb' in |
1894 |
- sys.argv[1:] and not URIlower.startswith('mysql')) or ('--ms-sqlserver' |
1895 |
- in sys.argv[1:] and not URIlower.startswith('mssql')) or \ |
1896 |
- ('--sqlite-transactions' in sys.argv[1:] and |
1897 |
- not URIlower.startswith('sqlite')): |
1898 |
-- print "\nWARNING: you've specified command line options that don't\n"\ |
1899 |
-+ print("\nWARNING: you've specified command line options that don't\n"\ |
1900 |
- "belong to the database server you're using: proceed at your\n"\ |
1901 |
-- "own risk!\n" |
1902 |
-+ "own risk!\n") |
1903 |
- |
1904 |
- |
1905 |
- if CSV_DIR: |
1906 |
-@@ -296,7 +296,7 @@ if CSV_DIR: |
1907 |
- CSV_LOAD_SQL = CSV_DB2 |
1908 |
- CSV_NULL = '' |
1909 |
- else: |
1910 |
-- print "\nERROR: importing CSV files is not supported for this database" |
1911 |
-+ print("\nERROR: importing CSV files is not supported for this database") |
1912 |
- sys.exit(3) |
1913 |
- |
1914 |
- |
1915 |
-@@ -325,7 +325,7 @@ for idx, mod in enumerate(USE_ORM): |
1916 |
- warnings.warn('falling back to "%s".' % mod) |
1917 |
- USED_ORM = mod |
1918 |
- break |
1919 |
-- except ImportError, e: |
1920 |
-+ except ImportError as e: |
1921 |
- if idx+1 >= nrMods: |
1922 |
- raise IMDbError('unable to use any ORM in %s: %s' % ( |
1923 |
- str(USE_ORM), str(e))) |
1924 |
-@@ -384,7 +384,7 @@ class CSVCursor(object): |
1925 |
- if val is None: |
1926 |
- r[idx] = null |
1927 |
- continue |
1928 |
-- if (not quoteInteger) and isinstance(val, (int, long)): |
1929 |
-+ if (not quoteInteger) and isinstance(val, int): |
1930 |
- r[idx] = str(val) |
1931 |
- continue |
1932 |
- if lobFD and idx == 3: |
1933 |
-@@ -468,7 +468,7 @@ class CSVCursor(object): |
1934 |
- |
1935 |
- def fileNames(self): |
1936 |
- """Return the list of file names.""" |
1937 |
-- return [fd.name for fd in self._fdPool.values()] |
1938 |
-+ return [fd.name for fd in list(self._fdPool.values())] |
1939 |
- |
1940 |
- def buildFakeFileNames(self): |
1941 |
- """Populate the self._fdPool dictionary with fake objects |
1942 |
-@@ -491,9 +491,9 @@ class CSVCursor(object): |
1943 |
- |
1944 |
- def closeAll(self): |
1945 |
- """Close all open file descriptors.""" |
1946 |
-- for fd in self._fdPool.values(): |
1947 |
-+ for fd in list(self._fdPool.values()): |
1948 |
- fd.close() |
1949 |
-- for fd in self._lobFDPool.values(): |
1950 |
-+ for fd in list(self._lobFDPool.values()): |
1951 |
- fd.close() |
1952 |
- |
1953 |
- |
1954 |
-@@ -508,7 +508,7 @@ def loadCSVFiles(): |
1955 |
- CSV_REPL['file'] = cfName |
1956 |
- CSV_REPL['table'] = tName |
1957 |
- sqlStr = CSV_LOAD_SQL % CSV_REPL |
1958 |
-- print ' * LOADING CSV FILE %s...' % cfName |
1959 |
-+ print(' * LOADING CSV FILE %s...' % cfName) |
1960 |
- sys.stdout.flush() |
1961 |
- executeCustomQueries('BEFORE_CSV_TODB') |
1962 |
- try: |
1963 |
-@@ -516,11 +516,11 @@ def loadCSVFiles(): |
1964 |
- try: |
1965 |
- res = CURS.fetchall() |
1966 |
- if res: |
1967 |
-- print 'LOADING OUTPUT:', res |
1968 |
-+ print('LOADING OUTPUT:', res) |
1969 |
- except: |
1970 |
- pass |
1971 |
-- except Exception, e: |
1972 |
-- print 'ERROR: unable to import CSV file %s: %s' % (cfName, str(e)) |
1973 |
-+ except Exception as e: |
1974 |
-+ print('ERROR: unable to import CSV file %s: %s' % (cfName, str(e))) |
1975 |
- continue |
1976 |
- connectObject.commit() |
1977 |
- executeCustomQueries('AFTER_CSV_TODB') |
1978 |
-@@ -536,13 +536,13 @@ if CSV_DIR: |
1979 |
- # Extract exceptions to trap. |
1980 |
- try: |
1981 |
- OperationalError = conn.module.OperationalError |
1982 |
--except AttributeError, e: |
1983 |
-+except AttributeError as e: |
1984 |
- warnings.warn('Unable to import OperationalError; report this as a bug, ' \ |
1985 |
- 'since it will mask important exceptions: %s' % e) |
1986 |
- OperationalError = Exception |
1987 |
- try: |
1988 |
- IntegrityError = conn.module.IntegrityError |
1989 |
--except AttributeError, e: |
1990 |
-+except AttributeError as e: |
1991 |
- warnings.warn('Unable to import IntegrityError') |
1992 |
- IntegrityError = Exception |
1993 |
- |
1994 |
-@@ -601,7 +601,7 @@ def _makeConvNamed(cols): |
1995 |
- def _converter(params): |
1996 |
- for paramIndex, paramSet in enumerate(params): |
1997 |
- d = {} |
1998 |
-- for i in xrange(nrCols): |
1999 |
-+ for i in range(nrCols): |
2000 |
- d[cols[i]] = paramSet[i] |
2001 |
- params[paramIndex] = d |
2002 |
- return params |
2003 |
-@@ -653,7 +653,7 @@ def _(s, truncateAt=None): |
2004 |
- """Nicely print a string to sys.stdout, optionally |
2005 |
- truncating it a the given char.""" |
2006 |
- if not isinstance(s, UnicodeType): |
2007 |
-- s = unicode(s, 'utf_8') |
2008 |
-+ s = str(s, 'utf_8') |
2009 |
- if truncateAt is not None: |
2010 |
- s = s[:truncateAt] |
2011 |
- s = s.encode(sys.stdout.encoding or 'utf_8', 'replace') |
2012 |
-@@ -689,9 +689,9 @@ def t(s, sinceBegin=False): |
2013 |
- else: |
2014 |
- ct = BEGIN_TIME |
2015 |
- cts = BEGIN_TIMES |
2016 |
-- print '# TIME', s, \ |
2017 |
-+ print('# TIME', s, \ |
2018 |
- ': %dmin, %dsec (wall) %dmin, %dsec (user) %dmin, %dsec (system)' \ |
2019 |
-- % _minSec(nt-ct, ntimes[0]-cts[0], ntimes[1]-cts[1]) |
2020 |
-+ % _minSec(nt-ct, ntimes[0]-cts[0], ntimes[1]-cts[1])) |
2021 |
- if not sinceBegin: |
2022 |
- CTIME = nt |
2023 |
- CTIMES = ntimes |
2024 |
-@@ -801,13 +801,13 @@ class SourceFile(GzipFile): |
2025 |
- filename = os.path.join(IMDB_PTDF_DIR, filename) |
2026 |
- try: |
2027 |
- GzipFile.__init__(self, filename, mode, *args, **kwds) |
2028 |
-- except IOError, e: |
2029 |
-+ except IOError as e: |
2030 |
- if not pwarning: raise |
2031 |
-- print 'WARNING WARNING WARNING' |
2032 |
-- print 'WARNING unable to read the "%s" file.' % filename |
2033 |
-- print 'WARNING The file will be skipped, and the contained' |
2034 |
-- print 'WARNING information will NOT be stored in the database.' |
2035 |
-- print 'WARNING Complete error: ', e |
2036 |
-+ print('WARNING WARNING WARNING') |
2037 |
-+ print('WARNING unable to read the "%s" file.' % filename) |
2038 |
-+ print('WARNING The file will be skipped, and the contained') |
2039 |
-+ print('WARNING information will NOT be stored in the database.') |
2040 |
-+ print('WARNING Complete error: ', e) |
2041 |
- # re-raise the exception. |
2042 |
- raise |
2043 |
- self.start = start |
2044 |
-@@ -827,12 +827,12 @@ class SourceFile(GzipFile): |
2045 |
- |
2046 |
- def readline_NOcheckEnd(self, size=-1): |
2047 |
- line = GzipFile.readline(self, size) |
2048 |
-- return unicode(line, 'latin_1').encode('utf_8') |
2049 |
-+ return str(line, 'latin_1').encode('utf_8') |
2050 |
- |
2051 |
- def readline_checkEnd(self, size=-1): |
2052 |
- line = GzipFile.readline(self, size) |
2053 |
- if self.stop is not None and line[:self.stoplen] == self.stop: return '' |
2054 |
-- return unicode(line, 'latin_1').encode('utf_8') |
2055 |
-+ return str(line, 'latin_1').encode('utf_8') |
2056 |
- |
2057 |
- def getByHashSections(self): |
2058 |
- return getSectionHash(self) |
2059 |
-@@ -902,7 +902,7 @@ class _BaseCache(dict): |
2060 |
- self._table_name = '' |
2061 |
- self._id_for_custom_q = '' |
2062 |
- if d is not None: |
2063 |
-- for k, v in d.iteritems(): self[k] = v |
2064 |
-+ for k, v in d.items(): self[k] = v |
2065 |
- |
2066 |
- def __setitem__(self, key, counter): |
2067 |
- """Every time a key is set, its value is the counter; |
2068 |
-@@ -921,8 +921,8 @@ class _BaseCache(dict): |
2069 |
- if self._flushing: return |
2070 |
- self._flushing = 1 |
2071 |
- if _recursionLevel >= MAX_RECURSION: |
2072 |
-- print 'WARNING recursion level exceded trying to flush data' |
2073 |
-- print 'WARNING this batch of data is lost (%s).' % self.className |
2074 |
-+ print('WARNING recursion level exceded trying to flush data') |
2075 |
-+ print('WARNING this batch of data is lost (%s).' % self.className) |
2076 |
- self._tmpDict.clear() |
2077 |
- return |
2078 |
- if self._tmpDict: |
2079 |
-@@ -937,7 +937,7 @@ class _BaseCache(dict): |
2080 |
- _keys=keys, _timeit=False) |
2081 |
- _after_has_run = True |
2082 |
- self._tmpDict.clear() |
2083 |
-- except OperationalError, e: |
2084 |
-+ except OperationalError as e: |
2085 |
- # XXX: I'm not sure this is the right thing (and way) |
2086 |
- # to proceed. |
2087 |
- if not _after_has_run: |
2088 |
-@@ -952,28 +952,28 @@ class _BaseCache(dict): |
2089 |
- firstHalf = {} |
2090 |
- poptmpd = self._tmpDict.popitem |
2091 |
- originalLength = len(self._tmpDict) |
2092 |
-- for x in xrange(1 + originalLength/2): |
2093 |
-+ for x in range(1 + originalLength/2): |
2094 |
- k, v = poptmpd() |
2095 |
- firstHalf[k] = v |
2096 |
-- print ' * TOO MANY DATA (%s items in %s), recursion: %s' % \ |
2097 |
-+ print(' * TOO MANY DATA (%s items in %s), recursion: %s' % \ |
2098 |
- (originalLength, |
2099 |
- self.className, |
2100 |
-+ _recursionLevel)) |
2101 |
-+ print(' * SPLITTING (run 1 of 2), recursion: %s' % \ |
2102 |
- _recursionLevel) |
2103 |
-- print ' * SPLITTING (run 1 of 2), recursion: %s' % \ |
2104 |
-- _recursionLevel |
2105 |
- self.flush(quiet=quiet, _recursionLevel=_recursionLevel) |
2106 |
- self._tmpDict = firstHalf |
2107 |
-- print ' * SPLITTING (run 2 of 2), recursion: %s' % \ |
2108 |
-- _recursionLevel |
2109 |
-+ print(' * SPLITTING (run 2 of 2), recursion: %s' % \ |
2110 |
-+ _recursionLevel) |
2111 |
- self.flush(quiet=quiet, _recursionLevel=_recursionLevel) |
2112 |
- self._tmpDict.clear() |
2113 |
-- except Exception, e: |
2114 |
-+ except Exception as e: |
2115 |
- if isinstance(e, KeyboardInterrupt): |
2116 |
- raise |
2117 |
-- print 'WARNING: unknown exception caught committing the data' |
2118 |
-- print 'WARNING: to the database; report this as a bug, since' |
2119 |
-- print 'WARNING: many data (%d items) were lost: %s' % \ |
2120 |
-- (len(self._tmpDict), e) |
2121 |
-+ print('WARNING: unknown exception caught committing the data') |
2122 |
-+ print('WARNING: to the database; report this as a bug, since') |
2123 |
-+ print('WARNING: many data (%d items) were lost: %s' % \ |
2124 |
-+ (len(self._tmpDict), e)) |
2125 |
- self._flushing = 0 |
2126 |
- # Flush also deferred data. |
2127 |
- if self._deferredData: |
2128 |
-@@ -992,7 +992,7 @@ class _BaseCache(dict): |
2129 |
- |
2130 |
- def add(self, key, miscData=None): |
2131 |
- """Insert a new key and return its value.""" |
2132 |
-- c = self.counter.next() |
2133 |
-+ c = next(self.counter) |
2134 |
- # miscData=[('a_dict', 'value')] will set self.a_dict's c key |
2135 |
- # to 'value'. |
2136 |
- if miscData is not None: |
2137 |
-@@ -1033,7 +1033,7 @@ class MoviesCache(_BaseCache): |
2138 |
- 'md5sum')) |
2139 |
- |
2140 |
- def populate(self): |
2141 |
-- print ' * POPULATING %s...' % self.className |
2142 |
-+ print(' * POPULATING %s...' % self.className) |
2143 |
- titleTbl = tableName(Title) |
2144 |
- movieidCol = colName(Title, 'id') |
2145 |
- titleCol = colName(Title, 'title') |
2146 |
-@@ -1072,7 +1072,7 @@ class MoviesCache(_BaseCache): |
2147 |
- |
2148 |
- def _toDB(self, quiet=0): |
2149 |
- if not quiet: |
2150 |
-- print ' * FLUSHING %s...' % self.className |
2151 |
-+ print(' * FLUSHING %s...' % self.className) |
2152 |
- sys.stdout.flush() |
2153 |
- l = [] |
2154 |
- lapp = l.append |
2155 |
-@@ -1082,8 +1082,8 @@ class MoviesCache(_BaseCache): |
2156 |
- t = analyze_title(k, _emptyString='') |
2157 |
- except IMDbParserError: |
2158 |
- if k and k.strip(): |
2159 |
-- print 'WARNING %s._toDB() invalid title:' % self.className, |
2160 |
-- print _(k) |
2161 |
-+ print('WARNING %s._toDB() invalid title:' % self.className, end=' ') |
2162 |
-+ print(_(k)) |
2163 |
- continue |
2164 |
- tget = t.get |
2165 |
- episodeOf = None |
2166 |
-@@ -1141,7 +1141,7 @@ class PersonsCache(_BaseCache): |
2167 |
- 'namePcodeNf', 'surnamePcode', 'md5sum']) |
2168 |
- |
2169 |
- def populate(self): |
2170 |
-- print ' * POPULATING PersonsCache...' |
2171 |
-+ print(' * POPULATING PersonsCache...') |
2172 |
- nameTbl = tableName(Name) |
2173 |
- personidCol = colName(Name, 'id') |
2174 |
- nameCol = colName(Name, 'name') |
2175 |
-@@ -1160,7 +1160,7 @@ class PersonsCache(_BaseCache): |
2176 |
- |
2177 |
- def _toDB(self, quiet=0): |
2178 |
- if not quiet: |
2179 |
-- print ' * FLUSHING PersonsCache...' |
2180 |
-+ print(' * FLUSHING PersonsCache...') |
2181 |
- sys.stdout.flush() |
2182 |
- l = [] |
2183 |
- lapp = l.append |
2184 |
-@@ -1170,7 +1170,7 @@ class PersonsCache(_BaseCache): |
2185 |
- t = analyze_name(k) |
2186 |
- except IMDbParserError: |
2187 |
- if k and k.strip(): |
2188 |
-- print 'WARNING PersonsCache._toDB() invalid name:', _(k) |
2189 |
-+ print('WARNING PersonsCache._toDB() invalid name:', _(k)) |
2190 |
- continue |
2191 |
- tget = t.get |
2192 |
- name = tget('name') |
2193 |
-@@ -1199,7 +1199,7 @@ class CharactersCache(_BaseCache): |
2194 |
- 'surnamePcode', 'md5sum']) |
2195 |
- |
2196 |
- def populate(self): |
2197 |
-- print ' * POPULATING CharactersCache...' |
2198 |
-+ print(' * POPULATING CharactersCache...') |
2199 |
- nameTbl = tableName(CharName) |
2200 |
- personidCol = colName(CharName, 'id') |
2201 |
- nameCol = colName(CharName, 'name') |
2202 |
-@@ -1218,7 +1218,7 @@ class CharactersCache(_BaseCache): |
2203 |
- |
2204 |
- def _toDB(self, quiet=0): |
2205 |
- if not quiet: |
2206 |
-- print ' * FLUSHING CharactersCache...' |
2207 |
-+ print(' * FLUSHING CharactersCache...') |
2208 |
- sys.stdout.flush() |
2209 |
- l = [] |
2210 |
- lapp = l.append |
2211 |
-@@ -1228,7 +1228,7 @@ class CharactersCache(_BaseCache): |
2212 |
- t = analyze_name(k) |
2213 |
- except IMDbParserError: |
2214 |
- if k and k.strip(): |
2215 |
-- print 'WARNING CharactersCache._toDB() invalid name:', _(k) |
2216 |
-+ print('WARNING CharactersCache._toDB() invalid name:', _(k)) |
2217 |
- continue |
2218 |
- tget = t.get |
2219 |
- name = tget('name') |
2220 |
-@@ -1256,7 +1256,7 @@ class CompaniesCache(_BaseCache): |
2221 |
- 'namePcodeSf', 'md5sum']) |
2222 |
- |
2223 |
- def populate(self): |
2224 |
-- print ' * POPULATING CharactersCache...' |
2225 |
-+ print(' * POPULATING CharactersCache...') |
2226 |
- nameTbl = tableName(CompanyName) |
2227 |
- companyidCol = colName(CompanyName, 'id') |
2228 |
- nameCol = colName(CompanyName, 'name') |
2229 |
-@@ -1275,7 +1275,7 @@ class CompaniesCache(_BaseCache): |
2230 |
- |
2231 |
- def _toDB(self, quiet=0): |
2232 |
- if not quiet: |
2233 |
-- print ' * FLUSHING CompaniesCache...' |
2234 |
-+ print(' * FLUSHING CompaniesCache...') |
2235 |
- sys.stdout.flush() |
2236 |
- l = [] |
2237 |
- lapp = l.append |
2238 |
-@@ -1285,7 +1285,7 @@ class CompaniesCache(_BaseCache): |
2239 |
- t = analyze_company_name(k) |
2240 |
- except IMDbParserError: |
2241 |
- if k and k.strip(): |
2242 |
-- print 'WARNING CompaniesCache._toDB() invalid name:', _(k) |
2243 |
-+ print('WARNING CompaniesCache._toDB() invalid name:', _(k)) |
2244 |
- continue |
2245 |
- tget = t.get |
2246 |
- name = tget('name') |
2247 |
-@@ -1316,7 +1316,7 @@ class KeywordsCache(_BaseCache): |
2248 |
- 'phoneticCode']) |
2249 |
- |
2250 |
- def populate(self): |
2251 |
-- print ' * POPULATING KeywordsCache...' |
2252 |
-+ print(' * POPULATING KeywordsCache...') |
2253 |
- nameTbl = tableName(CompanyName) |
2254 |
- keywordidCol = colName(Keyword, 'id') |
2255 |
- keyCol = colName(Keyword, 'name') |
2256 |
-@@ -1331,7 +1331,7 @@ class KeywordsCache(_BaseCache): |
2257 |
- |
2258 |
- def _toDB(self, quiet=0): |
2259 |
- if not quiet: |
2260 |
-- print ' * FLUSHING KeywordsCache...' |
2261 |
-+ print(' * FLUSHING KeywordsCache...') |
2262 |
- sys.stdout.flush() |
2263 |
- l = [] |
2264 |
- lapp = l.append |
2265 |
-@@ -1365,7 +1365,7 @@ class SQLData(dict): |
2266 |
- self._recursionLevel = 1 |
2267 |
- self._table = table |
2268 |
- self._table_name = tableName(table) |
2269 |
-- for k, v in d.items(): self[k] = v |
2270 |
-+ for k, v in list(d.items()): self[k] = v |
2271 |
- |
2272 |
- def __setitem__(self, key, value): |
2273 |
- """The value is discarded, the counter is used as the 'real' key |
2274 |
-@@ -1388,8 +1388,8 @@ class SQLData(dict): |
2275 |
- CACHE_PID.flush(quiet=1) |
2276 |
- if _resetRecursion: self._recursionLevel = 1 |
2277 |
- if self._recursionLevel >= MAX_RECURSION: |
2278 |
-- print 'WARNING recursion level exceded trying to flush data' |
2279 |
-- print 'WARNING this batch of data is lost.' |
2280 |
-+ print('WARNING recursion level exceded trying to flush data') |
2281 |
-+ print('WARNING this batch of data is lost.') |
2282 |
- self.clear() |
2283 |
- self.counter = self.counterInit |
2284 |
- return |
2285 |
-@@ -1404,12 +1404,12 @@ class SQLData(dict): |
2286 |
- _after_has_run = True |
2287 |
- self.clear() |
2288 |
- self.counter = self.counterInit |
2289 |
-- except OperationalError, e: |
2290 |
-+ except OperationalError as e: |
2291 |
- if not _after_has_run: |
2292 |
- executeCustomQueries('AFTER_SQLDATA_TODB', _keys=keys, |
2293 |
- _timeit=False) |
2294 |
-- print ' * TOO MANY DATA (%s items), SPLITTING (run #%d)...' % \ |
2295 |
-- (len(self), self._recursionLevel) |
2296 |
-+ print(' * TOO MANY DATA (%s items), SPLITTING (run #%d)...' % \ |
2297 |
-+ (len(self), self._recursionLevel)) |
2298 |
- self._recursionLevel += 1 |
2299 |
- newdata = self.__class__(table=self._table, |
2300 |
- sqlString=self.sqlString, |
2301 |
-@@ -1417,8 +1417,8 @@ class SQLData(dict): |
2302 |
- newdata._recursionLevel = self._recursionLevel |
2303 |
- newflushEvery = self.flushEvery / 2 |
2304 |
- if newflushEvery < 1: |
2305 |
-- print 'WARNING recursion level exceded trying to flush data' |
2306 |
-- print 'WARNING this batch of data is lost.' |
2307 |
-+ print('WARNING recursion level exceded trying to flush data') |
2308 |
-+ print('WARNING this batch of data is lost.') |
2309 |
- self.clear() |
2310 |
- self.counter = self.counterInit |
2311 |
- return |
2312 |
-@@ -1426,7 +1426,7 @@ class SQLData(dict): |
2313 |
- newdata.flushEvery = newflushEvery |
2314 |
- popitem = self.popitem |
2315 |
- dsi = dict.__setitem__ |
2316 |
-- for x in xrange(len(self)/2): |
2317 |
-+ for x in range(len(self)/2): |
2318 |
- k, v = popitem() |
2319 |
- dsi(newdata, k, v) |
2320 |
- newdata.flush(_resetRecursion=0) |
2321 |
-@@ -1434,21 +1434,21 @@ class SQLData(dict): |
2322 |
- self.flush(_resetRecursion=0) |
2323 |
- self.clear() |
2324 |
- self.counter = self.counterInit |
2325 |
-- except Exception, e: |
2326 |
-+ except Exception as e: |
2327 |
- if isinstance(e, KeyboardInterrupt): |
2328 |
- raise |
2329 |
-- print 'WARNING: unknown exception caught committing the data' |
2330 |
-- print 'WARNING: to the database; report this as a bug, since' |
2331 |
-- print 'WARNING: many data (%d items) were lost: %s' % \ |
2332 |
-- (len(self), e) |
2333 |
-+ print('WARNING: unknown exception caught committing the data') |
2334 |
-+ print('WARNING: to the database; report this as a bug, since') |
2335 |
-+ print('WARNING: many data (%d items) were lost: %s' % \ |
2336 |
-+ (len(self), e)) |
2337 |
- connectObject.commit() |
2338 |
- |
2339 |
- def _toDB(self): |
2340 |
-- print ' * FLUSHING SQLData...' |
2341 |
-+ print(' * FLUSHING SQLData...') |
2342 |
- if not CSV_DIR: |
2343 |
-- CURS.executemany(self.sqlString, self.converter(self.values())) |
2344 |
-+ CURS.executemany(self.sqlString, self.converter(list(self.values()))) |
2345 |
- else: |
2346 |
-- CSV_CURS.executemany(self.sqlString, self.values()) |
2347 |
-+ CSV_CURS.executemany(self.sqlString, list(self.values())) |
2348 |
- |
2349 |
- |
2350 |
- # Miscellaneous functions. |
2351 |
-@@ -1465,7 +1465,7 @@ def unpack(line, headers, sep='\t'): |
2352 |
- 'rating': '8.4', 'title': 'Incredibles, The (2004)'} |
2353 |
- """ |
2354 |
- r = {} |
2355 |
-- ls1 = filter(None, line.split(sep)) |
2356 |
-+ ls1 = [_f for _f in line.split(sep) if _f] |
2357 |
- for index, item in enumerate(ls1): |
2358 |
- try: name = headers[index] |
2359 |
- except IndexError: name = 'item%s' % index |
2360 |
-@@ -1523,8 +1523,8 @@ def readMovieList(): |
2361 |
- if mid is None: |
2362 |
- continue |
2363 |
- if count % 10000 == 0: |
2364 |
-- print 'SCANNING movies:', _(title), |
2365 |
-- print '(movieID: %s)' % mid |
2366 |
-+ print('SCANNING movies:', _(title), end=' ') |
2367 |
-+ print('(movieID: %s)' % mid) |
2368 |
- count += 1 |
2369 |
- CACHE_MID.flush() |
2370 |
- CACHE_MID.movieYear.clear() |
2371 |
-@@ -1543,7 +1543,7 @@ def doCast(fp, roleid, rolename): |
2372 |
- for line in fp: |
2373 |
- if line and line[0] != '\t': |
2374 |
- if line[0] == '\n': continue |
2375 |
-- sl = filter(None, line.split('\t')) |
2376 |
-+ sl = [_f for _f in line.split('\t') if _f] |
2377 |
- if len(sl) != 2: continue |
2378 |
- name, line = sl |
2379 |
- miscData = None |
2380 |
-@@ -1580,33 +1580,33 @@ def doCast(fp, roleid, rolename): |
2381 |
- elif item[0] == '<': |
2382 |
- textor = item[1:-1] |
2383 |
- try: |
2384 |
-- order = long(textor) |
2385 |
-+ order = int(textor) |
2386 |
- except ValueError: |
2387 |
- os = textor.split(',') |
2388 |
- if len(os) == 3: |
2389 |
- try: |
2390 |
-- order = ((long(os[2])-1) * 1000) + \ |
2391 |
-- ((long(os[1])-1) * 100) + (long(os[0])-1) |
2392 |
-+ order = ((int(os[2])-1) * 1000) + \ |
2393 |
-+ ((int(os[1])-1) * 100) + (int(os[0])-1) |
2394 |
- except ValueError: |
2395 |
- pass |
2396 |
- movieid = CACHE_MID.addUnique(title) |
2397 |
- if movieid is None: |
2398 |
- continue |
2399 |
- if role is not None: |
2400 |
-- roles = filter(None, [x.strip() for x in role.split('/')]) |
2401 |
-+ roles = [_f for _f in [x.strip() for x in role.split('/')] if _f] |
2402 |
- for role in roles: |
2403 |
- cid = CACHE_CID.addUnique(role) |
2404 |
- sqldata.add((pid, movieid, cid, note, order)) |
2405 |
- else: |
2406 |
- sqldata.add((pid, movieid, None, note, order)) |
2407 |
- if count % 10000 == 0: |
2408 |
-- print 'SCANNING %s:' % rolename, |
2409 |
-- print _(name) |
2410 |
-+ print('SCANNING %s:' % rolename, end=' ') |
2411 |
-+ print(_(name)) |
2412 |
- count += 1 |
2413 |
- sqldata.flush() |
2414 |
- CACHE_PID.flush() |
2415 |
- CACHE_PID.personGender.clear() |
2416 |
-- print 'CLOSING %s...' % rolename |
2417 |
-+ print('CLOSING %s...' % rolename) |
2418 |
- |
2419 |
- |
2420 |
- def castLists(): |
2421 |
-@@ -1620,7 +1620,7 @@ def castLists(): |
2422 |
- if fname == 'actress': fname = 'actresses.list.gz' |
2423 |
- elif fname == 'miscellaneous-crew': fname = 'miscellaneous.list.gz' |
2424 |
- else: fname = fname + 's.list.gz' |
2425 |
-- print 'DOING', fname |
2426 |
-+ print('DOING', fname) |
2427 |
- try: |
2428 |
- f = SourceFile(fname, start=CAST_START, stop=CAST_STOP) |
2429 |
- except IOError: |
2430 |
-@@ -1658,7 +1658,7 @@ def doAkaNames(): |
2431 |
- try: |
2432 |
- name_dict = analyze_name(line) |
2433 |
- except IMDbParserError: |
2434 |
-- if line: print 'WARNING doAkaNames wrong name:', _(line) |
2435 |
-+ if line: print('WARNING doAkaNames wrong name:', _(line)) |
2436 |
- continue |
2437 |
- name = name_dict.get('name') |
2438 |
- namePcodeCf, namePcodeNf, surnamePcode = name_soundexes(name) |
2439 |
-@@ -1666,7 +1666,7 @@ def doAkaNames(): |
2440 |
- namePcodeCf, namePcodeNf, surnamePcode, |
2441 |
- md5(line).hexdigest())) |
2442 |
- if count % 10000 == 0: |
2443 |
-- print 'SCANNING akanames:', _(line) |
2444 |
-+ print('SCANNING akanames:', _(line)) |
2445 |
- count += 1 |
2446 |
- sqldata.flush() |
2447 |
- fp.close() |
2448 |
-@@ -1761,8 +1761,8 @@ def doAkaTitles(): |
2449 |
- tonD = analyze_title(line, _emptyString='') |
2450 |
- except IMDbParserError: |
2451 |
- if line: |
2452 |
-- print 'WARNING doAkaTitles(obsol O) invalid title:', |
2453 |
-- print _(line) |
2454 |
-+ print('WARNING doAkaTitles(obsol O) invalid title:', end=' ') |
2455 |
-+ print(_(line)) |
2456 |
- continue |
2457 |
- tonD['title'] = normalizeTitle(tonD['title']) |
2458 |
- line = build_title(tonD, ptdf=1, _emptyString='') |
2459 |
-@@ -1779,8 +1779,8 @@ def doAkaTitles(): |
2460 |
- titleDict = analyze_title(line, _emptyString='') |
2461 |
- except IMDbParserError: |
2462 |
- if line: |
2463 |
-- print 'WARNING doAkaTitles (O) invalid title:', |
2464 |
-- print _(line) |
2465 |
-+ print('WARNING doAkaTitles (O) invalid title:', end=' ') |
2466 |
-+ print(_(line)) |
2467 |
- continue |
2468 |
- if 'episode of' in titleDict: |
2469 |
- if obsolete: |
2470 |
-@@ -1820,14 +1820,14 @@ def doAkaTitles(): |
2471 |
- akatD = analyze_title(akat, _emptyString='') |
2472 |
- except IMDbParserError: |
2473 |
- if line: |
2474 |
-- print 'WARNING doAkaTitles(obsol) invalid title:', |
2475 |
-- print _(akat) |
2476 |
-+ print('WARNING doAkaTitles(obsol) invalid title:', end=' ') |
2477 |
-+ print(_(akat)) |
2478 |
- continue |
2479 |
- akatD['title'] = normalizeTitle(akatD['title']) |
2480 |
- akat = build_title(akatD, ptdf=1, _emptyString='') |
2481 |
- if count % 10000 == 0: |
2482 |
-- print 'SCANNING %s:' % fname[:-8].replace('-', ' '), |
2483 |
-- print _(akat) |
2484 |
-+ print('SCANNING %s:' % fname[:-8].replace('-', ' '), end=' ') |
2485 |
-+ print(_(akat)) |
2486 |
- if isEpisode and seriesID is not None: |
2487 |
- # Handle series for which only single episodes have |
2488 |
- # aliases. |
2489 |
-@@ -1835,8 +1835,8 @@ def doAkaTitles(): |
2490 |
- akaDict = analyze_title(akat, _emptyString='') |
2491 |
- except IMDbParserError: |
2492 |
- if line: |
2493 |
-- print 'WARNING doAkaTitles (epis) invalid title:', |
2494 |
-- print _(akat) |
2495 |
-+ print('WARNING doAkaTitles (epis) invalid title:', end=' ') |
2496 |
-+ print(_(akat)) |
2497 |
- continue |
2498 |
- if 'episode of' in akaDict: |
2499 |
- if obsolete: |
2500 |
-@@ -1873,10 +1873,10 @@ def doMovieLinks(): |
2501 |
- if mid is None: |
2502 |
- continue |
2503 |
- if count % 10000 == 0: |
2504 |
-- print 'SCANNING movielinks:', _(title) |
2505 |
-+ print('SCANNING movielinks:', _(title)) |
2506 |
- else: |
2507 |
- line = line.strip() |
2508 |
-- link_txt = unicode(line, 'utf_8').encode('ascii', 'replace') |
2509 |
-+ link_txt = str(line, 'utf_8').encode('ascii', 'replace') |
2510 |
- theid = None |
2511 |
- for k, lenkp1, v in MOVIELINK_IDS: |
2512 |
- if link_txt and link_txt[0] == '(' \ |
2513 |
-@@ -1907,19 +1907,19 @@ def minusHashFiles(fp, funct, defaultid, descr): |
2514 |
- title = title.strip() |
2515 |
- d = funct(text.split('\n')) |
2516 |
- if not d: |
2517 |
-- print 'WARNING skipping empty information about title:', |
2518 |
-- print _(title) |
2519 |
-+ print('WARNING skipping empty information about title:', end=' ') |
2520 |
-+ print(_(title)) |
2521 |
- continue |
2522 |
- if not title: |
2523 |
-- print 'WARNING skipping information associated to empty title:', |
2524 |
-- print _(d[0], truncateAt=40) |
2525 |
-+ print('WARNING skipping information associated to empty title:', end=' ') |
2526 |
-+ print(_(d[0], truncateAt=40)) |
2527 |
- continue |
2528 |
- mid = CACHE_MID.addUnique(title) |
2529 |
- if mid is None: |
2530 |
- continue |
2531 |
- if count % 5000 == 0: |
2532 |
-- print 'SCANNING %s:' % descr, |
2533 |
-- print _(title) |
2534 |
-+ print('SCANNING %s:' % descr, end=' ') |
2535 |
-+ print(_(title)) |
2536 |
- for data in d: |
2537 |
- sqldata.add((mid, defaultid, data, None)) |
2538 |
- count += 1 |
2539 |
-@@ -1963,7 +1963,7 @@ def getTaglines(): |
2540 |
- tag = tag.strip() |
2541 |
- if not tag: continue |
2542 |
- if count % 10000 == 0: |
2543 |
-- print 'SCANNING taglines:', _(title) |
2544 |
-+ print('SCANNING taglines:', _(title)) |
2545 |
- sqldata.add((mid, INFO_TYPES['taglines'], tag, None)) |
2546 |
- count += 1 |
2547 |
- sqldata.flush() |
2548 |
-@@ -2001,12 +2001,12 @@ _bus = {'BT': 'budget', |
2549 |
- 'CP': 'copyright holder' |
2550 |
- } |
2551 |
- _usd = '$' |
2552 |
--_gbp = unichr(0x00a3).encode('utf_8') |
2553 |
--_eur = unichr(0x20ac).encode('utf_8') |
2554 |
-+_gbp = chr(0x00a3).encode('utf_8') |
2555 |
-+_eur = chr(0x20ac).encode('utf_8') |
2556 |
- def getBusiness(lines): |
2557 |
- """Movie's business information.""" |
2558 |
- bd = _parseColonList(lines, _bus) |
2559 |
-- for k in bd.keys(): |
2560 |
-+ for k in list(bd.keys()): |
2561 |
- nv = [] |
2562 |
- for v in bd[k]: |
2563 |
- v = v.replace('USD ',_usd).replace('GBP ',_gbp).replace('EUR',_eur) |
2564 |
-@@ -2066,13 +2066,13 @@ _ldk = {'OT': 'original title', |
2565 |
- 'LT': 'laserdisc title' |
2566 |
- } |
2567 |
- # Handle laserdisc keys. |
2568 |
--for key, value in _ldk.items(): |
2569 |
-+for key, value in list(_ldk.items()): |
2570 |
- _ldk[key] = 'LD %s' % value |
2571 |
- |
2572 |
- def getLaserDisc(lines): |
2573 |
- """Laserdisc information.""" |
2574 |
- d = _parseColonList(lines, _ldk) |
2575 |
-- for k, v in d.iteritems(): |
2576 |
-+ for k, v in d.items(): |
2577 |
- d[k] = ' '.join(v) |
2578 |
- return d |
2579 |
- |
2580 |
-@@ -2096,7 +2096,7 @@ _mpaa = {'RE': 'mpaa'} |
2581 |
- def getMPAA(lines): |
2582 |
- """Movie's mpaa information.""" |
2583 |
- d = _parseColonList(lines, _mpaa) |
2584 |
-- for k, v in d.iteritems(): |
2585 |
-+ for k, v in d.items(): |
2586 |
- d[k] = ' '.join(v) |
2587 |
- return d |
2588 |
- |
2589 |
-@@ -2152,16 +2152,16 @@ def nmmvFiles(fp, funct, fname): |
2590 |
- continue |
2591 |
- else: mopid = CACHE_PID.addUnique(ton) |
2592 |
- if count % 6000 == 0: |
2593 |
-- print 'SCANNING %s:' % fname[:-8].replace('-', ' '), |
2594 |
-- print _(ton) |
2595 |
-+ print('SCANNING %s:' % fname[:-8].replace('-', ' '), end=' ') |
2596 |
-+ print(_(ton)) |
2597 |
- d = funct(text.split('\n')) |
2598 |
-- for k, v in d.iteritems(): |
2599 |
-+ for k, v in d.items(): |
2600 |
- if k != 'notable tv guest appearances': |
2601 |
- theid = INFO_TYPES.get(k) |
2602 |
- if theid is None: |
2603 |
-- print 'WARNING key "%s" of ToN' % k, |
2604 |
-- print _(ton), |
2605 |
-- print 'not in INFO_TYPES' |
2606 |
-+ print('WARNING key "%s" of ToN' % k, end=' ') |
2607 |
-+ print(_(ton), end=' ') |
2608 |
-+ print('not in INFO_TYPES') |
2609 |
- continue |
2610 |
- if type(v) is _ltype: |
2611 |
- for i in v: |
2612 |
-@@ -2176,12 +2176,12 @@ def nmmvFiles(fp, funct, fname): |
2613 |
- continue |
2614 |
- crole = i.currentRole |
2615 |
- if isinstance(crole, list): |
2616 |
-- crole = ' / '.join([x.get('long imdb name', u'') |
2617 |
-+ crole = ' / '.join([x.get('long imdb name', '') |
2618 |
- for x in crole]) |
2619 |
- if not crole: |
2620 |
- crole = None |
2621 |
- else: |
2622 |
-- crole = unicode(crole).encode('utf_8') |
2623 |
-+ crole = str(crole).encode('utf_8') |
2624 |
- guestdata.add((mopid, movieid, crole, |
2625 |
- i.notes or None)) |
2626 |
- continue |
2627 |
-@@ -2315,7 +2315,7 @@ def _parseBiography(biol): |
2628 |
- rn = build_name(analyze_name(n, canonical=1), canonical=1) |
2629 |
- res['birth name'] = rn |
2630 |
- except IMDbParserError: |
2631 |
-- if line: print 'WARNING _parseBiography wrong name:', _(n) |
2632 |
-+ if line: print('WARNING _parseBiography wrong name:', _(n)) |
2633 |
- continue |
2634 |
- elif x6 == 'AT: * ': |
2635 |
- res.setdefault('article', []).append(x[6:].strip()) |
2636 |
-@@ -2406,8 +2406,8 @@ def doMovieCompaniesInfo(): |
2637 |
- if 'note' in data: |
2638 |
- note = data['note'] |
2639 |
- if count % 10000 == 0: |
2640 |
-- print 'SCANNING %s:' % dataf[0][:-8].replace('-', ' '), |
2641 |
-- print _(data['title']) |
2642 |
-+ print('SCANNING %s:' % dataf[0][:-8].replace('-', ' '), end=' ') |
2643 |
-+ print(_(data['title'])) |
2644 |
- sqldata.add((mid, cid, infoid, note)) |
2645 |
- count += 1 |
2646 |
- sqldata.flush() |
2647 |
-@@ -2461,8 +2461,8 @@ def doMiscMovieInfo(): |
2648 |
- if 'note' in data: |
2649 |
- note = data['note'] |
2650 |
- if count % 10000 == 0: |
2651 |
-- print 'SCANNING %s:' % dataf[0][:-8].replace('-', ' '), |
2652 |
-- print _(data['title']) |
2653 |
-+ print('SCANNING %s:' % dataf[0][:-8].replace('-', ' '), end=' ') |
2654 |
-+ print(_(data['title'])) |
2655 |
- info = data['info'] |
2656 |
- if typeindex == 'keywords': |
2657 |
- keywordID = CACHE_KWRDID.addUnique(info) |
2658 |
-@@ -2494,7 +2494,7 @@ def getRating(): |
2659 |
- if mid is None: |
2660 |
- continue |
2661 |
- if count % 10000 == 0: |
2662 |
-- print 'SCANNING rating:', _(title) |
2663 |
-+ print('SCANNING rating:', _(title)) |
2664 |
- sqldata.add((mid, INFO_TYPES['votes distribution'], |
2665 |
- data.get('votes distribution'), None)) |
2666 |
- sqldata.add((mid, INFO_TYPES['votes'], data.get('votes'), None)) |
2667 |
-@@ -2516,7 +2516,7 @@ def getTopBottomRating(): |
2668 |
- RawValue('infoTypeID', INFO_TYPES[what]), |
2669 |
- 'info', 'note']) |
2670 |
- count = 1 |
2671 |
-- print 'SCANNING %s...' % what |
2672 |
-+ print('SCANNING %s...' % what) |
2673 |
- for line in fp: |
2674 |
- data = unpack(line, ('votes distribution', 'votes', 'rank', |
2675 |
- 'title'), sep=' ') |
2676 |
-@@ -2576,8 +2576,8 @@ def completeCast(): |
2677 |
- if mid is None: |
2678 |
- continue |
2679 |
- if count % 10000 == 0: |
2680 |
-- print 'SCANNING %s:' % fname[:-8].replace('-', ' '), |
2681 |
-- print _(title) |
2682 |
-+ print('SCANNING %s:' % fname[:-8].replace('-', ' '), end=' ') |
2683 |
-+ print(_(title)) |
2684 |
- sqldata.add((mid, CCKind[ll[1].lower().strip()])) |
2685 |
- count += 1 |
2686 |
- fp.close() |
2687 |
-@@ -2633,7 +2633,7 @@ def readConstants(): |
2688 |
- def _imdbIDsFileName(fname): |
2689 |
- """Return a file name, adding the optional |
2690 |
- CSV_DIR directory.""" |
2691 |
-- return os.path.join(*(filter(None, [CSV_DIR, fname]))) |
2692 |
-+ return os.path.join(*([_f for _f in [CSV_DIR, fname] if _f])) |
2693 |
- |
2694 |
- |
2695 |
- def _countRows(tableName): |
2696 |
-@@ -2641,8 +2641,8 @@ def _countRows(tableName): |
2697 |
- try: |
2698 |
- CURS.execute('SELECT COUNT(*) FROM %s' % tableName) |
2699 |
- return (CURS.fetchone() or [0])[0] |
2700 |
-- except Exception, e: |
2701 |
-- print 'WARNING: unable to count rows of table %s: %s' % (tableName, e) |
2702 |
-+ except Exception as e: |
2703 |
-+ print('WARNING: unable to count rows of table %s: %s' % (tableName, e)) |
2704 |
- return 0 |
2705 |
- |
2706 |
- |
2707 |
-@@ -2658,7 +2658,7 @@ def storeNotNULLimdbIDs(cls): |
2708 |
- md5sum_col = colName(cls, 'md5sum') |
2709 |
- imdbID_col = colName(cls, 'imdbID') |
2710 |
- |
2711 |
-- print 'SAVING imdbID values for %s...' % cname, |
2712 |
-+ print('SAVING imdbID values for %s...' % cname, end=' ') |
2713 |
- sys.stdout.flush() |
2714 |
- if _get_imdbids_method() == 'table': |
2715 |
- try: |
2716 |
-@@ -2668,8 +2668,8 @@ def storeNotNULLimdbIDs(cls): |
2717 |
- pass |
2718 |
- try: |
2719 |
- CURS.execute('SELECT * FROM %s LIMIT 1' % table_name) |
2720 |
-- except Exception, e: |
2721 |
-- print 'missing "%s" table (ok if this is the first run)' % table_name |
2722 |
-+ except Exception as e: |
2723 |
-+ print('missing "%s" table (ok if this is the first run)' % table_name) |
2724 |
- return |
2725 |
- query = 'CREATE TEMPORARY TABLE %s_extract AS SELECT %s, %s FROM %s WHERE %s IS NOT NULL' % \ |
2726 |
- (table_name, md5sum_col, imdbID_col, |
2727 |
-@@ -2678,14 +2678,14 @@ def storeNotNULLimdbIDs(cls): |
2728 |
- CURS.execute('CREATE INDEX %s_md5sum_idx ON %s_extract (%s)' % (table_name, table_name, md5sum_col)) |
2729 |
- CURS.execute('CREATE INDEX %s_imdbid_idx ON %s_extract (%s)' % (table_name, table_name, imdbID_col)) |
2730 |
- rows = _countRows('%s_extract' % table_name) |
2731 |
-- print 'DONE! (%d entries using a temporary table)' % rows |
2732 |
-+ print('DONE! (%d entries using a temporary table)' % rows) |
2733 |
- return |
2734 |
-- except Exception, e: |
2735 |
-- print 'WARNING: unable to store imdbIDs in a temporary table (falling back to dbm): %s' % e |
2736 |
-+ except Exception as e: |
2737 |
-+ print('WARNING: unable to store imdbIDs in a temporary table (falling back to dbm): %s' % e) |
2738 |
- try: |
2739 |
-- db = anydbm.open(_imdbIDsFileName('%s_imdbIDs.db' % cname), 'c') |
2740 |
-- except Exception, e: |
2741 |
-- print 'WARNING: unable to store imdbIDs: %s' % str(e) |
2742 |
-+ db = dbm.open(_imdbIDsFileName('%s_imdbIDs.db' % cname), 'c') |
2743 |
-+ except Exception as e: |
2744 |
-+ print('WARNING: unable to store imdbIDs: %s' % str(e)) |
2745 |
- return |
2746 |
- try: |
2747 |
- CURS.execute('SELECT %s, %s FROM %s WHERE %s IS NOT NULL' % |
2748 |
-@@ -2694,10 +2694,10 @@ def storeNotNULLimdbIDs(cls): |
2749 |
- while res: |
2750 |
- db.update(dict((str(x[0]), str(x[1])) for x in res)) |
2751 |
- res = CURS.fetchmany(10000) |
2752 |
-- except Exception, e: |
2753 |
-- print 'SKIPPING: unable to retrieve data: %s' % e |
2754 |
-+ except Exception as e: |
2755 |
-+ print('SKIPPING: unable to retrieve data: %s' % e) |
2756 |
- return |
2757 |
-- print 'DONE! (%d entries)' % len(db) |
2758 |
-+ print('DONE! (%d entries)' % len(db)) |
2759 |
- db.close() |
2760 |
- return |
2761 |
- |
2762 |
-@@ -2707,7 +2707,7 @@ def iterbatch(iterable, size): |
2763 |
- sourceiter = iter(iterable) |
2764 |
- while True: |
2765 |
- batchiter = islice(sourceiter, size) |
2766 |
-- yield chain([batchiter.next()], batchiter) |
2767 |
-+ yield chain([next(batchiter)], batchiter) |
2768 |
- |
2769 |
- |
2770 |
- def restoreImdbIDs(cls): |
2771 |
-@@ -2720,7 +2720,7 @@ def restoreImdbIDs(cls): |
2772 |
- cname = 'companies' |
2773 |
- else: |
2774 |
- cname = 'characters' |
2775 |
-- print 'RESTORING imdbIDs values for %s...' % cname, |
2776 |
-+ print('RESTORING imdbIDs values for %s...' % cname, end=' ') |
2777 |
- sys.stdout.flush() |
2778 |
- table_name = tableName(cls) |
2779 |
- md5sum_col = colName(cls, 'md5sum') |
2780 |
-@@ -2730,7 +2730,7 @@ def restoreImdbIDs(cls): |
2781 |
- try: |
2782 |
- try: |
2783 |
- CURS.execute('SELECT * FROM %s_extract LIMIT 1' % table_name) |
2784 |
-- except Exception, e: |
2785 |
-+ except Exception as e: |
2786 |
- raise Exception('missing "%s_extract" table (ok if this is the first run)' % table_name) |
2787 |
- |
2788 |
- if DB_NAME == 'mysql': |
2789 |
-@@ -2748,20 +2748,20 @@ def restoreImdbIDs(cls): |
2790 |
- CURS.execute('SELECT COUNT(*) FROM %s WHERE %s IS NOT NULL' % |
2791 |
- (table_name, imdbID_col)) |
2792 |
- affected_rows = (CURS.fetchone() or [0])[0] |
2793 |
-- except Exception, e: |
2794 |
-+ except Exception as e: |
2795 |
- pass |
2796 |
- rows = _countRows('%s_extract' % table_name) |
2797 |
-- print 'DONE! (restored %s entries out of %d)' % (affected_rows, rows) |
2798 |
-+ print('DONE! (restored %s entries out of %d)' % (affected_rows, rows)) |
2799 |
- t('restore %s' % cname) |
2800 |
- try: CURS.execute('DROP TABLE %s_extract' % table_name) |
2801 |
- except: pass |
2802 |
- return |
2803 |
-- except Exception, e: |
2804 |
-- print 'WARNING: unable to restore imdbIDs using the temporary table (falling back to dbm): %s' % e |
2805 |
-+ except Exception as e: |
2806 |
-+ print('WARNING: unable to restore imdbIDs using the temporary table (falling back to dbm): %s' % e) |
2807 |
- try: |
2808 |
-- db = anydbm.open(_imdbIDsFileName('%s_imdbIDs.db' % cname), 'r') |
2809 |
-- except Exception, e: |
2810 |
-- print 'WARNING: unable to restore imdbIDs (ok if this is the first run)' |
2811 |
-+ db = dbm.open(_imdbIDsFileName('%s_imdbIDs.db' % cname), 'r') |
2812 |
-+ except Exception as e: |
2813 |
-+ print('WARNING: unable to restore imdbIDs (ok if this is the first run)') |
2814 |
- return |
2815 |
- count = 0 |
2816 |
- sql = "UPDATE " + table_name + " SET " + imdbID_col + \ |
2817 |
-@@ -2776,9 +2776,9 @@ def restoreImdbIDs(cls): |
2818 |
- if success: |
2819 |
- return len(items) |
2820 |
- return 0 |
2821 |
-- for batch in iterbatch(db.iteritems(), 10000): |
2822 |
-+ for batch in iterbatch(iter(db.items()), 10000): |
2823 |
- count += _restore(sql, batch) |
2824 |
-- print 'DONE! (restored %d entries out of %d)' % (count, len(db)) |
2825 |
-+ print('DONE! (restored %d entries out of %d)' % (count, len(db))) |
2826 |
- t('restore %s' % cname) |
2827 |
- db.close() |
2828 |
- return |
2829 |
-@@ -2804,8 +2804,8 @@ def runSafely(funct, fmsg, default, *args, **kwds): |
2830 |
- value of the function is returned (or 'default').""" |
2831 |
- try: |
2832 |
- return funct(*args, **kwds) |
2833 |
-- except Exception, e: |
2834 |
-- print 'WARNING: %s: %s' % (fmsg, e) |
2835 |
-+ except Exception as e: |
2836 |
-+ print('WARNING: %s: %s' % (fmsg, e)) |
2837 |
- return default |
2838 |
- |
2839 |
- |
2840 |
-@@ -2815,14 +2815,14 @@ def _executeQuery(query): |
2841 |
- s_query = query[:60] + '...' |
2842 |
- else: |
2843 |
- s_query = query |
2844 |
-- print 'EXECUTING "%s"...' % (s_query), |
2845 |
-+ print('EXECUTING "%s"...' % (s_query), end=' ') |
2846 |
- sys.stdout.flush() |
2847 |
- try: |
2848 |
- CURS.execute(query) |
2849 |
-- print 'DONE!' |
2850 |
-+ print('DONE!') |
2851 |
- return True |
2852 |
-- except Exception, e: |
2853 |
-- print 'FAILED (%s)!' % e |
2854 |
-+ except Exception as e: |
2855 |
-+ print('FAILED (%s)!' % e) |
2856 |
- return False |
2857 |
- |
2858 |
- |
2859 |
-@@ -2830,7 +2830,7 @@ def executeCustomQueries(when, _keys=None, _timeit=True): |
2860 |
- """Run custom queries as specified on the command line.""" |
2861 |
- if _keys is None: _keys = {} |
2862 |
- for query in CUSTOM_QUERIES.get(when, []): |
2863 |
-- print 'EXECUTING "%s:%s"...' % (when, query) |
2864 |
-+ print('EXECUTING "%s:%s"...' % (when, query)) |
2865 |
- sys.stdout.flush() |
2866 |
- if query.startswith('FOR_EVERY_TABLE:'): |
2867 |
- query = query[16:] |
2868 |
-@@ -2843,14 +2843,14 @@ def executeCustomQueries(when, _keys=None, _timeit=True): |
2869 |
- _executeQuery(query % keys) |
2870 |
- if _timeit: |
2871 |
- t('%s command' % when) |
2872 |
-- except Exception, e: |
2873 |
-- print 'FAILED (%s)!' % e |
2874 |
-+ except Exception as e: |
2875 |
-+ print('FAILED (%s)!' % e) |
2876 |
- continue |
2877 |
- else: |
2878 |
- try: |
2879 |
- _executeQuery(query % _keys) |
2880 |
-- except Exception, e: |
2881 |
-- print 'FAILED (%s)!' % e |
2882 |
-+ except Exception as e: |
2883 |
-+ print('FAILED (%s)!' % e) |
2884 |
- continue |
2885 |
- if _timeit: |
2886 |
- t('%s command' % when) |
2887 |
-@@ -2859,26 +2859,26 @@ def executeCustomQueries(when, _keys=None, _timeit=True): |
2888 |
- def buildIndexesAndFK(): |
2889 |
- """Build indexes and Foreign Keys.""" |
2890 |
- executeCustomQueries('BEFORE_INDEXES') |
2891 |
-- print 'building database indexes (this may take a while)' |
2892 |
-+ print('building database indexes (this may take a while)') |
2893 |
- sys.stdout.flush() |
2894 |
- # Build database indexes. |
2895 |
- idx_errors = createIndexes(DB_TABLES) |
2896 |
- for idx_error in idx_errors: |
2897 |
-- print 'ERROR caught exception creating an index: %s' % idx_error |
2898 |
-+ print('ERROR caught exception creating an index: %s' % idx_error) |
2899 |
- t('createIndexes()') |
2900 |
-- print 'adding foreign keys (this may take a while)' |
2901 |
-+ print('adding foreign keys (this may take a while)') |
2902 |
- sys.stdout.flush() |
2903 |
- # Add FK. |
2904 |
- fk_errors = createForeignKeys(DB_TABLES) |
2905 |
- for fk_error in fk_errors: |
2906 |
-- print 'ERROR caught exception creating a foreign key: %s' % fk_error |
2907 |
-+ print('ERROR caught exception creating a foreign key: %s' % fk_error) |
2908 |
- t('createForeignKeys()') |
2909 |
- |
2910 |
- |
2911 |
- def restoreCSV(): |
2912 |
- """Only restore data from a set of CSV files.""" |
2913 |
- CSV_CURS.buildFakeFileNames() |
2914 |
-- print 'loading CSV files into the database' |
2915 |
-+ print('loading CSV files into the database') |
2916 |
- executeCustomQueries('BEFORE_CSV_LOAD') |
2917 |
- loadCSVFiles() |
2918 |
- t('loadCSVFiles()') |
2919 |
-@@ -2892,7 +2892,7 @@ def restoreCSV(): |
2920 |
- |
2921 |
- # begin the iterations... |
2922 |
- def run(): |
2923 |
-- print 'RUNNING imdbpy2sql.py using the %s ORM' % USED_ORM |
2924 |
-+ print('RUNNING imdbpy2sql.py using the %s ORM' % USED_ORM) |
2925 |
- |
2926 |
- executeCustomQueries('BEGIN') |
2927 |
- |
2928 |
-@@ -2907,17 +2907,17 @@ def run(): |
2929 |
- None, CompanyName) |
2930 |
- |
2931 |
- # Truncate the current database. |
2932 |
-- print 'DROPPING current database...', |
2933 |
-+ print('DROPPING current database...', end=' ') |
2934 |
- sys.stdout.flush() |
2935 |
- dropTables(DB_TABLES) |
2936 |
-- print 'DONE!' |
2937 |
-+ print('DONE!') |
2938 |
- |
2939 |
- executeCustomQueries('BEFORE_CREATE') |
2940 |
- # Rebuild the database structure. |
2941 |
-- print 'CREATING new tables...', |
2942 |
-+ print('CREATING new tables...', end=' ') |
2943 |
- sys.stdout.flush() |
2944 |
- createTables(DB_TABLES) |
2945 |
-- print 'DONE!' |
2946 |
-+ print('DONE!') |
2947 |
- t('dropping and recreating the database') |
2948 |
- executeCustomQueries('AFTER_CREATE') |
2949 |
- |
2950 |
-@@ -3002,7 +3002,7 @@ def run(): |
2951 |
- return |
2952 |
- |
2953 |
- if CSV_DIR: |
2954 |
-- print 'loading CSV files into the database' |
2955 |
-+ print('loading CSV files into the database') |
2956 |
- executeCustomQueries('BEFORE_CSV_LOAD') |
2957 |
- loadCSVFiles() |
2958 |
- t('loadCSVFiles()') |
2959 |
-@@ -3024,9 +3024,9 @@ def _kdb_handler(signum, frame): |
2960 |
- """Die gracefully.""" |
2961 |
- global _HEARD |
2962 |
- if _HEARD: |
2963 |
-- print "EHI! DON'T PUSH ME! I'VE HEARD YOU THE FIRST TIME! :-)" |
2964 |
-+ print("EHI! DON'T PUSH ME! I'VE HEARD YOU THE FIRST TIME! :-)") |
2965 |
- return |
2966 |
-- print 'INTERRUPT REQUEST RECEIVED FROM USER. FLUSHING CACHES...' |
2967 |
-+ print('INTERRUPT REQUEST RECEIVED FROM USER. FLUSHING CACHES...') |
2968 |
- _HEARD = 1 |
2969 |
- # XXX: trap _every_ error? |
2970 |
- try: CACHE_MID.flush() |
2971 |
-@@ -3037,24 +3037,24 @@ def _kdb_handler(signum, frame): |
2972 |
- except IntegrityError: pass |
2973 |
- try: CACHE_COMPID.flush() |
2974 |
- except IntegrityError: pass |
2975 |
-- print 'DONE! (in %d minutes, %d seconds)' % \ |
2976 |
-- divmod(int(time.time())-BEGIN_TIME, 60) |
2977 |
-+ print('DONE! (in %d minutes, %d seconds)' % \ |
2978 |
-+ divmod(int(time.time())-BEGIN_TIME, 60)) |
2979 |
- sys.exit() |
2980 |
- |
2981 |
- |
2982 |
- if __name__ == '__main__': |
2983 |
- try: |
2984 |
-- print 'IMPORTING psyco...', |
2985 |
-+ print('IMPORTING psyco...', end=' ') |
2986 |
- sys.stdout.flush() |
2987 |
- #import DONOTIMPORTPSYCO |
2988 |
- import psyco |
2989 |
- #psyco.log() |
2990 |
- psyco.profile() |
2991 |
-- print 'DONE!' |
2992 |
-- print '' |
2993 |
-+ print('DONE!') |
2994 |
-+ print('') |
2995 |
- except ImportError: |
2996 |
-- print 'FAILED (not a big deal, everything is alright...)' |
2997 |
-- print '' |
2998 |
-+ print('FAILED (not a big deal, everything is alright...)') |
2999 |
-+ print('') |
3000 |
- import signal |
3001 |
- signal.signal(signal.SIGINT, _kdb_handler) |
3002 |
- if CSV_ONLY_LOAD: |
3003 |
-diff --git a/bin/search_character.py b/bin/search_character.py |
3004 |
-index 44b7fa8..922d24e 100755 |
3005 |
---- a/bin/search_character.py |
3006 |
-+++ b/bin/search_character.py |
3007 |
-@@ -13,13 +13,13 @@ import sys |
3008 |
- try: |
3009 |
- import imdb |
3010 |
- except ImportError: |
3011 |
-- print 'You bad boy! You need to install the IMDbPY package!' |
3012 |
-+ print('You bad boy! You need to install the IMDbPY package!') |
3013 |
- sys.exit(1) |
3014 |
- |
3015 |
- |
3016 |
- if len(sys.argv) != 2: |
3017 |
-- print 'Only one argument is required:' |
3018 |
-- print ' %s "character name"' % sys.argv[0] |
3019 |
-+ print('Only one argument is required:') |
3020 |
-+ print(' %s "character name"' % sys.argv[0]) |
3021 |
- sys.exit(2) |
3022 |
- |
3023 |
- name = sys.argv[1] |
3024 |
-@@ -30,25 +30,25 @@ i = imdb.IMDb() |
3025 |
- in_encoding = sys.stdin.encoding or sys.getdefaultencoding() |
3026 |
- out_encoding = sys.stdout.encoding or sys.getdefaultencoding() |
3027 |
- |
3028 |
--name = unicode(name, in_encoding, 'replace') |
3029 |
-+name = str(name, in_encoding, 'replace') |
3030 |
- try: |
3031 |
- # Do the search, and get the results (a list of character objects). |
3032 |
- results = i.search_character(name) |
3033 |
--except imdb.IMDbError, e: |
3034 |
-- print "Probably you're not connected to Internet. Complete error report:" |
3035 |
-- print e |
3036 |
-+except imdb.IMDbError as e: |
3037 |
-+ print("Probably you're not connected to Internet. Complete error report:") |
3038 |
-+ print(e) |
3039 |
- sys.exit(3) |
3040 |
- |
3041 |
- # Print the results. |
3042 |
--print ' %s result%s for "%s":' % (len(results), |
3043 |
-+print(' %s result%s for "%s":' % (len(results), |
3044 |
- ('', 's')[len(results) != 1], |
3045 |
-- name.encode(out_encoding, 'replace')) |
3046 |
--print 'characterID\t: imdbID : name' |
3047 |
-+ name.encode(out_encoding, 'replace'))) |
3048 |
-+print('characterID\t: imdbID : name') |
3049 |
- |
3050 |
- # Print the long imdb name for every character. |
3051 |
- for character in results: |
3052 |
-- outp = u'%s\t\t: %s : %s' % (character.characterID, i.get_imdbID(character), |
3053 |
-+ outp = '%s\t\t: %s : %s' % (character.characterID, i.get_imdbID(character), |
3054 |
- character['long imdb name']) |
3055 |
-- print outp.encode(out_encoding, 'replace') |
3056 |
-+ print(outp.encode(out_encoding, 'replace')) |
3057 |
- |
3058 |
- |
3059 |
-diff --git a/bin/search_company.py b/bin/search_company.py |
3060 |
-index 6e3df0c..3d1f593 100755 |
3061 |
---- a/bin/search_company.py |
3062 |
-+++ b/bin/search_company.py |
3063 |
-@@ -13,13 +13,13 @@ import sys |
3064 |
- try: |
3065 |
- import imdb |
3066 |
- except ImportError: |
3067 |
-- print 'You bad boy! You need to install the IMDbPY package!' |
3068 |
-+ print('You bad boy! You need to install the IMDbPY package!') |
3069 |
- sys.exit(1) |
3070 |
- |
3071 |
- |
3072 |
- if len(sys.argv) != 2: |
3073 |
-- print 'Only one argument is required:' |
3074 |
-- print ' %s "company name"' % sys.argv[0] |
3075 |
-+ print('Only one argument is required:') |
3076 |
-+ print(' %s "company name"' % sys.argv[0]) |
3077 |
- sys.exit(2) |
3078 |
- |
3079 |
- name = sys.argv[1] |
3080 |
-@@ -30,25 +30,25 @@ i = imdb.IMDb() |
3081 |
- in_encoding = sys.stdin.encoding or sys.getdefaultencoding() |
3082 |
- out_encoding = sys.stdout.encoding or sys.getdefaultencoding() |
3083 |
- |
3084 |
--name = unicode(name, in_encoding, 'replace') |
3085 |
-+name = str(name, in_encoding, 'replace') |
3086 |
- try: |
3087 |
- # Do the search, and get the results (a list of company objects). |
3088 |
- results = i.search_company(name) |
3089 |
--except imdb.IMDbError, e: |
3090 |
-- print "Probably you're not connected to Internet. Complete error report:" |
3091 |
-- print e |
3092 |
-+except imdb.IMDbError as e: |
3093 |
-+ print("Probably you're not connected to Internet. Complete error report:") |
3094 |
-+ print(e) |
3095 |
- sys.exit(3) |
3096 |
- |
3097 |
- # Print the results. |
3098 |
--print ' %s result%s for "%s":' % (len(results), |
3099 |
-+print(' %s result%s for "%s":' % (len(results), |
3100 |
- ('', 's')[len(results) != 1], |
3101 |
-- name.encode(out_encoding, 'replace')) |
3102 |
--print 'companyID\t: imdbID : name' |
3103 |
-+ name.encode(out_encoding, 'replace'))) |
3104 |
-+print('companyID\t: imdbID : name') |
3105 |
- |
3106 |
- # Print the long imdb name for every company. |
3107 |
- for company in results: |
3108 |
-- outp = u'%s\t\t: %s : %s' % (company.companyID, i.get_imdbID(company), |
3109 |
-+ outp = '%s\t\t: %s : %s' % (company.companyID, i.get_imdbID(company), |
3110 |
- company['long imdb name']) |
3111 |
-- print outp.encode(out_encoding, 'replace') |
3112 |
-+ print(outp.encode(out_encoding, 'replace')) |
3113 |
- |
3114 |
- |
3115 |
-diff --git a/bin/search_keyword.py b/bin/search_keyword.py |
3116 |
-index 21e0da2..5381ebc 100755 |
3117 |
---- a/bin/search_keyword.py |
3118 |
-+++ b/bin/search_keyword.py |
3119 |
-@@ -13,13 +13,13 @@ import sys |
3120 |
- try: |
3121 |
- import imdb |
3122 |
- except ImportError: |
3123 |
-- print 'You bad boy! You need to install the IMDbPY package!' |
3124 |
-+ print('You bad boy! You need to install the IMDbPY package!') |
3125 |
- sys.exit(1) |
3126 |
- |
3127 |
- |
3128 |
- if len(sys.argv) != 2: |
3129 |
-- print 'Only one argument is required:' |
3130 |
-- print ' %s "keyword name"' % sys.argv[0] |
3131 |
-+ print('Only one argument is required:') |
3132 |
-+ print(' %s "keyword name"' % sys.argv[0]) |
3133 |
- sys.exit(2) |
3134 |
- |
3135 |
- name = sys.argv[1] |
3136 |
-@@ -30,24 +30,24 @@ i = imdb.IMDb() |
3137 |
- in_encoding = sys.stdin.encoding or sys.getdefaultencoding() |
3138 |
- out_encoding = sys.stdout.encoding or sys.getdefaultencoding() |
3139 |
- |
3140 |
--name = unicode(name, in_encoding, 'replace') |
3141 |
-+name = str(name, in_encoding, 'replace') |
3142 |
- try: |
3143 |
- # Do the search, and get the results (a list of keyword strings). |
3144 |
- results = i.search_keyword(name, results=20) |
3145 |
--except imdb.IMDbError, e: |
3146 |
-- print "Probably you're not connected to Internet. Complete error report:" |
3147 |
-- print e |
3148 |
-+except imdb.IMDbError as e: |
3149 |
-+ print("Probably you're not connected to Internet. Complete error report:") |
3150 |
-+ print(e) |
3151 |
- sys.exit(3) |
3152 |
- |
3153 |
- # Print the results. |
3154 |
--print ' %s result%s for "%s":' % (len(results), |
3155 |
-+print(' %s result%s for "%s":' % (len(results), |
3156 |
- ('', 's')[len(results) != 1], |
3157 |
-- name.encode(out_encoding, 'replace')) |
3158 |
--print ' : keyword' |
3159 |
-+ name.encode(out_encoding, 'replace'))) |
3160 |
-+print(' : keyword') |
3161 |
- |
3162 |
- # Print every keyword. |
3163 |
- for idx, keyword in enumerate(results): |
3164 |
-- outp = u'%d: %s' % (idx+1, keyword) |
3165 |
-- print outp.encode(out_encoding, 'replace') |
3166 |
-+ outp = '%d: %s' % (idx+1, keyword) |
3167 |
-+ print(outp.encode(out_encoding, 'replace')) |
3168 |
- |
3169 |
- |
3170 |
-diff --git a/bin/search_movie.py b/bin/search_movie.py |
3171 |
-index b358d03..6b30863 100755 |
3172 |
---- a/bin/search_movie.py |
3173 |
-+++ b/bin/search_movie.py |
3174 |
-@@ -13,13 +13,13 @@ import sys |
3175 |
- try: |
3176 |
- import imdb |
3177 |
- except ImportError: |
3178 |
-- print 'You bad boy! You need to install the IMDbPY package!' |
3179 |
-+ print('You bad boy! You need to install the IMDbPY package!') |
3180 |
- sys.exit(1) |
3181 |
- |
3182 |
- |
3183 |
- if len(sys.argv) != 2: |
3184 |
-- print 'Only one argument is required:' |
3185 |
-- print ' %s "movie title"' % sys.argv[0] |
3186 |
-+ print('Only one argument is required:') |
3187 |
-+ print(' %s "movie title"' % sys.argv[0]) |
3188 |
- sys.exit(2) |
3189 |
- |
3190 |
- title = sys.argv[1] |
3191 |
-@@ -30,25 +30,25 @@ i = imdb.IMDb() |
3192 |
- in_encoding = sys.stdin.encoding or sys.getdefaultencoding() |
3193 |
- out_encoding = sys.stdout.encoding or sys.getdefaultencoding() |
3194 |
- |
3195 |
--title = unicode(title, in_encoding, 'replace') |
3196 |
-+title = str(title, in_encoding, 'replace') |
3197 |
- try: |
3198 |
- # Do the search, and get the results (a list of Movie objects). |
3199 |
- results = i.search_movie(title) |
3200 |
--except imdb.IMDbError, e: |
3201 |
-- print "Probably you're not connected to Internet. Complete error report:" |
3202 |
-- print e |
3203 |
-+except imdb.IMDbError as e: |
3204 |
-+ print("Probably you're not connected to Internet. Complete error report:") |
3205 |
-+ print(e) |
3206 |
- sys.exit(3) |
3207 |
- |
3208 |
- # Print the results. |
3209 |
--print ' %s result%s for "%s":' % (len(results), |
3210 |
-+print(' %s result%s for "%s":' % (len(results), |
3211 |
- ('', 's')[len(results) != 1], |
3212 |
-- title.encode(out_encoding, 'replace')) |
3213 |
--print 'movieID\t: imdbID : title' |
3214 |
-+ title.encode(out_encoding, 'replace'))) |
3215 |
-+print('movieID\t: imdbID : title') |
3216 |
- |
3217 |
- # Print the long imdb title for every movie. |
3218 |
- for movie in results: |
3219 |
-- outp = u'%s\t: %s : %s' % (movie.movieID, i.get_imdbID(movie), |
3220 |
-+ outp = '%s\t: %s : %s' % (movie.movieID, i.get_imdbID(movie), |
3221 |
- movie['long imdb title']) |
3222 |
-- print outp.encode(out_encoding, 'replace') |
3223 |
-+ print(outp.encode(out_encoding, 'replace')) |
3224 |
- |
3225 |
- |
3226 |
-diff --git a/bin/search_person.py b/bin/search_person.py |
3227 |
-index 8a7dbd4..47112b9 100755 |
3228 |
---- a/bin/search_person.py |
3229 |
-+++ b/bin/search_person.py |
3230 |
-@@ -13,13 +13,13 @@ import sys |
3231 |
- try: |
3232 |
- import imdb |
3233 |
- except ImportError: |
3234 |
-- print 'You bad boy! You need to install the IMDbPY package!' |
3235 |
-+ print('You bad boy! You need to install the IMDbPY package!') |
3236 |
- sys.exit(1) |
3237 |
- |
3238 |
- |
3239 |
- if len(sys.argv) != 2: |
3240 |
-- print 'Only one argument is required:' |
3241 |
-- print ' %s "person name"' % sys.argv[0] |
3242 |
-+ print('Only one argument is required:') |
3243 |
-+ print(' %s "person name"' % sys.argv[0]) |
3244 |
- sys.exit(2) |
3245 |
- |
3246 |
- name = sys.argv[1] |
3247 |
-@@ -30,25 +30,25 @@ i = imdb.IMDb() |
3248 |
- in_encoding = sys.stdin.encoding or sys.getdefaultencoding() |
3249 |
- out_encoding = sys.stdout.encoding or sys.getdefaultencoding() |
3250 |
- |
3251 |
--name = unicode(name, in_encoding, 'replace') |
3252 |
-+name = str(name, in_encoding, 'replace') |
3253 |
- try: |
3254 |
- # Do the search, and get the results (a list of Person objects). |
3255 |
- results = i.search_person(name) |
3256 |
--except imdb.IMDbError, e: |
3257 |
-- print "Probably you're not connected to Internet. Complete error report:" |
3258 |
-- print e |
3259 |
-+except imdb.IMDbError as e: |
3260 |
-+ print("Probably you're not connected to Internet. Complete error report:") |
3261 |
-+ print(e) |
3262 |
- sys.exit(3) |
3263 |
- |
3264 |
- # Print the results. |
3265 |
--print ' %s result%s for "%s":' % (len(results), |
3266 |
-+print(' %s result%s for "%s":' % (len(results), |
3267 |
- ('', 's')[len(results) != 1], |
3268 |
-- name.encode(out_encoding, 'replace')) |
3269 |
--print 'personID\t: imdbID : name' |
3270 |
-+ name.encode(out_encoding, 'replace'))) |
3271 |
-+print('personID\t: imdbID : name') |
3272 |
- |
3273 |
- # Print the long imdb name for every person. |
3274 |
- for person in results: |
3275 |
-- outp = u'%s\t: %s : %s' % (person.personID, i.get_imdbID(person), |
3276 |
-+ outp = '%s\t: %s : %s' % (person.personID, i.get_imdbID(person), |
3277 |
- person['long imdb name']) |
3278 |
-- print outp.encode(out_encoding, 'replace') |
3279 |
-+ print(outp.encode(out_encoding, 'replace')) |
3280 |
- |
3281 |
- |
3282 |
-diff --git a/ez_setup.py b/ez_setup.py |
3283 |
-index 1ff1d3e..5663de5 100644 |
3284 |
---- a/ez_setup.py |
3285 |
-+++ b/ez_setup.py |
3286 |
-@@ -70,10 +70,10 @@ def _validate_md5(egg_name, data): |
3287 |
- if egg_name in md5_data: |
3288 |
- digest = md5(data).hexdigest() |
3289 |
- if digest != md5_data[egg_name]: |
3290 |
-- print >>sys.stderr, ( |
3291 |
-+ print(( |
3292 |
- "md5 validation of %s failed! (Possible download problem?)" |
3293 |
- % egg_name |
3294 |
-- ) |
3295 |
-+ ), file=sys.stderr) |
3296 |
- sys.exit(2) |
3297 |
- return data |
3298 |
- |
3299 |
-@@ -103,14 +103,14 @@ def use_setuptools( |
3300 |
- return do_download() |
3301 |
- try: |
3302 |
- pkg_resources.require("setuptools>="+version); return |
3303 |
-- except pkg_resources.VersionConflict, e: |
3304 |
-+ except pkg_resources.VersionConflict as e: |
3305 |
- if was_imported: |
3306 |
-- print >>sys.stderr, ( |
3307 |
-+ print(( |
3308 |
- "The required version of setuptools (>=%s) is not available, and\n" |
3309 |
- "can't be installed while this script is running. Please install\n" |
3310 |
- " a more recent version first, using 'easy_install -U setuptools'." |
3311 |
- "\n\n(Currently using %r)" |
3312 |
-- ) % (version, e.args[0]) |
3313 |
-+ ) % (version, e.args[0]), file=sys.stderr) |
3314 |
- sys.exit(2) |
3315 |
- else: |
3316 |
- del pkg_resources, sys.modules['pkg_resources'] # reload ok |
3317 |
-@@ -129,7 +129,7 @@ def download_setuptools( |
3318 |
- with a '/'). `to_dir` is the directory where the egg will be downloaded. |
3319 |
- `delay` is the number of seconds to pause before an actual download attempt. |
3320 |
- """ |
3321 |
-- import urllib2, shutil |
3322 |
-+ import urllib.request, urllib.error, urllib.parse, shutil |
3323 |
- egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3]) |
3324 |
- url = download_base + egg_name |
3325 |
- saveto = os.path.join(to_dir, egg_name) |
3326 |
-@@ -155,7 +155,7 @@ and place it in this directory before rerunning this script.) |
3327 |
- version, download_base, delay, url |
3328 |
- ); from time import sleep; sleep(delay) |
3329 |
- log.warn("Downloading %s", url) |
3330 |
-- src = urllib2.urlopen(url) |
3331 |
-+ src = urllib.request.urlopen(url) |
3332 |
- # Read/write all in one block, so we don't create a corrupt file |
3333 |
- # if the download is interrupted. |
3334 |
- data = _validate_md5(egg_name, src.read()) |
3335 |
-@@ -216,10 +216,10 @@ def main(argv, version=DEFAULT_VERSION): |
3336 |
- os.unlink(egg) |
3337 |
- else: |
3338 |
- if setuptools.__version__ == '0.0.1': |
3339 |
-- print >>sys.stderr, ( |
3340 |
-+ print(( |
3341 |
- "You have an obsolete version of setuptools installed. Please\n" |
3342 |
- "remove it from your system entirely before rerunning this script." |
3343 |
-- ) |
3344 |
-+ ), file=sys.stderr) |
3345 |
- sys.exit(2) |
3346 |
- |
3347 |
- req = "setuptools>="+version |
3348 |
-@@ -238,8 +238,8 @@ def main(argv, version=DEFAULT_VERSION): |
3349 |
- from setuptools.command.easy_install import main |
3350 |
- main(argv) |
3351 |
- else: |
3352 |
-- print "Setuptools version",version,"or greater has been installed." |
3353 |
-- print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)' |
3354 |
-+ print("Setuptools version",version,"or greater has been installed.") |
3355 |
-+ print('(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)') |
3356 |
- |
3357 |
- def update_md5(filenames): |
3358 |
- """Update our built-in md5 registry""" |
3359 |
-@@ -252,7 +252,7 @@ def update_md5(filenames): |
3360 |
- md5_data[base] = md5(f.read()).hexdigest() |
3361 |
- f.close() |
3362 |
- |
3363 |
-- data = [" %r: %r,\n" % it for it in md5_data.items()] |
3364 |
-+ data = [" %r: %r,\n" % it for it in list(md5_data.items())] |
3365 |
- data.sort() |
3366 |
- repl = "".join(data) |
3367 |
- |
3368 |
-@@ -262,7 +262,7 @@ def update_md5(filenames): |
3369 |
- |
3370 |
- match = re.search("\nmd5_data = {\n([^}]+)}", src) |
3371 |
- if not match: |
3372 |
-- print >>sys.stderr, "Internal error!" |
3373 |
-+ print("Internal error!", file=sys.stderr) |
3374 |
- sys.exit(2) |
3375 |
- |
3376 |
- src = src[:match.start(1)] + repl + src[match.end(1):] |
3377 |
-diff --git a/imdb/Character.py b/imdb/Character.py |
3378 |
-index 5a5239a..8822932 100644 |
3379 |
---- a/imdb/Character.py |
3380 |
-+++ b/imdb/Character.py |
3381 |
-@@ -73,15 +73,15 @@ class Character(_Container): |
3382 |
- *modFunct* -- function called returning text fields. |
3383 |
- """ |
3384 |
- name = kwds.get('name') |
3385 |
-- if name and not self.data.has_key('name'): |
3386 |
-+ if name and 'name' not in self.data: |
3387 |
- self.set_name(name) |
3388 |
- self.characterID = kwds.get('characterID', None) |
3389 |
-- self.myName = kwds.get('myName', u'') |
3390 |
-+ self.myName = kwds.get('myName', '') |
3391 |
- |
3392 |
- def _reset(self): |
3393 |
- """Reset the Character object.""" |
3394 |
- self.characterID = None |
3395 |
-- self.myName = u'' |
3396 |
-+ self.myName = '' |
3397 |
- |
3398 |
- def set_name(self, name): |
3399 |
- """Set the name of the character.""" |
3400 |
-@@ -96,19 +96,19 @@ class Character(_Container): |
3401 |
- def _additional_keys(self): |
3402 |
- """Valid keys to append to the data.keys() list.""" |
3403 |
- addkeys = [] |
3404 |
-- if self.data.has_key('name'): |
3405 |
-+ if 'name' in self.data: |
3406 |
- addkeys += ['long imdb name'] |
3407 |
-- if self.data.has_key('headshot'): |
3408 |
-+ if 'headshot' in self.data: |
3409 |
- addkeys += ['full-size headshot'] |
3410 |
- return addkeys |
3411 |
- |
3412 |
- def _getitem(self, key): |
3413 |
- """Handle special keys.""" |
3414 |
- ## XXX: can a character have an imdbIndex? |
3415 |
-- if self.data.has_key('name'): |
3416 |
-+ if 'name' in self.data: |
3417 |
- if key == 'long imdb name': |
3418 |
- return build_name(self.data) |
3419 |
-- if key == 'full-size headshot' and self.data.has_key('headshot'): |
3420 |
-+ if key == 'full-size headshot' and 'headshot' in self.data: |
3421 |
- return self._re_fullsizeURL.sub('', self.data.get('headshot', '')) |
3422 |
- return None |
3423 |
- |
3424 |
-@@ -116,7 +116,7 @@ class Character(_Container): |
3425 |
- """Return the characterID.""" |
3426 |
- return self.characterID |
3427 |
- |
3428 |
-- def __nonzero__(self): |
3429 |
-+ def __bool__(self): |
3430 |
- """The Character is "false" if the self.data does not contain a name.""" |
3431 |
- # XXX: check the name and the characterID? |
3432 |
- if self.data.get('name'): return 1 |
3433 |
-@@ -125,8 +125,8 @@ class Character(_Container): |
3434 |
- def __contains__(self, item): |
3435 |
- """Return true if this Character was portrayed in the given Movie |
3436 |
- or it was impersonated by the given Person.""" |
3437 |
-- from Movie import Movie |
3438 |
-- from Person import Person |
3439 |
-+ from .Movie import Movie |
3440 |
-+ from .Person import Person |
3441 |
- if isinstance(item, Person): |
3442 |
- for m in flatten(self.data, yieldDictKeys=1, scalar=Movie): |
3443 |
- if item.isSame(m.currentRole): |
3444 |
-@@ -142,8 +142,8 @@ class Character(_Container): |
3445 |
- and/or characterID.""" |
3446 |
- if not isinstance(other, self.__class__): |
3447 |
- return 0 |
3448 |
-- if self.data.has_key('name') and \ |
3449 |
-- other.data.has_key('name') and \ |
3450 |
-+ if 'name' in self.data and \ |
3451 |
-+ 'name' in other.data and \ |
3452 |
- build_name(self.data, canonical=0) == \ |
3453 |
- build_name(other.data, canonical=0): |
3454 |
- return 1 |
3455 |
-@@ -156,7 +156,7 @@ class Character(_Container): |
3456 |
- |
3457 |
- def __deepcopy__(self, memo): |
3458 |
- """Return a deep copy of a Character instance.""" |
3459 |
-- c = Character(name=u'', characterID=self.characterID, |
3460 |
-+ c = Character(name='', characterID=self.characterID, |
3461 |
- myName=self.myName, myID=self.myID, |
3462 |
- data=deepcopy(self.data, memo), |
3463 |
- notes=self.notes, accessSystem=self.accessSystem, |
3464 |
-@@ -172,30 +172,30 @@ class Character(_Container): |
3465 |
- r = '<Character id:%s[%s] name:_%s_>' % (self.characterID, |
3466 |
- self.accessSystem, |
3467 |
- self.get('name')) |
3468 |
-- if isinstance(r, unicode): r = r.encode('utf_8', 'replace') |
3469 |
-+ if isinstance(r, str): r = r.encode('utf_8', 'replace') |
3470 |
- return r |
3471 |
- |
3472 |
- def __str__(self): |
3473 |
- """Simply print the short name.""" |
3474 |
-- return self.get('name', u'').encode('utf_8', 'replace') |
3475 |
-+ return self.get('name', '').encode('utf_8', 'replace') |
3476 |
- |
3477 |
- def __unicode__(self): |
3478 |
- """Simply print the short title.""" |
3479 |
-- return self.get('name', u'') |
3480 |
-+ return self.get('name', '') |
3481 |
- |
3482 |
- def summary(self): |
3483 |
- """Return a string with a pretty-printed summary for the character.""" |
3484 |
-- if not self: return u'' |
3485 |
-- s = u'Character\n=====\nName: %s\n' % \ |
3486 |
-- self.get('name', u'') |
3487 |
-+ if not self: return '' |
3488 |
-+ s = 'Character\n=====\nName: %s\n' % \ |
3489 |
-+ self.get('name', '') |
3490 |
- bio = self.get('biography') |
3491 |
- if bio: |
3492 |
-- s += u'Biography: %s\n' % bio[0] |
3493 |
-+ s += 'Biography: %s\n' % bio[0] |
3494 |
- filmo = self.get('filmography') |
3495 |
- if filmo: |
3496 |
-- a_list = [x.get('long imdb canonical title', u'') |
3497 |
-+ a_list = [x.get('long imdb canonical title', '') |
3498 |
- for x in filmo[:5]] |
3499 |
-- s += u'Last movies with this character: %s.\n' % u'; '.join(a_list) |
3500 |
-+ s += 'Last movies with this character: %s.\n' % '; '.join(a_list) |
3501 |
- return s |
3502 |
- |
3503 |
- |
3504 |
-diff --git a/imdb/Company.py b/imdb/Company.py |
3505 |
-index 5e05c84..26dc998 100644 |
3506 |
---- a/imdb/Company.py |
3507 |
-+++ b/imdb/Company.py |
3508 |
-@@ -71,15 +71,15 @@ class Company(_Container): |
3509 |
- *modFunct* -- function called returning text fields. |
3510 |
- """ |
3511 |
- name = kwds.get('name') |
3512 |
-- if name and not self.data.has_key('name'): |
3513 |
-+ if name and 'name' not in self.data: |
3514 |
- self.set_name(name) |
3515 |
- self.companyID = kwds.get('companyID', None) |
3516 |
-- self.myName = kwds.get('myName', u'') |
3517 |
-+ self.myName = kwds.get('myName', '') |
3518 |
- |
3519 |
- def _reset(self): |
3520 |
- """Reset the company object.""" |
3521 |
- self.companyID = None |
3522 |
-- self.myName = u'' |
3523 |
-+ self.myName = '' |
3524 |
- |
3525 |
- def set_name(self, name): |
3526 |
- """Set the name of the company.""" |
3527 |
-@@ -87,7 +87,7 @@ class Company(_Container): |
3528 |
- # Company diverges a bit from other classes, being able |
3529 |
- # to directly handle its "notes". AND THAT'S PROBABLY A BAD IDEA! |
3530 |
- oname = name = name.strip() |
3531 |
-- notes = u'' |
3532 |
-+ notes = '' |
3533 |
- if name.endswith(')'): |
3534 |
- fparidx = name.find('(') |
3535 |
- if fparidx != -1: |
3536 |
-@@ -102,14 +102,14 @@ class Company(_Container): |
3537 |
- |
3538 |
- def _additional_keys(self): |
3539 |
- """Valid keys to append to the data.keys() list.""" |
3540 |
-- if self.data.has_key('name'): |
3541 |
-+ if 'name' in self.data: |
3542 |
- return ['long imdb name'] |
3543 |
- return [] |
3544 |
- |
3545 |
- def _getitem(self, key): |
3546 |
- """Handle special keys.""" |
3547 |
- ## XXX: can a company have an imdbIndex? |
3548 |
-- if self.data.has_key('name'): |
3549 |
-+ if 'name' in self.data: |
3550 |
- if key == 'long imdb name': |
3551 |
- return build_company_name(self.data) |
3552 |
- return None |
3553 |
-@@ -118,7 +118,7 @@ class Company(_Container): |
3554 |
- """Return the companyID.""" |
3555 |
- return self.companyID |
3556 |
- |
3557 |
-- def __nonzero__(self): |
3558 |
-+ def __bool__(self): |
3559 |
- """The company is "false" if the self.data does not contain a name.""" |
3560 |
- # XXX: check the name and the companyID? |
3561 |
- if self.data.get('name'): return 1 |
3562 |
-@@ -126,7 +126,7 @@ class Company(_Container): |
3563 |
- |
3564 |
- def __contains__(self, item): |
3565 |
- """Return true if this company and the given Movie are related.""" |
3566 |
-- from Movie import Movie |
3567 |
-+ from .Movie import Movie |
3568 |
- if isinstance(item, Movie): |
3569 |
- for m in flatten(self.data, yieldDictKeys=1, scalar=Movie): |
3570 |
- if item.isSame(m): |
3571 |
-@@ -138,8 +138,8 @@ class Company(_Container): |
3572 |
- and/or companyID.""" |
3573 |
- if not isinstance(other, self.__class__): |
3574 |
- return 0 |
3575 |
-- if self.data.has_key('name') and \ |
3576 |
-- other.data.has_key('name') and \ |
3577 |
-+ if 'name' in self.data and \ |
3578 |
-+ 'name' in other.data and \ |
3579 |
- build_company_name(self.data) == \ |
3580 |
- build_company_name(other.data): |
3581 |
- return 1 |
3582 |
-@@ -152,7 +152,7 @@ class Company(_Container): |
3583 |
- |
3584 |
- def __deepcopy__(self, memo): |
3585 |
- """Return a deep copy of a company instance.""" |
3586 |
-- c = Company(name=u'', companyID=self.companyID, |
3587 |
-+ c = Company(name='', companyID=self.companyID, |
3588 |
- myName=self.myName, myID=self.myID, |
3589 |
- data=deepcopy(self.data, memo), |
3590 |
- notes=self.notes, accessSystem=self.accessSystem, |
3591 |
-@@ -168,28 +168,28 @@ class Company(_Container): |
3592 |
- r = '<Company id:%s[%s] name:_%s_>' % (self.companyID, |
3593 |
- self.accessSystem, |
3594 |
- self.get('long imdb name')) |
3595 |
-- if isinstance(r, unicode): r = r.encode('utf_8', 'replace') |
3596 |
-+ if isinstance(r, str): r = r.encode('utf_8', 'replace') |
3597 |
- return r |
3598 |
- |
3599 |
- def __str__(self): |
3600 |
- """Simply print the short name.""" |
3601 |
-- return self.get('name', u'').encode('utf_8', 'replace') |
3602 |
-+ return self.get('name', '').encode('utf_8', 'replace') |
3603 |
- |
3604 |
- def __unicode__(self): |
3605 |
- """Simply print the short title.""" |
3606 |
-- return self.get('name', u'') |
3607 |
-+ return self.get('name', '') |
3608 |
- |
3609 |
- def summary(self): |
3610 |
- """Return a string with a pretty-printed summary for the company.""" |
3611 |
-- if not self: return u'' |
3612 |
-- s = u'Company\n=======\nName: %s\n' % \ |
3613 |
-- self.get('name', u'') |
3614 |
-+ if not self: return '' |
3615 |
-+ s = 'Company\n=======\nName: %s\n' % \ |
3616 |
-+ self.get('name', '') |
3617 |
- for k in ('distributor', 'production company', 'miscellaneous company', |
3618 |
- 'special effects company'): |
3619 |
- d = self.get(k, [])[:5] |
3620 |
- if not d: continue |
3621 |
-- s += u'Last movies from this company (%s): %s.\n' % \ |
3622 |
-- (k, u'; '.join([x.get('long imdb title', u'') for x in d])) |
3623 |
-+ s += 'Last movies from this company (%s): %s.\n' % \ |
3624 |
-+ (k, '; '.join([x.get('long imdb title', '') for x in d])) |
3625 |
- return s |
3626 |
- |
3627 |
- |
3628 |
-diff --git a/imdb/Movie.py b/imdb/Movie.py |
3629 |
-index 5cdcde6..353d6af 100644 |
3630 |
---- a/imdb/Movie.py |
3631 |
-+++ b/imdb/Movie.py |
3632 |
-@@ -163,15 +163,15 @@ class Movie(_Container): |
3633 |
- *modFunct* -- function called returning text fields. |
3634 |
- """ |
3635 |
- title = kwds.get('title') |
3636 |
-- if title and not self.data.has_key('title'): |
3637 |
-+ if title and 'title' not in self.data: |
3638 |
- self.set_title(title) |
3639 |
- self.movieID = kwds.get('movieID', None) |
3640 |
-- self.myTitle = kwds.get('myTitle', u'') |
3641 |
-+ self.myTitle = kwds.get('myTitle', '') |
3642 |
- |
3643 |
- def _reset(self): |
3644 |
- """Reset the Movie object.""" |
3645 |
- self.movieID = None |
3646 |
-- self.myTitle = u'' |
3647 |
-+ self.myTitle = '' |
3648 |
- |
3649 |
- def set_title(self, title): |
3650 |
- """Set the title of the movie.""" |
3651 |
-@@ -182,18 +182,18 @@ class Movie(_Container): |
3652 |
- def _additional_keys(self): |
3653 |
- """Valid keys to append to the data.keys() list.""" |
3654 |
- addkeys = [] |
3655 |
-- if self.data.has_key('title'): |
3656 |
-+ if 'title' in self.data: |
3657 |
- addkeys += ['canonical title', 'long imdb title', |
3658 |
- 'long imdb canonical title', |
3659 |
- 'smart canonical title', |
3660 |
- 'smart long imdb canonical title'] |
3661 |
-- if self.data.has_key('episode of'): |
3662 |
-+ if 'episode of' in self.data: |
3663 |
- addkeys += ['long imdb episode title', 'series title', |
3664 |
- 'canonical series title', 'episode title', |
3665 |
- 'canonical episode title', |
3666 |
- 'smart canonical series title', |
3667 |
- 'smart canonical episode title'] |
3668 |
-- if self.data.has_key('cover url'): |
3669 |
-+ if 'cover url' in self.data: |
3670 |
- addkeys += ['full-size cover url'] |
3671 |
- return addkeys |
3672 |
- |
3673 |
-@@ -215,14 +215,14 @@ class Movie(_Container): |
3674 |
- used) and the language can be forced with the 'lang' argument, |
3675 |
- otherwise it's auto-detected.""" |
3676 |
- if title is None: |
3677 |
-- title = self.data.get('title', u'') |
3678 |
-+ title = self.data.get('title', '') |
3679 |
- if lang is None: |
3680 |
- lang = self.guessLanguage() |
3681 |
- return canonicalTitle(title, lang=lang) |
3682 |
- |
3683 |
- def _getitem(self, key): |
3684 |
- """Handle special keys.""" |
3685 |
-- if self.data.has_key('episode of'): |
3686 |
-+ if 'episode of' in self.data: |
3687 |
- if key == 'long imdb episode title': |
3688 |
- return build_title(self.data) |
3689 |
- elif key == 'series title': |
3690 |
-@@ -234,12 +234,12 @@ class Movie(_Container): |
3691 |
- ser_title = self.data['episode of']['title'] |
3692 |
- return self.smartCanonicalTitle(ser_title) |
3693 |
- elif key == 'episode title': |
3694 |
-- return self.data.get('title', u'') |
3695 |
-+ return self.data.get('title', '') |
3696 |
- elif key == 'canonical episode title': |
3697 |
-- return canonicalTitle(self.data.get('title', u'')) |
3698 |
-+ return canonicalTitle(self.data.get('title', '')) |
3699 |
- elif key == 'smart canonical episode title': |
3700 |
-- return self.smartCanonicalTitle(self.data.get('title', u'')) |
3701 |
-- if self.data.has_key('title'): |
3702 |
-+ return self.smartCanonicalTitle(self.data.get('title', '')) |
3703 |
-+ if 'title' in self.data: |
3704 |
- if key == 'title': |
3705 |
- return self.data['title'] |
3706 |
- elif key == 'long imdb title': |
3707 |
-@@ -253,7 +253,7 @@ class Movie(_Container): |
3708 |
- elif key == 'smart long imdb canonical title': |
3709 |
- return build_title(self.data, canonical=1, |
3710 |
- lang=self.guessLanguage()) |
3711 |
-- if key == 'full-size cover url' and self.data.has_key('cover url'): |
3712 |
-+ if key == 'full-size cover url' and 'cover url' in self.data: |
3713 |
- return self._re_fullsizeURL.sub('', self.data.get('cover url', '')) |
3714 |
- return None |
3715 |
- |
3716 |
-@@ -261,10 +261,10 @@ class Movie(_Container): |
3717 |
- """Return the movieID.""" |
3718 |
- return self.movieID |
3719 |
- |
3720 |
-- def __nonzero__(self): |
3721 |
-+ def __bool__(self): |
3722 |
- """The Movie is "false" if the self.data does not contain a title.""" |
3723 |
- # XXX: check the title and the movieID? |
3724 |
-- if self.data.has_key('title'): return 1 |
3725 |
-+ if 'title' in self.data: return 1 |
3726 |
- return 0 |
3727 |
- |
3728 |
- def isSameTitle(self, other): |
3729 |
-@@ -273,8 +273,8 @@ class Movie(_Container): |
3730 |
- """ |
3731 |
- # XXX: obsolete? |
3732 |
- if not isinstance(other, self.__class__): return 0 |
3733 |
-- if self.data.has_key('title') and \ |
3734 |
-- other.data.has_key('title') and \ |
3735 |
-+ if 'title' in self.data and \ |
3736 |
-+ 'title' in other.data and \ |
3737 |
- build_title(self.data, canonical=0) == \ |
3738 |
- build_title(other.data, canonical=0): |
3739 |
- return 1 |
3740 |
-@@ -287,9 +287,9 @@ class Movie(_Container): |
3741 |
- def __contains__(self, item): |
3742 |
- """Return true if the given Person object is listed in this Movie, |
3743 |
- or if the the given Character is represented in this Movie.""" |
3744 |
-- from Person import Person |
3745 |
-- from Character import Character |
3746 |
-- from Company import Company |
3747 |
-+ from .Person import Person |
3748 |
-+ from .Character import Character |
3749 |
-+ from .Company import Company |
3750 |
- if isinstance(item, Person): |
3751 |
- for p in flatten(self.data, yieldDictKeys=1, scalar=Person, |
3752 |
- toDescend=(list, dict, tuple, Movie)): |
3753 |
-@@ -309,7 +309,7 @@ class Movie(_Container): |
3754 |
- |
3755 |
- def __deepcopy__(self, memo): |
3756 |
- """Return a deep copy of a Movie instance.""" |
3757 |
-- m = Movie(title=u'', movieID=self.movieID, myTitle=self.myTitle, |
3758 |
-+ m = Movie(title='', movieID=self.movieID, myTitle=self.myTitle, |
3759 |
- myID=self.myID, data=deepcopy(self.data, memo), |
3760 |
- currentRole=deepcopy(self.currentRole, memo), |
3761 |
- roleIsPerson=self._roleIsPerson, |
3762 |
-@@ -324,64 +324,64 @@ class Movie(_Container): |
3763 |
- def __repr__(self): |
3764 |
- """String representation of a Movie object.""" |
3765 |
- # XXX: add also currentRole and notes, if present? |
3766 |
-- if self.has_key('long imdb episode title'): |
3767 |
-+ if 'long imdb episode title' in self: |
3768 |
- title = self.get('long imdb episode title') |
3769 |
- else: |
3770 |
- title = self.get('long imdb title') |
3771 |
- r = '<Movie id:%s[%s] title:_%s_>' % (self.movieID, self.accessSystem, |
3772 |
- title) |
3773 |
-- if isinstance(r, unicode): r = r.encode('utf_8', 'replace') |
3774 |
-+ if isinstance(r, str): r = r.encode('utf_8', 'replace') |
3775 |
- return r |
3776 |
- |
3777 |
- def __str__(self): |
3778 |
- """Simply print the short title.""" |
3779 |
-- return self.get('title', u'').encode('utf_8', 'replace') |
3780 |
-+ return self.get('title', '').encode('utf_8', 'replace') |
3781 |
- |
3782 |
- def __unicode__(self): |
3783 |
- """Simply print the short title.""" |
3784 |
-- return self.get('title', u'') |
3785 |
-+ return self.get('title', '') |
3786 |
- |
3787 |
- def summary(self): |
3788 |
- """Return a string with a pretty-printed summary for the movie.""" |
3789 |
-- if not self: return u'' |
3790 |
-- def _nameAndRole(personList, joiner=u', '): |
3791 |
-+ if not self: return '' |
3792 |
-+ def _nameAndRole(personList, joiner=', '): |
3793 |
- """Build a pretty string with name and role.""" |
3794 |
- nl = [] |
3795 |
- for person in personList: |
3796 |
-- n = person.get('name', u'') |
3797 |
-- if person.currentRole: n += u' (%s)' % person.currentRole |
3798 |
-+ n = person.get('name', '') |
3799 |
-+ if person.currentRole: n += ' (%s)' % person.currentRole |
3800 |
- nl.append(n) |
3801 |
- return joiner.join(nl) |
3802 |
-- s = u'Movie\n=====\nTitle: %s\n' % \ |
3803 |
-- self.get('long imdb canonical title', u'') |
3804 |
-+ s = 'Movie\n=====\nTitle: %s\n' % \ |
3805 |
-+ self.get('long imdb canonical title', '') |
3806 |
- genres = self.get('genres') |
3807 |
-- if genres: s += u'Genres: %s.\n' % u', '.join(genres) |
3808 |
-+ if genres: s += 'Genres: %s.\n' % ', '.join(genres) |
3809 |
- director = self.get('director') |
3810 |
- if director: |
3811 |
-- s += u'Director: %s.\n' % _nameAndRole(director) |
3812 |
-+ s += 'Director: %s.\n' % _nameAndRole(director) |
3813 |
- writer = self.get('writer') |
3814 |
- if writer: |
3815 |
-- s += u'Writer: %s.\n' % _nameAndRole(writer) |
3816 |
-+ s += 'Writer: %s.\n' % _nameAndRole(writer) |
3817 |
- cast = self.get('cast') |
3818 |
- if cast: |
3819 |
- cast = cast[:5] |
3820 |
-- s += u'Cast: %s.\n' % _nameAndRole(cast) |
3821 |
-+ s += 'Cast: %s.\n' % _nameAndRole(cast) |
3822 |
- runtime = self.get('runtimes') |
3823 |
- if runtime: |
3824 |
-- s += u'Runtime: %s.\n' % u', '.join(runtime) |
3825 |
-+ s += 'Runtime: %s.\n' % ', '.join(runtime) |
3826 |
- countries = self.get('countries') |
3827 |
- if countries: |
3828 |
-- s += u'Country: %s.\n' % u', '.join(countries) |
3829 |
-+ s += 'Country: %s.\n' % ', '.join(countries) |
3830 |
- lang = self.get('languages') |
3831 |
- if lang: |
3832 |
-- s += u'Language: %s.\n' % u', '.join(lang) |
3833 |
-+ s += 'Language: %s.\n' % ', '.join(lang) |
3834 |
- rating = self.get('rating') |
3835 |
- if rating: |
3836 |
-- s += u'Rating: %s' % rating |
3837 |
-+ s += 'Rating: %s' % rating |
3838 |
- nr_votes = self.get('votes') |
3839 |
- if nr_votes: |
3840 |
-- s += u' (%s votes)' % nr_votes |
3841 |
-- s += u'.\n' |
3842 |
-+ s += ' (%s votes)' % nr_votes |
3843 |
-+ s += '.\n' |
3844 |
- plot = self.get('plot') |
3845 |
- if not plot: |
3846 |
- plot = self.get('plot summary') |
3847 |
-@@ -392,7 +392,7 @@ class Movie(_Container): |
3848 |
- i = plot.find('::') |
3849 |
- if i != -1: |
3850 |
- plot = plot[:i] |
3851 |
-- s += u'Plot: %s' % plot |
3852 |
-+ s += 'Plot: %s' % plot |
3853 |
- return s |
3854 |
- |
3855 |
- |
3856 |
-diff --git a/imdb/Person.py b/imdb/Person.py |
3857 |
-index 6e3e462..e1c7de0 100644 |
3858 |
---- a/imdb/Person.py |
3859 |
-+++ b/imdb/Person.py |
3860 |
-@@ -118,16 +118,16 @@ class Person(_Container): |
3861 |
- *billingPos* -- position of this person in the credits list. |
3862 |
- """ |
3863 |
- name = kwds.get('name') |
3864 |
-- if name and not self.data.has_key('name'): |
3865 |
-+ if name and 'name' not in self.data: |
3866 |
- self.set_name(name) |
3867 |
- self.personID = kwds.get('personID', None) |
3868 |
-- self.myName = kwds.get('myName', u'') |
3869 |
-+ self.myName = kwds.get('myName', '') |
3870 |
- self.billingPos = kwds.get('billingPos', None) |
3871 |
- |
3872 |
- def _reset(self): |
3873 |
- """Reset the Person object.""" |
3874 |
- self.personID = None |
3875 |
-- self.myName = u'' |
3876 |
-+ self.myName = '' |
3877 |
- self.billingPos = None |
3878 |
- |
3879 |
- def _clear(self): |
3880 |
-@@ -143,16 +143,16 @@ class Person(_Container): |
3881 |
- def _additional_keys(self): |
3882 |
- """Valid keys to append to the data.keys() list.""" |
3883 |
- addkeys = [] |
3884 |
-- if self.data.has_key('name'): |
3885 |
-+ if 'name' in self.data: |
3886 |
- addkeys += ['canonical name', 'long imdb name', |
3887 |
- 'long imdb canonical name'] |
3888 |
-- if self.data.has_key('headshot'): |
3889 |
-+ if 'headshot' in self.data: |
3890 |
- addkeys += ['full-size headshot'] |
3891 |
- return addkeys |
3892 |
- |
3893 |
- def _getitem(self, key): |
3894 |
- """Handle special keys.""" |
3895 |
-- if self.data.has_key('name'): |
3896 |
-+ if 'name' in self.data: |
3897 |
- if key == 'name': |
3898 |
- return normalizeName(self.data['name']) |
3899 |
- elif key == 'canonical name': |
3900 |
-@@ -161,7 +161,7 @@ class Person(_Container): |
3901 |
- return build_name(self.data, canonical=0) |
3902 |
- elif key == 'long imdb canonical name': |
3903 |
- return build_name(self.data) |
3904 |
-- if key == 'full-size headshot' and self.data.has_key('headshot'): |
3905 |
-+ if key == 'full-size headshot' and 'headshot' in self.data: |
3906 |
- return self._re_fullsizeURL.sub('', self.data.get('headshot', '')) |
3907 |
- return None |
3908 |
- |
3909 |
-@@ -169,17 +169,17 @@ class Person(_Container): |
3910 |
- """Return the personID.""" |
3911 |
- return self.personID |
3912 |
- |
3913 |
-- def __nonzero__(self): |
3914 |
-+ def __bool__(self): |
3915 |
- """The Person is "false" if the self.data does not contain a name.""" |
3916 |
- # XXX: check the name and the personID? |
3917 |
-- if self.data.has_key('name'): return 1 |
3918 |
-+ if 'name' in self.data: return 1 |
3919 |
- return 0 |
3920 |
- |
3921 |
- def __contains__(self, item): |
3922 |
- """Return true if this Person has worked in the given Movie, |
3923 |
- or if the fiven Character was played by this Person.""" |
3924 |
-- from Movie import Movie |
3925 |
-- from Character import Character |
3926 |
-+ from .Movie import Movie |
3927 |
-+ from .Character import Character |
3928 |
- if isinstance(item, Movie): |
3929 |
- for m in flatten(self.data, yieldDictKeys=1, scalar=Movie): |
3930 |
- if item.isSame(m): |
3931 |
-@@ -196,8 +196,8 @@ class Person(_Container): |
3932 |
- """ |
3933 |
- if not isinstance(other, self.__class__): |
3934 |
- return 0 |
3935 |
-- if self.data.has_key('name') and \ |
3936 |
-- other.data.has_key('name') and \ |
3937 |
-+ if 'name' in self.data and \ |
3938 |
-+ 'name' in other.data and \ |
3939 |
- build_name(self.data, canonical=1) == \ |
3940 |
- build_name(other.data, canonical=1): |
3941 |
- return 1 |
3942 |
-@@ -209,7 +209,7 @@ class Person(_Container): |
3943 |
- |
3944 |
- def __deepcopy__(self, memo): |
3945 |
- """Return a deep copy of a Person instance.""" |
3946 |
-- p = Person(name=u'', personID=self.personID, myName=self.myName, |
3947 |
-+ p = Person(name='', personID=self.personID, myName=self.myName, |
3948 |
- myID=self.myID, data=deepcopy(self.data, memo), |
3949 |
- currentRole=deepcopy(self.currentRole, memo), |
3950 |
- roleIsPerson=self._roleIsPerson, |
3951 |
-@@ -227,49 +227,49 @@ class Person(_Container): |
3952 |
- # XXX: add also currentRole and notes, if present? |
3953 |
- r = '<Person id:%s[%s] name:_%s_>' % (self.personID, self.accessSystem, |
3954 |
- self.get('long imdb canonical name')) |
3955 |
-- if isinstance(r, unicode): r = r.encode('utf_8', 'replace') |
3956 |
-+ if isinstance(r, str): r = r.encode('utf_8', 'replace') |
3957 |
- return r |
3958 |
- |
3959 |
- def __str__(self): |
3960 |
- """Simply print the short name.""" |
3961 |
-- return self.get('name', u'').encode('utf_8', 'replace') |
3962 |
-+ return self.get('name', '').encode('utf_8', 'replace') |
3963 |
- |
3964 |
- def __unicode__(self): |
3965 |
- """Simply print the short title.""" |
3966 |
-- return self.get('name', u'') |
3967 |
-+ return self.get('name', '') |
3968 |
- |
3969 |
- def summary(self): |
3970 |
- """Return a string with a pretty-printed summary for the person.""" |
3971 |
-- if not self: return u'' |
3972 |
-- s = u'Person\n=====\nName: %s\n' % \ |
3973 |
-- self.get('long imdb canonical name', u'') |
3974 |
-+ if not self: return '' |
3975 |
-+ s = 'Person\n=====\nName: %s\n' % \ |
3976 |
-+ self.get('long imdb canonical name', '') |
3977 |
- bdate = self.get('birth date') |
3978 |
- if bdate: |
3979 |
-- s += u'Birth date: %s' % bdate |
3980 |
-+ s += 'Birth date: %s' % bdate |
3981 |
- bnotes = self.get('birth notes') |
3982 |
- if bnotes: |
3983 |
-- s += u' (%s)' % bnotes |
3984 |
-- s += u'.\n' |
3985 |
-+ s += ' (%s)' % bnotes |
3986 |
-+ s += '.\n' |
3987 |
- ddate = self.get('death date') |
3988 |
- if ddate: |
3989 |
-- s += u'Death date: %s' % ddate |
3990 |
-+ s += 'Death date: %s' % ddate |
3991 |
- dnotes = self.get('death notes') |
3992 |
- if dnotes: |
3993 |
-- s += u' (%s)' % dnotes |
3994 |
-- s += u'.\n' |
3995 |
-+ s += ' (%s)' % dnotes |
3996 |
-+ s += '.\n' |
3997 |
- bio = self.get('mini biography') |
3998 |
- if bio: |
3999 |
-- s += u'Biography: %s\n' % bio[0] |
4000 |
-+ s += 'Biography: %s\n' % bio[0] |
4001 |
- director = self.get('director') |
4002 |
- if director: |
4003 |
-- d_list = [x.get('long imdb canonical title', u'') |
4004 |
-+ d_list = [x.get('long imdb canonical title', '') |
4005 |
- for x in director[:3]] |
4006 |
-- s += u'Last movies directed: %s.\n' % u'; '.join(d_list) |
4007 |
-+ s += 'Last movies directed: %s.\n' % '; '.join(d_list) |
4008 |
- act = self.get('actor') or self.get('actress') |
4009 |
- if act: |
4010 |
-- a_list = [x.get('long imdb canonical title', u'') |
4011 |
-+ a_list = [x.get('long imdb canonical title', '') |
4012 |
- for x in act[:5]] |
4013 |
-- s += u'Last movies acted: %s.\n' % u'; '.join(a_list) |
4014 |
-+ s += 'Last movies acted: %s.\n' % '; '.join(a_list) |
4015 |
- return s |
4016 |
- |
4017 |
- |
4018 |
-diff --git a/imdb/__init__.py b/imdb/__init__.py |
4019 |
-index f93482d..3921dbf 100644 |
4020 |
---- a/imdb/__init__.py |
4021 |
-+++ b/imdb/__init__.py |
4022 |
-@@ -28,9 +28,9 @@ __all__ = ['IMDb', 'IMDbError', 'Movie', 'Person', 'Character', 'Company', |
4023 |
- __version__ = VERSION = '4.9' |
4024 |
- |
4025 |
- # Import compatibility module (importing it is enough). |
4026 |
--import _compat |
4027 |
-+from . import _compat |
4028 |
- |
4029 |
--import sys, os, ConfigParser, logging |
4030 |
-+import sys, os, configparser, logging |
4031 |
- from types import MethodType |
4032 |
- |
4033 |
- from imdb import Movie, Person, Character, Company |
4034 |
-@@ -75,14 +75,14 @@ imdbURL_find = imdbURL_base + 'find?%s' |
4035 |
- # Name of the configuration file. |
4036 |
- confFileName = 'imdbpy.cfg' |
4037 |
- |
4038 |
--class ConfigParserWithCase(ConfigParser.ConfigParser): |
4039 |
-+class ConfigParserWithCase(configparser.ConfigParser): |
4040 |
- """A case-sensitive parser for configuration files.""" |
4041 |
- def __init__(self, defaults=None, confFile=None, *args, **kwds): |
4042 |
- """Initialize the parser. |
4043 |
- |
4044 |
- *defaults* -- defaults values. |
4045 |
- *confFile* -- the file (or list of files) to parse.""" |
4046 |
-- ConfigParser.ConfigParser.__init__(self, defaults=defaults) |
4047 |
-+ configparser.ConfigParser.__init__(self, defaults=defaults) |
4048 |
- if confFile is None: |
4049 |
- dotFileName = '.' + confFileName |
4050 |
- # Current and home directory. |
4051 |
-@@ -102,8 +102,8 @@ class ConfigParserWithCase(ConfigParser.ConfigParser): |
4052 |
- for fname in confFile: |
4053 |
- try: |
4054 |
- self.read(fname) |
4055 |
-- except (ConfigParser.MissingSectionHeaderError, |
4056 |
-- ConfigParser.ParsingError), e: |
4057 |
-+ except (configparser.MissingSectionHeaderError, |
4058 |
-+ configparser.ParsingError) as e: |
4059 |
- _aux_logger.warn('Troubles reading config file: %s' % e) |
4060 |
- # Stop at the first valid file. |
4061 |
- if self.has_section('imdbpy'): |
4062 |
-@@ -115,7 +115,7 @@ class ConfigParserWithCase(ConfigParser.ConfigParser): |
4063 |
- |
4064 |
- def _manageValue(self, value): |
4065 |
- """Custom substitutions for values.""" |
4066 |
-- if not isinstance(value, (str, unicode)): |
4067 |
-+ if not isinstance(value, str): |
4068 |
- return value |
4069 |
- vlower = value.lower() |
4070 |
- if vlower in self._boolean_states: |
4071 |
-@@ -126,7 +126,7 @@ class ConfigParserWithCase(ConfigParser.ConfigParser): |
4072 |
- |
4073 |
- def get(self, section, option, *args, **kwds): |
4074 |
- """Return the value of an option from a given section.""" |
4075 |
-- value = ConfigParser.ConfigParser.get(self, section, option, |
4076 |
-+ value = configparser.ConfigParser.get(self, section, option, |
4077 |
- *args, **kwds) |
4078 |
- return self._manageValue(value) |
4079 |
- |
4080 |
-@@ -135,7 +135,7 @@ class ConfigParserWithCase(ConfigParser.ConfigParser): |
4081 |
- given section.""" |
4082 |
- if section != 'DEFAULT' and not self.has_section(section): |
4083 |
- return [] |
4084 |
-- keys = ConfigParser.ConfigParser.options(self, section) |
4085 |
-+ keys = configparser.ConfigParser.options(self, section) |
4086 |
- return [(k, self.get(section, k, *args, **kwds)) for k in keys] |
4087 |
- |
4088 |
- def getDict(self, section): |
4089 |
-@@ -159,7 +159,7 @@ def IMDb(accessSystem=None, *arguments, **keywords): |
4090 |
- accessSystem = 'http' |
4091 |
- kwds.update(keywords) |
4092 |
- keywords = kwds |
4093 |
-- except Exception, e: |
4094 |
-+ except Exception as e: |
4095 |
- logging.getLogger('imdbpy').warn('Unable to read configuration' \ |
4096 |
- ' file; complete error: %s' % e) |
4097 |
- # It just LOOKS LIKE a bad habit: we tried to read config |
4098 |
-@@ -176,24 +176,24 @@ def IMDb(accessSystem=None, *arguments, **keywords): |
4099 |
- try: |
4100 |
- import logging.config |
4101 |
- logging.config.fileConfig(os.path.expanduser(logCfg)) |
4102 |
-- except Exception, e: |
4103 |
-+ except Exception as e: |
4104 |
- logging.getLogger('imdbpy').warn('unable to read logger ' \ |
4105 |
- 'config: %s' % e) |
4106 |
- if accessSystem in ('httpThin', 'webThin', 'htmlThin'): |
4107 |
- logging.warn('httpThin was removed since IMDbPY 4.8') |
4108 |
- accessSystem = 'http' |
4109 |
- if accessSystem in ('http', 'web', 'html'): |
4110 |
-- from parser.http import IMDbHTTPAccessSystem |
4111 |
-+ from .parser.http import IMDbHTTPAccessSystem |
4112 |
- return IMDbHTTPAccessSystem(*arguments, **keywords) |
4113 |
- elif accessSystem in ('mobile',): |
4114 |
-- from parser.mobile import IMDbMobileAccessSystem |
4115 |
-+ from .parser.mobile import IMDbMobileAccessSystem |
4116 |
- return IMDbMobileAccessSystem(*arguments, **keywords) |
4117 |
- elif accessSystem in ('local', 'files'): |
4118 |
- # The local access system was removed since IMDbPY 4.2. |
4119 |
- raise IMDbError('the local access system was removed since IMDbPY 4.2') |
4120 |
- elif accessSystem in ('sql', 'db', 'database'): |
4121 |
- try: |
4122 |
-- from parser.sql import IMDbSqlAccessSystem |
4123 |
-+ from .parser.sql import IMDbSqlAccessSystem |
4124 |
- except ImportError: |
4125 |
- raise IMDbError('the sql access system is not installed') |
4126 |
- return IMDbSqlAccessSystem(*arguments, **keywords) |
4127 |
-@@ -207,17 +207,17 @@ def available_access_systems(): |
4128 |
- asList = [] |
4129 |
- # XXX: trying to import modules is a good thing? |
4130 |
- try: |
4131 |
-- from parser.http import IMDbHTTPAccessSystem |
4132 |
-+ from .parser.http import IMDbHTTPAccessSystem |
4133 |
- asList.append('http') |
4134 |
- except ImportError: |
4135 |
- pass |
4136 |
- try: |
4137 |
-- from parser.mobile import IMDbMobileAccessSystem |
4138 |
-+ from .parser.mobile import IMDbMobileAccessSystem |
4139 |
- asList.append('mobile') |
4140 |
- except ImportError: |
4141 |
- pass |
4142 |
- try: |
4143 |
-- from parser.sql import IMDbSqlAccessSystem |
4144 |
-+ from .parser.sql import IMDbSqlAccessSystem |
4145 |
- asList.append('sql') |
4146 |
- except ImportError: |
4147 |
- pass |
4148 |
-@@ -429,8 +429,8 @@ class IMDbBase: |
4149 |
- results = 20 |
4150 |
- # XXX: I suppose it will be much safer if the user provides |
4151 |
- # an unicode string... this is just a guess. |
4152 |
-- if not isinstance(title, unicode): |
4153 |
-- title = unicode(title, encoding, 'replace') |
4154 |
-+ if not isinstance(title, str): |
4155 |
-+ title = str(title, encoding, 'replace') |
4156 |
- if not _episodes: |
4157 |
- res = self._search_movie(title, results) |
4158 |
- else: |
4159 |
-@@ -489,8 +489,8 @@ class IMDbBase: |
4160 |
- results = int(results) |
4161 |
- except (ValueError, OverflowError): |
4162 |
- results = 20 |
4163 |
-- if not isinstance(name, unicode): |
4164 |
-- name = unicode(name, encoding, 'replace') |
4165 |
-+ if not isinstance(name, str): |
4166 |
-+ name = str(name, encoding, 'replace') |
4167 |
- res = self._search_person(name, results) |
4168 |
- return [Person.Person(personID=self._get_real_personID(pi), |
4169 |
- data=pd, modFunct=self._defModFunct, |
4170 |
-@@ -534,8 +534,8 @@ class IMDbBase: |
4171 |
- results = int(results) |
4172 |
- except (ValueError, OverflowError): |
4173 |
- results = 20 |
4174 |
-- if not isinstance(name, unicode): |
4175 |
-- name = unicode(name, encoding, 'replace') |
4176 |
-+ if not isinstance(name, str): |
4177 |
-+ name = str(name, encoding, 'replace') |
4178 |
- res = self._search_character(name, results) |
4179 |
- return [Character.Character(characterID=self._get_real_characterID(pi), |
4180 |
- data=pd, modFunct=self._defModFunct, |
4181 |
-@@ -579,8 +579,8 @@ class IMDbBase: |
4182 |
- results = int(results) |
4183 |
- except (ValueError, OverflowError): |
4184 |
- results = 20 |
4185 |
-- if not isinstance(name, unicode): |
4186 |
-- name = unicode(name, encoding, 'replace') |
4187 |
-+ if not isinstance(name, str): |
4188 |
-+ name = str(name, encoding, 'replace') |
4189 |
- res = self._search_company(name, results) |
4190 |
- return [Company.Company(companyID=self._get_real_companyID(pi), |
4191 |
- data=pd, modFunct=self._defModFunct, |
4192 |
-@@ -600,8 +600,8 @@ class IMDbBase: |
4193 |
- results = int(results) |
4194 |
- except (ValueError, OverflowError): |
4195 |
- results = 100 |
4196 |
-- if not isinstance(keyword, unicode): |
4197 |
-- keyword = unicode(keyword, encoding, 'replace') |
4198 |
-+ if not isinstance(keyword, str): |
4199 |
-+ keyword = str(keyword, encoding, 'replace') |
4200 |
- return self._search_keyword(keyword, results) |
4201 |
- |
4202 |
- def _get_keyword(self, keyword, results): |
4203 |
-@@ -620,8 +620,8 @@ class IMDbBase: |
4204 |
- results = 100 |
4205 |
- # XXX: I suppose it will be much safer if the user provides |
4206 |
- # an unicode string... this is just a guess. |
4207 |
-- if not isinstance(keyword, unicode): |
4208 |
-- keyword = unicode(keyword, encoding, 'replace') |
4209 |
-+ if not isinstance(keyword, str): |
4210 |
-+ keyword = str(keyword, encoding, 'replace') |
4211 |
- res = self._get_keyword(keyword, results) |
4212 |
- return [Movie.Movie(movieID=self._get_real_movieID(mi), |
4213 |
- data=md, modFunct=self._defModFunct, |
4214 |
-@@ -653,12 +653,12 @@ class IMDbBase: |
4215 |
- """Return a Movie object.""" |
4216 |
- # XXX: not really useful... |
4217 |
- if 'title' in keywords: |
4218 |
-- if not isinstance(keywords['title'], unicode): |
4219 |
-- keywords['title'] = unicode(keywords['title'], |
4220 |
-+ if not isinstance(keywords['title'], str): |
4221 |
-+ keywords['title'] = str(keywords['title'], |
4222 |
- encoding, 'replace') |
4223 |
- elif len(arguments) > 1: |
4224 |
-- if not isinstance(arguments[1], unicode): |
4225 |
-- arguments[1] = unicode(arguments[1], encoding, 'replace') |
4226 |
-+ if not isinstance(arguments[1], str): |
4227 |
-+ arguments[1] = str(arguments[1], encoding, 'replace') |
4228 |
- return Movie.Movie(accessSystem=self.accessSystem, |
4229 |
- *arguments, **keywords) |
4230 |
- |
4231 |
-@@ -666,12 +666,12 @@ class IMDbBase: |
4232 |
- """Return a Person object.""" |
4233 |
- # XXX: not really useful... |
4234 |
- if 'name' in keywords: |
4235 |
-- if not isinstance(keywords['name'], unicode): |
4236 |
-- keywords['name'] = unicode(keywords['name'], |
4237 |
-+ if not isinstance(keywords['name'], str): |
4238 |
-+ keywords['name'] = str(keywords['name'], |
4239 |
- encoding, 'replace') |
4240 |
- elif len(arguments) > 1: |
4241 |
-- if not isinstance(arguments[1], unicode): |
4242 |
-- arguments[1] = unicode(arguments[1], encoding, 'replace') |
4243 |
-+ if not isinstance(arguments[1], str): |
4244 |
-+ arguments[1] = str(arguments[1], encoding, 'replace') |
4245 |
- return Person.Person(accessSystem=self.accessSystem, |
4246 |
- *arguments, **keywords) |
4247 |
- |
4248 |
-@@ -679,12 +679,12 @@ class IMDbBase: |
4249 |
- """Return a Character object.""" |
4250 |
- # XXX: not really useful... |
4251 |
- if 'name' in keywords: |
4252 |
-- if not isinstance(keywords['name'], unicode): |
4253 |
-- keywords['name'] = unicode(keywords['name'], |
4254 |
-+ if not isinstance(keywords['name'], str): |
4255 |
-+ keywords['name'] = str(keywords['name'], |
4256 |
- encoding, 'replace') |
4257 |
- elif len(arguments) > 1: |
4258 |
-- if not isinstance(arguments[1], unicode): |
4259 |
-- arguments[1] = unicode(arguments[1], encoding, 'replace') |
4260 |
-+ if not isinstance(arguments[1], str): |
4261 |
-+ arguments[1] = str(arguments[1], encoding, 'replace') |
4262 |
- return Character.Character(accessSystem=self.accessSystem, |
4263 |
- *arguments, **keywords) |
4264 |
- |
4265 |
-@@ -692,12 +692,12 @@ class IMDbBase: |
4266 |
- """Return a Company object.""" |
4267 |
- # XXX: not really useful... |
4268 |
- if 'name' in keywords: |
4269 |
-- if not isinstance(keywords['name'], unicode): |
4270 |
-- keywords['name'] = unicode(keywords['name'], |
4271 |
-+ if not isinstance(keywords['name'], str): |
4272 |
-+ keywords['name'] = str(keywords['name'], |
4273 |
- encoding, 'replace') |
4274 |
- elif len(arguments) > 1: |
4275 |
-- if not isinstance(arguments[1], unicode): |
4276 |
-- arguments[1] = unicode(arguments[1], encoding, 'replace') |
4277 |
-+ if not isinstance(arguments[1], str): |
4278 |
-+ arguments[1] = str(arguments[1], encoding, 'replace') |
4279 |
- return Company.Company(accessSystem=self.accessSystem, |
4280 |
- *arguments, **keywords) |
4281 |
- |
4282 |
-@@ -769,7 +769,7 @@ class IMDbBase: |
4283 |
- method = lambda *x: {} |
4284 |
- try: |
4285 |
- ret = method(mopID) |
4286 |
-- except Exception, e: |
4287 |
-+ except Exception as e: |
4288 |
- self._imdb_logger.critical('caught an exception retrieving ' \ |
4289 |
- 'or parsing "%s" info set for mopID ' \ |
4290 |
- '"%s" (accessSystem: %s)', |
4291 |
-@@ -782,7 +782,7 @@ class IMDbBase: |
4292 |
- if 'data' in ret: |
4293 |
- res.update(ret['data']) |
4294 |
- if isinstance(ret['data'], dict): |
4295 |
-- keys = ret['data'].keys() |
4296 |
-+ keys = list(ret['data'].keys()) |
4297 |
- if 'info sets' in ret: |
4298 |
- for ri in ret['info sets']: |
4299 |
- mop.add_to_current_info(ri, keys, mainInfoset=i) |
4300 |
-diff --git a/imdb/helpers.py b/imdb/helpers.py |
4301 |
-index f220614..e9be10c 100644 |
4302 |
---- a/imdb/helpers.py |
4303 |
-+++ b/imdb/helpers.py |
4304 |
-@@ -60,7 +60,7 @@ def makeCgiPrintEncoding(encoding): |
4305 |
- """Encode the given string using the %s encoding, and replace |
4306 |
- chars outside the given charset with XML char references.""" % encoding |
4307 |
- s = escape(s, quote=1) |
4308 |
-- if isinstance(s, unicode): |
4309 |
-+ if isinstance(s, str): |
4310 |
- s = s.encode(encoding, 'xmlcharrefreplace') |
4311 |
- return s |
4312 |
- return cgiPrint |
4313 |
-@@ -85,7 +85,7 @@ def makeTextNotes(replaceTxtNotes): |
4314 |
- of the makeObject2Txt function.""" |
4315 |
- def _replacer(s): |
4316 |
- outS = replaceTxtNotes |
4317 |
-- if not isinstance(s, (unicode, str)): |
4318 |
-+ if not isinstance(s, str): |
4319 |
- return s |
4320 |
- ssplit = s.split('::', 1) |
4321 |
- text = ssplit[0] |
4322 |
-@@ -98,12 +98,12 @@ def makeTextNotes(replaceTxtNotes): |
4323 |
- keysDict['notes'] = True |
4324 |
- outS = outS.replace('%(notes)s', ssplit[1]) |
4325 |
- else: |
4326 |
-- outS = outS.replace('%(notes)s', u'') |
4327 |
-+ outS = outS.replace('%(notes)s', '') |
4328 |
- def _excludeFalseConditionals(matchobj): |
4329 |
- # Return an empty string if the conditional is false/empty. |
4330 |
- if matchobj.group(1) in keysDict: |
4331 |
- return matchobj.group(2) |
4332 |
-- return u'' |
4333 |
-+ return '' |
4334 |
- while re_conditional.search(outS): |
4335 |
- outS = re_conditional.sub(_excludeFalseConditionals, outS) |
4336 |
- return outS |
4337 |
-@@ -139,17 +139,17 @@ def makeObject2Txt(movieTxt=None, personTxt=None, characterTxt=None, |
4338 |
- if _limitRecursion is None: |
4339 |
- _limitRecursion = 0 |
4340 |
- elif _limitRecursion > 5: |
4341 |
-- return u'' |
4342 |
-+ return '' |
4343 |
- _limitRecursion += 1 |
4344 |
- if isinstance(obj, (list, tuple)): |
4345 |
- return joiner.join([object2txt(o, _limitRecursion=_limitRecursion) |
4346 |
- for o in obj]) |
4347 |
- elif isinstance(obj, dict): |
4348 |
- # XXX: not exactly nice, neither useful, I fear. |
4349 |
-- return joiner.join([u'%s::%s' % |
4350 |
-+ return joiner.join(['%s::%s' % |
4351 |
- (object2txt(k, _limitRecursion=_limitRecursion), |
4352 |
- object2txt(v, _limitRecursion=_limitRecursion)) |
4353 |
-- for k, v in obj.items()]) |
4354 |
-+ for k, v in list(obj.items())]) |
4355 |
- objData = {} |
4356 |
- if isinstance(obj, Movie): |
4357 |
- objData['movieID'] = obj.movieID |
4358 |
-@@ -172,25 +172,25 @@ def makeObject2Txt(movieTxt=None, personTxt=None, characterTxt=None, |
4359 |
- if proceed: |
4360 |
- return matchobj.group(2) |
4361 |
- else: |
4362 |
-- return u'' |
4363 |
-+ return '' |
4364 |
- return matchobj.group(2) |
4365 |
- while re_conditional.search(outs): |
4366 |
- outs = re_conditional.sub(_excludeFalseConditionals, outs) |
4367 |
- for key in re_subst.findall(outs): |
4368 |
- value = obj.get(key) or getattr(obj, key, None) |
4369 |
-- if not isinstance(value, (unicode, str)): |
4370 |
-+ if not isinstance(value, str): |
4371 |
- if not _recurse: |
4372 |
- if value: |
4373 |
-- value = unicode(value) |
4374 |
-+ value = str(value) |
4375 |
- if value: |
4376 |
- value = object2txt(value, _limitRecursion=_limitRecursion) |
4377 |
- elif value: |
4378 |
-- value = applyToValues(unicode(value)) |
4379 |
-+ value = applyToValues(str(value)) |
4380 |
- if not value: |
4381 |
-- value = u'' |
4382 |
-- elif not isinstance(value, (unicode, str)): |
4383 |
-- value = unicode(value) |
4384 |
-- outs = outs.replace(u'%(' + key + u')s', value) |
4385 |
-+ value = '' |
4386 |
-+ elif not isinstance(value, str): |
4387 |
-+ value = str(value) |
4388 |
-+ outs = outs.replace('%(' + key + ')s', value) |
4389 |
- return outs |
4390 |
- return object2txt |
4391 |
- |
4392 |
-@@ -213,7 +213,7 @@ def makeModCGILinks(movieTxt, personTxt, characterTxt=None, |
4393 |
- if item: |
4394 |
- movieID = item.movieID |
4395 |
- to_replace = movieTxt % {'movieID': movieID, |
4396 |
-- 'title': unicode(_cgiPrint(to_replace), |
4397 |
-+ 'title': str(_cgiPrint(to_replace), |
4398 |
- encoding, |
4399 |
- 'xmlcharrefreplace')} |
4400 |
- return to_replace |
4401 |
-@@ -223,7 +223,7 @@ def makeModCGILinks(movieTxt, personTxt, characterTxt=None, |
4402 |
- if item: |
4403 |
- personID = item.personID |
4404 |
- to_replace = personTxt % {'personID': personID, |
4405 |
-- 'name': unicode(_cgiPrint(to_replace), |
4406 |
-+ 'name': str(_cgiPrint(to_replace), |
4407 |
- encoding, |
4408 |
- 'xmlcharrefreplace')} |
4409 |
- return to_replace |
4410 |
-@@ -237,7 +237,7 @@ def makeModCGILinks(movieTxt, personTxt, characterTxt=None, |
4411 |
- if characterID is None: |
4412 |
- return to_replace |
4413 |
- to_replace = characterTxt % {'characterID': characterID, |
4414 |
-- 'name': unicode(_cgiPrint(to_replace), |
4415 |
-+ 'name': str(_cgiPrint(to_replace), |
4416 |
- encoding, |
4417 |
- 'xmlcharrefreplace')} |
4418 |
- return to_replace |
4419 |
-@@ -265,7 +265,7 @@ modHtmlLinksASCII = makeModCGILinks(movieTxt=_movieTxt, personTxt=_personTxt, |
4420 |
- |
4421 |
- |
4422 |
- everyentcharrefs = entcharrefs.copy() |
4423 |
--for k, v in {'lt':u'<','gt':u'>','amp':u'&','quot':u'"','apos':u'\''}.items(): |
4424 |
-+for k, v in list({'lt':'<','gt':'>','amp':'&','quot':'"','apos':'\''}.items()): |
4425 |
- everyentcharrefs[k] = v |
4426 |
- everyentcharrefs['#%s' % ord(v)] = v |
4427 |
- everyentcharrefsget = everyentcharrefs.get |
4428 |
-@@ -279,7 +279,7 @@ def _replAllXMLRef(match): |
4429 |
- value = everyentcharrefsget(ref) |
4430 |
- if value is None: |
4431 |
- if ref[0] == '#': |
4432 |
-- return unichr(int(ref[1:])) |
4433 |
-+ return chr(int(ref[1:])) |
4434 |
- else: |
4435 |
- return ref |
4436 |
- return value |
4437 |
-@@ -292,7 +292,7 @@ def subXMLHTMLSGMLRefs(s): |
4438 |
- |
4439 |
- def sortedSeasons(m): |
4440 |
- """Return a sorted list of seasons of the given series.""" |
4441 |
-- seasons = m.get('episodes', {}).keys() |
4442 |
-+ seasons = list(m.get('episodes', {}).keys()) |
4443 |
- seasons.sort() |
4444 |
- return seasons |
4445 |
- |
4446 |
-@@ -308,7 +308,7 @@ def sortedEpisodes(m, season=None): |
4447 |
- if not isinstance(season, (tuple, list)): |
4448 |
- seasons = [season] |
4449 |
- for s in seasons: |
4450 |
-- eps_indx = m.get('episodes', {}).get(s, {}).keys() |
4451 |
-+ eps_indx = list(m.get('episodes', {}).get(s, {}).keys()) |
4452 |
- eps_indx.sort() |
4453 |
- for e in eps_indx: |
4454 |
- episodes.append(m['episodes'][s][e]) |
4455 |
-@@ -382,7 +382,7 @@ _MAP_TOP_OBJ = { |
4456 |
- } |
4457 |
- |
4458 |
- # Tags to be converted to lists. |
4459 |
--_TAGS_TO_LIST = dict([(x[0], None) for x in TAGS_TO_MODIFY.values()]) |
4460 |
-+_TAGS_TO_LIST = dict([(x[0], None) for x in list(TAGS_TO_MODIFY.values())]) |
4461 |
- _TAGS_TO_LIST.update(_MAP_TOP_OBJ) |
4462 |
- |
4463 |
- def tagToKey(tag): |
4464 |
-@@ -423,12 +423,12 @@ def parseTags(tag, _topLevel=True, _as=None, _infoset2keys=None, |
4465 |
- _key2infoset = {} |
4466 |
- name = tagToKey(tag) |
4467 |
- firstChild = tag.find(recursive=False) |
4468 |
-- tagStr = (tag.string or u'').strip() |
4469 |
-+ tagStr = (tag.string or '').strip() |
4470 |
- if not tagStr and name == 'item': |
4471 |
- # Handles 'item' tags containing text and a 'notes' sub-tag. |
4472 |
- tagContent = tag.contents[0] |
4473 |
- if isinstance(tagContent, BeautifulSoup.NavigableString): |
4474 |
-- tagStr = (unicode(tagContent) or u'').strip() |
4475 |
-+ tagStr = (str(tagContent) or '').strip() |
4476 |
- tagType = tag.get('type') |
4477 |
- infoset = tag.get('infoset') |
4478 |
- if infoset: |
4479 |
-@@ -504,9 +504,9 @@ def parseTags(tag, _topLevel=True, _as=None, _infoset2keys=None, |
4480 |
- _adder = lambda key, value: item.data.update({key: value}) |
4481 |
- elif tagStr: |
4482 |
- if tag.notes: |
4483 |
-- notes = (tag.notes.string or u'').strip() |
4484 |
-+ notes = (tag.notes.string or '').strip() |
4485 |
- if notes: |
4486 |
-- tagStr += u'::%s' % notes |
4487 |
-+ tagStr += '::%s' % notes |
4488 |
- else: |
4489 |
- tagStr = _valueWithType(tag, tagStr) |
4490 |
- return tagStr |
4491 |
-@@ -534,7 +534,7 @@ def parseTags(tag, _topLevel=True, _as=None, _infoset2keys=None, |
4492 |
- # Add information about 'info sets', but only to the top-level object. |
4493 |
- item.infoset2keys = _infoset2keys |
4494 |
- item.key2infoset = _key2infoset |
4495 |
-- item.current_info = _infoset2keys.keys() |
4496 |
-+ item.current_info = list(_infoset2keys.keys()) |
4497 |
- return item |
4498 |
- |
4499 |
- |
4500 |
-@@ -594,7 +594,7 @@ def sortAKAsBySimilarity(movie, title, _titlesOnly=True, _preferredLang=None): |
4501 |
- # estimate string distance between current title and given title |
4502 |
- m_title = movie['title'].lower() |
4503 |
- l_title = title.lower() |
4504 |
-- if isinstance(l_title, unicode): |
4505 |
-+ if isinstance(l_title, str): |
4506 |
- l_title = l_title.encode('utf8') |
4507 |
- scores = [] |
4508 |
- score = difflib.SequenceMatcher(None, m_title.encode('utf8'), l_title).ratio() |
4509 |
-@@ -603,7 +603,7 @@ def sortAKAsBySimilarity(movie, title, _titlesOnly=True, _preferredLang=None): |
4510 |
- for language, aka in akasLanguages(movie): |
4511 |
- # estimate string distance between current title and given title |
4512 |
- m_title = aka.lower() |
4513 |
-- if isinstance(m_title, unicode): |
4514 |
-+ if isinstance(m_title, str): |
4515 |
- m_title = m_title.encode('utf8') |
4516 |
- score = difflib.SequenceMatcher(None, m_title, l_title).ratio() |
4517 |
- # if current language is the same as the given one, increase score |
4518 |
-@@ -626,7 +626,7 @@ def getAKAsInLanguage(movie, lang, _searchedTitle=None): |
4519 |
- akas.append(aka) |
4520 |
- if _searchedTitle: |
4521 |
- scores = [] |
4522 |
-- if isinstance(_searchedTitle, unicode): |
4523 |
-+ if isinstance(_searchedTitle, str): |
4524 |
- _searchedTitle = _searchedTitle.encode('utf8') |
4525 |
- for aka in akas: |
4526 |
- m_aka = aka |
4527 |
-diff --git a/imdb/linguistics.py b/imdb/linguistics.py |
4528 |
-index da8829f..0679de9 100644 |
4529 |
---- a/imdb/linguistics.py |
4530 |
-+++ b/imdb/linguistics.py |
4531 |
-@@ -154,7 +154,7 @@ for lang in LANG_COUNTRIES: |
4532 |
- |
4533 |
- def toUnicode(articles): |
4534 |
- """Convert a list of articles utf-8 encoded to unicode strings.""" |
4535 |
-- return tuple([art.decode('utf_8') for art in articles]) |
4536 |
-+ return tuple([articles]) |
4537 |
- |
4538 |
- |
4539 |
- def toDicts(articles): |
4540 |
-diff --git a/imdb/locale/generatepot.py b/imdb/locale/generatepot.py |
4541 |
-index 282f7d4..a914d32 100755 |
4542 |
---- a/imdb/locale/generatepot.py |
4543 |
-+++ b/imdb/locale/generatepot.py |
4544 |
-@@ -50,7 +50,7 @@ msgstr "" |
4545 |
- """ |
4546 |
- |
4547 |
- if len(sys.argv) != 2: |
4548 |
-- print "Usage: %s dtd_file" % sys.argv[0] |
4549 |
-+ print("Usage: %s dtd_file" % sys.argv[0]) |
4550 |
- sys.exit() |
4551 |
- |
4552 |
- dtdfilename = sys.argv[1] |
4553 |
-@@ -59,20 +59,20 @@ elements = re_element.findall(dtd) |
4554 |
- uniq = set(elements) |
4555 |
- elements = list(uniq) |
4556 |
- |
4557 |
--print POT_HEADER_TEMPLATE % { |
4558 |
-+print(POT_HEADER_TEMPLATE % { |
4559 |
- 'now': dt.strftime(dt.now(), "%Y-%m-%d %H:%M+0000") |
4560 |
--} |
4561 |
-+}) |
4562 |
- for element in sorted(elements): |
4563 |
- if element in DEFAULT_MESSAGES: |
4564 |
-- print '# Default: %s' % DEFAULT_MESSAGES[element] |
4565 |
-+ print('# Default: %s' % DEFAULT_MESSAGES[element]) |
4566 |
- else: |
4567 |
-- print '# Default: %s' % element.replace('-', ' ').capitalize() |
4568 |
-- print 'msgid "%s"' % element |
4569 |
-- print 'msgstr ""' |
4570 |
-+ print('# Default: %s' % element.replace('-', ' ').capitalize()) |
4571 |
-+ print('msgid "%s"' % element) |
4572 |
-+ print('msgstr ""') |
4573 |
- # use this part instead of the line above to generate the po file for English |
4574 |
- #if element in DEFAULT_MESSAGES: |
4575 |
- # print 'msgstr "%s"' % DEFAULT_MESSAGES[element] |
4576 |
- #else: |
4577 |
- # print 'msgstr "%s"' % element.replace('-', ' ').capitalize() |
4578 |
-- print |
4579 |
-+ print() |
4580 |
- |
4581 |
-diff --git a/imdb/locale/msgfmt.py b/imdb/locale/msgfmt.py |
4582 |
-index 9e0ab74..7eaf251 100644 |
4583 |
---- a/imdb/locale/msgfmt.py |
4584 |
-+++ b/imdb/locale/msgfmt.py |
4585 |
-@@ -106,7 +106,7 @@ class MsgFmt(object): |
4586 |
- |
4587 |
- def generate_mo(self): |
4588 |
- """Return the generated output.""" |
4589 |
-- keys = self.messages.keys() |
4590 |
-+ keys = list(self.messages.keys()) |
4591 |
- # the keys are sorted in the .mo file |
4592 |
- keys.sort() |
4593 |
- offsets = [] |
4594 |
-@@ -134,7 +134,7 @@ class MsgFmt(object): |
4595 |
- voffsets += [l2, o2 + valuestart] |
4596 |
- offsets = koffsets + voffsets |
4597 |
- output.append(struct.pack("Iiiiiii", |
4598 |
-- 0x950412deL, # Magic |
4599 |
-+ 0x950412de, # Magic |
4600 |
- 0, # Version |
4601 |
- len(keys), # # of entries |
4602 |
- 7*4, # start of key index |
4603 |
-@@ -151,32 +151,32 @@ def make(filename, outfile): |
4604 |
- infile, outfile = mf.make_filenames(filename, outfile) |
4605 |
- try: |
4606 |
- lines = file(infile).readlines() |
4607 |
-- except IOError, msg: |
4608 |
-- print >> sys.stderr, msg |
4609 |
-+ except IOError as msg: |
4610 |
-+ print(msg, file=sys.stderr) |
4611 |
- sys.exit(1) |
4612 |
- try: |
4613 |
- mf.read_po(lines) |
4614 |
- output = mf.generate_mo() |
4615 |
-- except SyntaxErrorException, msg: |
4616 |
-- print >> sys.stderr, msg |
4617 |
-+ except SyntaxErrorException as msg: |
4618 |
-+ print(msg, file=sys.stderr) |
4619 |
- |
4620 |
- try: |
4621 |
- open(outfile, "wb").write(output) |
4622 |
-- except IOError, msg: |
4623 |
-- print >> sys.stderr, msg |
4624 |
-+ except IOError as msg: |
4625 |
-+ print(msg, file=sys.stderr) |
4626 |
- |
4627 |
- |
4628 |
- def usage(code, msg=''): |
4629 |
-- print >> sys.stderr, __doc__ |
4630 |
-+ print(__doc__, file=sys.stderr) |
4631 |
- if msg: |
4632 |
-- print >> sys.stderr, msg |
4633 |
-+ print(msg, file=sys.stderr) |
4634 |
- sys.exit(code) |
4635 |
- |
4636 |
- |
4637 |
- def main(): |
4638 |
- try: |
4639 |
- opts, args = getopt.getopt(sys.argv[1:], 'hVo:', ['help', 'version', 'output-file=']) |
4640 |
-- except getopt.error, msg: |
4641 |
-+ except getopt.error as msg: |
4642 |
- usage(1, msg) |
4643 |
- |
4644 |
- outfile = None |
4645 |
-@@ -185,14 +185,14 @@ def main(): |
4646 |
- if opt in ('-h', '--help'): |
4647 |
- usage(0) |
4648 |
- elif opt in ('-V', '--version'): |
4649 |
-- print >> sys.stderr, "msgfmt.py", __version__ |
4650 |
-+ print("msgfmt.py", __version__, file=sys.stderr) |
4651 |
- sys.exit(0) |
4652 |
- elif opt in ('-o', '--output-file'): |
4653 |
- outfile = arg |
4654 |
- # do it |
4655 |
- if not args: |
4656 |
-- print >> sys.stderr, 'No input file given' |
4657 |
-- print >> sys.stderr, "Try `msgfmt --help' for more information." |
4658 |
-+ print('No input file given', file=sys.stderr) |
4659 |
-+ print("Try `msgfmt --help' for more information.", file=sys.stderr) |
4660 |
- return |
4661 |
- |
4662 |
- for filename in args: |
4663 |
-diff --git a/imdb/locale/rebuildmo.py b/imdb/locale/rebuildmo.py |
4664 |
-index b72a74c..3f6302b 100755 |
4665 |
---- a/imdb/locale/rebuildmo.py |
4666 |
-+++ b/imdb/locale/rebuildmo.py |
4667 |
-@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
4668 |
- """ |
4669 |
- |
4670 |
- import glob |
4671 |
--import msgfmt |
4672 |
-+from . import msgfmt |
4673 |
- import os |
4674 |
- |
4675 |
- #LOCALE_DIR = os.path.dirname(__file__) |
4676 |
-@@ -45,5 +45,5 @@ def rebuildmo(): |
4677 |
- |
4678 |
- if __name__ == '__main__': |
4679 |
- languages = rebuildmo() |
4680 |
-- print 'Created locale for: %s.' % ' '.join(languages) |
4681 |
-+ print('Created locale for: %s.' % ' '.join(languages)) |
4682 |
- |
4683 |
-diff --git a/imdb/parser/http/__init__.py b/imdb/parser/http/__init__.py |
4684 |
-index e49e7bb..91d96da 100644 |
4685 |
---- a/imdb/parser/http/__init__.py |
4686 |
-+++ b/imdb/parser/http/__init__.py |
4687 |
-@@ -28,7 +28,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
4688 |
- import sys |
4689 |
- import socket |
4690 |
- import logging |
4691 |
--from urllib import FancyURLopener, quote_plus |
4692 |
-+from urllib.request import FancyURLopener |
4693 |
-+from urllib.parse import quote_plus |
4694 |
- from codecs import lookup |
4695 |
- |
4696 |
- from imdb import IMDbBase, imdbURL_movie_main, imdbURL_person_main, \ |
4697 |
-@@ -38,16 +39,16 @@ from imdb import IMDbBase, imdbURL_movie_main, imdbURL_person_main, \ |
4698 |
- from imdb.utils import analyze_title |
4699 |
- from imdb._exceptions import IMDbDataAccessError, IMDbParserError |
4700 |
- |
4701 |
--import searchMovieParser |
4702 |
--import searchPersonParser |
4703 |
--import searchCharacterParser |
4704 |
--import searchCompanyParser |
4705 |
--import searchKeywordParser |
4706 |
--import movieParser |
4707 |
--import personParser |
4708 |
--import characterParser |
4709 |
--import companyParser |
4710 |
--import topBottomParser |
4711 |
-+from . import searchMovieParser |
4712 |
-+from . import searchPersonParser |
4713 |
-+from . import searchCharacterParser |
4714 |
-+from . import searchCompanyParser |
4715 |
-+from . import searchKeywordParser |
4716 |
-+from . import movieParser |
4717 |
-+from . import personParser |
4718 |
-+from . import characterParser |
4719 |
-+from . import companyParser |
4720 |
-+from . import topBottomParser |
4721 |
- |
4722 |
- # Logger for miscellaneous functions. |
4723 |
- _aux_logger = logging.getLogger('imdbpy.parser.http.aux') |
4724 |
-@@ -132,7 +133,7 @@ class IMDbURLopener(FancyURLopener): |
4725 |
- _logger = logging.getLogger('imdbpy.parser.http.urlopener') |
4726 |
- |
4727 |
- def __init__(self, *args, **kwargs): |
4728 |
-- self._last_url = u'' |
4729 |
-+ self._last_url = '' |
4730 |
- FancyURLopener.__init__(self, *args, **kwargs) |
4731 |
- # Headers to add to every request. |
4732 |
- # XXX: IMDb's web server doesn't like urllib-based programs, |
4733 |
-@@ -153,7 +154,7 @@ class IMDbURLopener(FancyURLopener): |
4734 |
- def set_proxy(self, proxy): |
4735 |
- """Set the proxy.""" |
4736 |
- if not proxy: |
4737 |
-- if self.proxies.has_key('http'): |
4738 |
-+ if 'http' in self.proxies: |
4739 |
- del self.proxies['http'] |
4740 |
- else: |
4741 |
- if not proxy.lower().startswith('http://'): |
4742 |
-@@ -169,14 +170,14 @@ class IMDbURLopener(FancyURLopener): |
4743 |
- def get_header(self, header): |
4744 |
- """Return the first value of a header, or None |
4745 |
- if not present.""" |
4746 |
-- for index in xrange(len(self.addheaders)): |
4747 |
-+ for index in range(len(self.addheaders)): |
4748 |
- if self.addheaders[index][0] == header: |
4749 |
- return self.addheaders[index][1] |
4750 |
- return None |
4751 |
- |
4752 |
- def del_header(self, header): |
4753 |
- """Remove a default header.""" |
4754 |
-- for index in xrange(len(self.addheaders)): |
4755 |
-+ for index in range(len(self.addheaders)): |
4756 |
- if self.addheaders[index][0] == header: |
4757 |
- del self.addheaders[index] |
4758 |
- break |
4759 |
-@@ -215,7 +216,7 @@ class IMDbURLopener(FancyURLopener): |
4760 |
- if size != -1: |
4761 |
- self.del_header('Range') |
4762 |
- self.close() |
4763 |
-- except IOError, e: |
4764 |
-+ except IOError as e: |
4765 |
- if size != -1: |
4766 |
- # Ensure that the Range header is removed. |
4767 |
- self.del_header('Range') |
4768 |
-@@ -231,7 +232,7 @@ class IMDbURLopener(FancyURLopener): |
4769 |
- self._logger.warn('Unable to detect the encoding of the retrieved ' |
4770 |
- 'page [%s]; falling back to default latin1.', encode) |
4771 |
- ##print unicode(content, encode, 'replace').encode('utf8') |
4772 |
-- return unicode(content, encode, 'replace') |
4773 |
-+ return str(content, encode, 'replace') |
4774 |
- |
4775 |
- def http_error_default(self, url, fp, errcode, errmsg, headers): |
4776 |
- if errcode == 404: |
4777 |
-@@ -333,21 +334,21 @@ class IMDbHTTPAccessSystem(IMDbBase): |
4778 |
- """Normalize the given movieID.""" |
4779 |
- try: |
4780 |
- return '%07d' % int(movieID) |
4781 |
-- except ValueError, e: |
4782 |
-+ except ValueError as e: |
4783 |
- raise IMDbParserError('invalid movieID "%s": %s' % (movieID, e)) |
4784 |
- |
4785 |
- def _normalize_personID(self, personID): |
4786 |
- """Normalize the given personID.""" |
4787 |
- try: |
4788 |
- return '%07d' % int(personID) |
4789 |
-- except ValueError, e: |
4790 |
-+ except ValueError as e: |
4791 |
- raise IMDbParserError('invalid personID "%s": %s' % (personID, e)) |
4792 |
- |
4793 |
- def _normalize_characterID(self, characterID): |
4794 |
- """Normalize the given characterID.""" |
4795 |
- try: |
4796 |
- return '%07d' % int(characterID) |
4797 |
-- except ValueError, e: |
4798 |
-+ except ValueError as e: |
4799 |
- raise IMDbParserError('invalid characterID "%s": %s' % \ |
4800 |
- (characterID, e)) |
4801 |
- |
4802 |
-@@ -355,7 +356,7 @@ class IMDbHTTPAccessSystem(IMDbBase): |
4803 |
- """Normalize the given companyID.""" |
4804 |
- try: |
4805 |
- return '%07d' % int(companyID) |
4806 |
-- except ValueError, e: |
4807 |
-+ except ValueError as e: |
4808 |
- raise IMDbParserError('invalid companyID "%s": %s' % \ |
4809 |
- (companyID, e)) |
4810 |
- |
4811 |
-@@ -453,13 +454,13 @@ class IMDbHTTPAccessSystem(IMDbBase): |
4812 |
- 'char' (for characters) or 'co' (for companies). |
4813 |
- ton is the title or the name to search. |
4814 |
- results is the maximum number of results to be retrieved.""" |
4815 |
-- if isinstance(ton, unicode): |
4816 |
-+ if isinstance(ton, str): |
4817 |
- try: |
4818 |
- ton = ton.encode('iso8859-1') |
4819 |
-- except Exception, e: |
4820 |
-+ except Exception as e: |
4821 |
- try: |
4822 |
- ton = ton.encode('utf-8') |
4823 |
-- except Exception, e: |
4824 |
-+ except Exception as e: |
4825 |
- pass |
4826 |
- ##params = 'q=%s&%s=on&mx=%s' % (quote_plus(ton), kind, str(results)) |
4827 |
- params = 'q=%s;s=%s;mx=%s' % (quote_plus(ton), kind, str(results)) |
4828 |
-@@ -666,7 +667,7 @@ class IMDbHTTPAccessSystem(IMDbBase): |
4829 |
- cont = self._retrieve(self.urls['movie_main'] % movieID + 'epdate', _noCookies=True) |
4830 |
- data_d = self.mProxy.eprating_parser.parse(cont) |
4831 |
- # set movie['episode of'].movieID for every episode. |
4832 |
-- if data_d.get('data', {}).has_key('episodes rating'): |
4833 |
-+ if 'episodes rating' in data_d.get('data', {}): |
4834 |
- for item in data_d['data']['episodes rating']: |
4835 |
- episode = item['episode'] |
4836 |
- episode['episode of'].movieID = movieID |
4837 |
-diff --git a/imdb/parser/http/bsouplxml/_bsoup.py b/imdb/parser/http/bsouplxml/_bsoup.py |
4838 |
-index afab5da..0aee945 100644 |
4839 |
---- a/imdb/parser/http/bsouplxml/_bsoup.py |
4840 |
-+++ b/imdb/parser/http/bsouplxml/_bsoup.py |
4841 |
-@@ -81,7 +81,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
4842 |
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE, DAMMIT. |
4843 |
- |
4844 |
- """ |
4845 |
--from __future__ import generators |
4846 |
-+ |
4847 |
- |
4848 |
- __author__ = "Leonard Richardson (leonardr@××××××××.org)" |
4849 |
- __version__ = "3.0.7a" |
4850 |
-@@ -90,12 +90,13 @@ __license__ = "New-style BSD" |
4851 |
- |
4852 |
- from sgmllib import SGMLParser, SGMLParseError |
4853 |
- import codecs |
4854 |
--import markupbase |
4855 |
-+import _markupbase |
4856 |
- import types |
4857 |
- import re |
4858 |
- import sgmllib |
4859 |
-+import collections |
4860 |
- try: |
4861 |
-- from htmlentitydefs import name2codepoint |
4862 |
-+ from html.entities import name2codepoint |
4863 |
- except ImportError: |
4864 |
- name2codepoint = {} |
4865 |
- try: |
4866 |
-@@ -105,7 +106,7 @@ except NameError: |
4867 |
- |
4868 |
- #These hacks make Beautiful Soup able to parse XML with namespaces |
4869 |
- sgmllib.tagfind = re.compile('[a-zA-Z][-_.:a-zA-Z0-9]*') |
4870 |
--markupbase._declname_match = re.compile(r'[a-zA-Z][-_.:a-zA-Z0-9]*\s*').match |
4871 |
-+_markupbase._declname_match = re.compile(r'[a-zA-Z][-_.:a-zA-Z0-9]*\s*').match |
4872 |
- |
4873 |
- DEFAULT_OUTPUT_ENCODING = "utf-8" |
4874 |
- |
4875 |
-@@ -153,7 +154,7 @@ class PageElement: |
4876 |
- #this element (and any children) hadn't been parsed. Connect |
4877 |
- #the two. |
4878 |
- lastChild = self._lastRecursiveChild() |
4879 |
-- nextElement = lastChild.next |
4880 |
-+ nextElement = lastChild.__next__ |
4881 |
- |
4882 |
- if self.previous: |
4883 |
- self.previous.next = nextElement |
4884 |
-@@ -178,8 +179,8 @@ class PageElement: |
4885 |
- return lastChild |
4886 |
- |
4887 |
- def insert(self, position, newChild): |
4888 |
-- if (isinstance(newChild, basestring) |
4889 |
-- or isinstance(newChild, unicode)) \ |
4890 |
-+ if (isinstance(newChild, str) |
4891 |
-+ or isinstance(newChild, str)) \ |
4892 |
- and not isinstance(newChild, NavigableString): |
4893 |
- newChild = NavigableString(newChild) |
4894 |
- |
4895 |
-@@ -233,7 +234,7 @@ class PageElement: |
4896 |
- newChild.nextSibling.previousSibling = newChild |
4897 |
- newChildsLastElement.next = nextChild |
4898 |
- |
4899 |
-- if newChildsLastElement.next: |
4900 |
-+ if newChildsLastElement.__next__: |
4901 |
- newChildsLastElement.next.previous = newChildsLastElement |
4902 |
- self.contents.insert(position, newChild) |
4903 |
- |
4904 |
-@@ -334,7 +335,7 @@ class PageElement: |
4905 |
- g = generator() |
4906 |
- while True: |
4907 |
- try: |
4908 |
-- i = g.next() |
4909 |
-+ i = next(g) |
4910 |
- except StopIteration: |
4911 |
- break |
4912 |
- if i: |
4913 |
-@@ -350,7 +351,7 @@ class PageElement: |
4914 |
- def nextGenerator(self): |
4915 |
- i = self |
4916 |
- while i: |
4917 |
-- i = i.next |
4918 |
-+ i = i.__next__ |
4919 |
- yield i |
4920 |
- |
4921 |
- def nextSiblingGenerator(self): |
4922 |
-@@ -385,22 +386,22 @@ class PageElement: |
4923 |
- def toEncoding(self, s, encoding=None): |
4924 |
- """Encodes an object to a string in some encoding, or to Unicode. |
4925 |
- .""" |
4926 |
-- if isinstance(s, unicode): |
4927 |
-+ if isinstance(s, str): |
4928 |
- if encoding: |
4929 |
- s = s.encode(encoding) |
4930 |
- elif isinstance(s, str): |
4931 |
- if encoding: |
4932 |
- s = s.encode(encoding) |
4933 |
- else: |
4934 |
-- s = unicode(s) |
4935 |
-+ s = str(s) |
4936 |
- else: |
4937 |
- if encoding: |
4938 |
- s = self.toEncoding(str(s), encoding) |
4939 |
- else: |
4940 |
-- s = unicode(s) |
4941 |
-+ s = str(s) |
4942 |
- return s |
4943 |
- |
4944 |
--class NavigableString(unicode, PageElement): |
4945 |
-+class NavigableString(str, PageElement): |
4946 |
- |
4947 |
- def __new__(cls, value): |
4948 |
- """Create a new NavigableString. |
4949 |
-@@ -410,9 +411,9 @@ class NavigableString(unicode, PageElement): |
4950 |
- passed in to the superclass's __new__ or the superclass won't know |
4951 |
- how to handle non-ASCII characters. |
4952 |
- """ |
4953 |
-- if isinstance(value, unicode): |
4954 |
-- return unicode.__new__(cls, value) |
4955 |
-- return unicode.__new__(cls, value, DEFAULT_OUTPUT_ENCODING) |
4956 |
-+ if isinstance(value, str): |
4957 |
-+ return str.__new__(cls, value) |
4958 |
-+ return str.__new__(cls, value, DEFAULT_OUTPUT_ENCODING) |
4959 |
- |
4960 |
- def __getnewargs__(self): |
4961 |
- return (NavigableString.__str__(self),) |
4962 |
-@@ -424,7 +425,7 @@ class NavigableString(unicode, PageElement): |
4963 |
- if attr == 'string': |
4964 |
- return self |
4965 |
- else: |
4966 |
-- raise AttributeError, "'%s' object has no attribute '%s'" % (self.__class__.__name__, attr) |
4967 |
-+ raise AttributeError("'%s' object has no attribute '%s'" % (self.__class__.__name__, attr)) |
4968 |
- |
4969 |
- def __unicode__(self): |
4970 |
- return str(self).decode(DEFAULT_OUTPUT_ENCODING) |
4971 |
-@@ -462,7 +463,7 @@ class Tag(PageElement): |
4972 |
- def _invert(h): |
4973 |
- "Cheap function to invert a hash." |
4974 |
- i = {} |
4975 |
-- for k,v in h.items(): |
4976 |
-+ for k,v in list(h.items()): |
4977 |
- i[v] = k |
4978 |
- return i |
4979 |
- |
4980 |
-@@ -481,23 +482,23 @@ class Tag(PageElement): |
4981 |
- escaped.""" |
4982 |
- x = match.group(1) |
4983 |
- if self.convertHTMLEntities and x in name2codepoint: |
4984 |
-- return unichr(name2codepoint[x]) |
4985 |
-+ return chr(name2codepoint[x]) |
4986 |
- elif x in self.XML_ENTITIES_TO_SPECIAL_CHARS: |
4987 |
- if self.convertXMLEntities: |
4988 |
- return self.XML_ENTITIES_TO_SPECIAL_CHARS[x] |
4989 |
- else: |
4990 |
-- return u'&%s;' % x |
4991 |
-+ return '&%s;' % x |
4992 |
- elif len(x) > 0 and x[0] == '#': |
4993 |
- # Handle numeric entities |
4994 |
- if len(x) > 1 and x[1] == 'x': |
4995 |
-- return unichr(int(x[2:], 16)) |
4996 |
-+ return chr(int(x[2:], 16)) |
4997 |
- else: |
4998 |
-- return unichr(int(x[1:])) |
4999 |
-+ return chr(int(x[1:])) |
5000 |
- |
5001 |
- elif self.escapeUnrecognizedEntities: |
5002 |
-- return u'&%s;' % x |
5003 |
-+ return '&%s;' % x |
5004 |
- else: |
5005 |
-- return u'&%s;' % x |
5006 |
-+ return '&%s;' % x |
5007 |
- |
5008 |
- def __init__(self, parser, name, attrs=None, parent=None, |
5009 |
- previous=None): |
5010 |
-@@ -520,11 +521,11 @@ class Tag(PageElement): |
5011 |
- self.escapeUnrecognizedEntities = parser.escapeUnrecognizedEntities |
5012 |
- |
5013 |
- # Convert any HTML, XML, or numeric entities in the attribute values. |
5014 |
-- convert = lambda(k, val): (k, |
5015 |
-+ convert = lambda k_val: (k_val[0], |
5016 |
- re.sub("&(#\d+|#x[0-9a-fA-F]+|\w+);", |
5017 |
- self._convertEntities, |
5018 |
-- val)) |
5019 |
-- self.attrs = map(convert, self.attrs) |
5020 |
-+ k_val[1])) |
5021 |
-+ self.attrs = list(map(convert, self.attrs)) |
5022 |
- |
5023 |
- def get(self, key, default=None): |
5024 |
- """Returns the value of the 'key' attribute for the tag, or |
5025 |
-@@ -533,7 +534,7 @@ class Tag(PageElement): |
5026 |
- return self._getAttrMap().get(key, default) |
5027 |
- |
5028 |
- def has_key(self, key): |
5029 |
-- return self._getAttrMap().has_key(key) |
5030 |
-+ return key in self._getAttrMap() |
5031 |
- |
5032 |
- def __getitem__(self, key): |
5033 |
- """tag[key] returns the value of the 'key' attribute for the tag, |
5034 |
-@@ -551,7 +552,7 @@ class Tag(PageElement): |
5035 |
- def __contains__(self, x): |
5036 |
- return x in self.contents |
5037 |
- |
5038 |
-- def __nonzero__(self): |
5039 |
-+ def __bool__(self): |
5040 |
- "A tag is non-None even if it has no contents." |
5041 |
- return True |
5042 |
- |
5043 |
-@@ -577,14 +578,14 @@ class Tag(PageElement): |
5044 |
- #We don't break because bad HTML can define the same |
5045 |
- #attribute multiple times. |
5046 |
- self._getAttrMap() |
5047 |
-- if self.attrMap.has_key(key): |
5048 |
-+ if key in self.attrMap: |
5049 |
- del self.attrMap[key] |
5050 |
- |
5051 |
- def __call__(self, *args, **kwargs): |
5052 |
- """Calling a tag like a function is the same as calling its |
5053 |
- findAll() method. Eg. tag('a') returns a list of all the A tags |
5054 |
- found within this tag.""" |
5055 |
-- return apply(self.findAll, args, kwargs) |
5056 |
-+ return self.findAll(*args, **kwargs) |
5057 |
- |
5058 |
- def __getattr__(self, tag): |
5059 |
- #print "Getattr %s.%s" % (self.__class__, tag) |
5060 |
-@@ -592,7 +593,7 @@ class Tag(PageElement): |
5061 |
- return self.find(tag[:-3]) |
5062 |
- elif tag.find('__') != 0: |
5063 |
- return self.find(tag) |
5064 |
-- raise AttributeError, "'%s' object has no attribute '%s'" % (self.__class__, tag) |
5065 |
-+ raise AttributeError("'%s' object has no attribute '%s'" % (self.__class__, tag)) |
5066 |
- |
5067 |
- def __eq__(self, other): |
5068 |
- """Returns true iff this tag has the same name, the same attributes, |
5069 |
-@@ -850,7 +851,7 @@ class SoupStrainer: |
5070 |
- if isinstance(markupName, Tag): |
5071 |
- markup = markupName |
5072 |
- markupAttrs = markup |
5073 |
-- callFunctionWithTagData = callable(self.name) \ |
5074 |
-+ callFunctionWithTagData = isinstance(self.name, collections.Callable) \ |
5075 |
- and not isinstance(markupName, Tag) |
5076 |
- |
5077 |
- if (not self.name) \ |
5078 |
-@@ -862,7 +863,7 @@ class SoupStrainer: |
5079 |
- else: |
5080 |
- match = True |
5081 |
- markupAttrMap = None |
5082 |
-- for attr, matchAgainst in self.attrs.items(): |
5083 |
-+ for attr, matchAgainst in list(self.attrs.items()): |
5084 |
- if not markupAttrMap: |
5085 |
- if hasattr(markupAttrs, 'get'): |
5086 |
- markupAttrMap = markupAttrs |
5087 |
-@@ -903,16 +904,16 @@ class SoupStrainer: |
5088 |
- if self._matches(markup, self.text): |
5089 |
- found = markup |
5090 |
- else: |
5091 |
-- raise Exception, "I don't know how to match against a %s" \ |
5092 |
-- % markup.__class__ |
5093 |
-+ raise Exception("I don't know how to match against a %s" \ |
5094 |
-+ % markup.__class__) |
5095 |
- return found |
5096 |
- |
5097 |
- def _matches(self, markup, matchAgainst): |
5098 |
- #print "Matching %s against %s" % (markup, matchAgainst) |
5099 |
- result = False |
5100 |
-- if matchAgainst == True and type(matchAgainst) == types.BooleanType: |
5101 |
-+ if matchAgainst == True and type(matchAgainst) == bool: |
5102 |
- result = markup != None |
5103 |
-- elif callable(matchAgainst): |
5104 |
-+ elif isinstance(matchAgainst, collections.Callable): |
5105 |
- result = matchAgainst(markup) |
5106 |
- else: |
5107 |
- #Custom match methods take the tag as an argument, but all |
5108 |
-@@ -920,7 +921,7 @@ class SoupStrainer: |
5109 |
- if isinstance(markup, Tag): |
5110 |
- markup = markup.name |
5111 |
- if markup and not isString(markup): |
5112 |
-- markup = unicode(markup) |
5113 |
-+ markup = str(markup) |
5114 |
- #Now we know that chunk is either a string, or None. |
5115 |
- if hasattr(matchAgainst, 'match'): |
5116 |
- # It's a regexp object. |
5117 |
-@@ -928,10 +929,10 @@ class SoupStrainer: |
5118 |
- elif isList(matchAgainst): |
5119 |
- result = markup in matchAgainst |
5120 |
- elif hasattr(matchAgainst, 'items'): |
5121 |
-- result = markup.has_key(matchAgainst) |
5122 |
-+ result = matchAgainst in markup |
5123 |
- elif matchAgainst and isString(markup): |
5124 |
-- if isinstance(markup, unicode): |
5125 |
-- matchAgainst = unicode(matchAgainst) |
5126 |
-+ if isinstance(markup, str): |
5127 |
-+ matchAgainst = str(matchAgainst) |
5128 |
- else: |
5129 |
- matchAgainst = str(matchAgainst) |
5130 |
- |
5131 |
-@@ -952,13 +953,13 @@ def isList(l): |
5132 |
- """Convenience method that works with all 2.x versions of Python |
5133 |
- to determine whether or not something is listlike.""" |
5134 |
- return hasattr(l, '__iter__') \ |
5135 |
-- or (type(l) in (types.ListType, types.TupleType)) |
5136 |
-+ or (type(l) in (list, tuple)) |
5137 |
- |
5138 |
- def isString(s): |
5139 |
- """Convenience method that works with all 2.x versions of Python |
5140 |
- to determine whether or not something is stringlike.""" |
5141 |
- try: |
5142 |
-- return isinstance(s, unicode) or isinstance(s, basestring) |
5143 |
-+ return isinstance(s, str) or isinstance(s, str) |
5144 |
- except NameError: |
5145 |
- return isinstance(s, str) |
5146 |
- |
5147 |
-@@ -970,7 +971,7 @@ def buildTagMap(default, *args): |
5148 |
- for portion in args: |
5149 |
- if hasattr(portion, 'items'): |
5150 |
- #It's a map. Merge it. |
5151 |
-- for k,v in portion.items(): |
5152 |
-+ for k,v in list(portion.items()): |
5153 |
- built[k] = v |
5154 |
- elif isList(portion): |
5155 |
- #It's a list. Map each item to the default. |
5156 |
-@@ -1013,7 +1014,7 @@ class BeautifulStoneSoup(Tag, SGMLParser): |
5157 |
- lambda x: '<!' + x.group(1) + '>') |
5158 |
- ] |
5159 |
- |
5160 |
-- ROOT_TAG_NAME = u'[document]' |
5161 |
-+ ROOT_TAG_NAME = '[document]' |
5162 |
- |
5163 |
- HTML_ENTITIES = "html" |
5164 |
- XML_ENTITIES = "xml" |
5165 |
-@@ -1109,14 +1110,14 @@ class BeautifulStoneSoup(Tag, SGMLParser): |
5166 |
- def _feed(self, inDocumentEncoding=None, isHTML=False): |
5167 |
- # Convert the document to Unicode. |
5168 |
- markup = self.markup |
5169 |
-- if isinstance(markup, unicode): |
5170 |
-+ if isinstance(markup, str): |
5171 |
- if not hasattr(self, 'originalEncoding'): |
5172 |
- self.originalEncoding = None |
5173 |
- else: |
5174 |
- dammit = UnicodeDammit\ |
5175 |
- (markup, [self.fromEncoding, inDocumentEncoding], |
5176 |
- smartQuotesTo=self.smartQuotesTo, isHTML=isHTML) |
5177 |
-- markup = dammit.unicode |
5178 |
-+ markup = dammit.str |
5179 |
- self.originalEncoding = dammit.originalEncoding |
5180 |
- self.declaredHTMLEncoding = dammit.declaredHTMLEncoding |
5181 |
- if markup: |
5182 |
-@@ -1155,8 +1156,8 @@ class BeautifulStoneSoup(Tag, SGMLParser): |
5183 |
- def isSelfClosingTag(self, name): |
5184 |
- """Returns true iff the given string is the name of a |
5185 |
- self-closing tag according to this parser.""" |
5186 |
-- return self.SELF_CLOSING_TAGS.has_key(name) \ |
5187 |
-- or self.instanceSelfClosingTags.has_key(name) |
5188 |
-+ return name in self.SELF_CLOSING_TAGS \ |
5189 |
-+ or name in self.instanceSelfClosingTags |
5190 |
- |
5191 |
- def reset(self): |
5192 |
- Tag.__init__(self, self, self.ROOT_TAG_NAME) |
5193 |
-@@ -1191,7 +1192,7 @@ class BeautifulStoneSoup(Tag, SGMLParser): |
5194 |
- |
5195 |
- def endData(self, containerClass=NavigableString): |
5196 |
- if self.currentData: |
5197 |
-- currentData = u''.join(self.currentData) |
5198 |
-+ currentData = ''.join(self.currentData) |
5199 |
- if (currentData.translate(self.STRIP_ASCII_SPACES) == '' and |
5200 |
- not set([tag.name for tag in self.tagStack]).intersection( |
5201 |
- self.PRESERVE_WHITESPACE_TAGS)): |
5202 |
-@@ -1254,7 +1255,7 @@ class BeautifulStoneSoup(Tag, SGMLParser): |
5203 |
- |
5204 |
- nestingResetTriggers = self.NESTABLE_TAGS.get(name) |
5205 |
- isNestable = nestingResetTriggers != None |
5206 |
-- isResetNesting = self.RESET_NESTING_TAGS.has_key(name) |
5207 |
-+ isResetNesting = name in self.RESET_NESTING_TAGS |
5208 |
- popTo = None |
5209 |
- inclusive = True |
5210 |
- for i in range(len(self.tagStack)-1, 0, -1): |
5211 |
-@@ -1267,7 +1268,7 @@ class BeautifulStoneSoup(Tag, SGMLParser): |
5212 |
- if (nestingResetTriggers != None |
5213 |
- and p.name in nestingResetTriggers) \ |
5214 |
- or (nestingResetTriggers == None and isResetNesting |
5215 |
-- and self.RESET_NESTING_TAGS.has_key(p.name)): |
5216 |
-+ and p.name in self.RESET_NESTING_TAGS): |
5217 |
- |
5218 |
- #If we encounter one of the nesting reset triggers |
5219 |
- #peculiar to this tag, or we encounter another tag |
5220 |
-@@ -1285,7 +1286,7 @@ class BeautifulStoneSoup(Tag, SGMLParser): |
5221 |
- if self.quoteStack: |
5222 |
- #This is not a real tag. |
5223 |
- #print "<%s> is not real!" % name |
5224 |
-- attrs = ''.join(map(lambda(x, y): ' %s="%s"' % (x, y), attrs)) |
5225 |
-+ attrs = ''.join([' %s="%s"' % (x_y[0], x_y[1]) for x_y in attrs]) |
5226 |
- self.handle_data('<%s%s>' % (name, attrs)) |
5227 |
- return |
5228 |
- self.endData() |
5229 |
-@@ -1338,7 +1339,7 @@ class BeautifulStoneSoup(Tag, SGMLParser): |
5230 |
- object, possibly one with a %SOUP-ENCODING% slot into which an |
5231 |
- encoding will be plugged later.""" |
5232 |
- if text[:3] == "xml": |
5233 |
-- text = u"xml version='1.0' encoding='%SOUP-ENCODING%'" |
5234 |
-+ text = "xml version='1.0' encoding='%SOUP-ENCODING%'" |
5235 |
- self._toStringSubclass(text, ProcessingInstruction) |
5236 |
- |
5237 |
- def handle_comment(self, text): |
5238 |
-@@ -1348,7 +1349,7 @@ class BeautifulStoneSoup(Tag, SGMLParser): |
5239 |
- def handle_charref(self, ref): |
5240 |
- "Handle character references as data." |
5241 |
- if self.convertEntities: |
5242 |
-- data = unichr(int(ref)) |
5243 |
-+ data = chr(int(ref)) |
5244 |
- else: |
5245 |
- data = '&#%s;' % ref |
5246 |
- self.handle_data(data) |
5247 |
-@@ -1360,7 +1361,7 @@ class BeautifulStoneSoup(Tag, SGMLParser): |
5248 |
- data = None |
5249 |
- if self.convertHTMLEntities: |
5250 |
- try: |
5251 |
-- data = unichr(name2codepoint[ref]) |
5252 |
-+ data = chr(name2codepoint[ref]) |
5253 |
- except KeyError: |
5254 |
- pass |
5255 |
- |
5256 |
-@@ -1469,7 +1470,7 @@ class BeautifulSoup(BeautifulStoneSoup): |
5257 |
- BeautifulStoneSoup before writing your own subclass.""" |
5258 |
- |
5259 |
- def __init__(self, *args, **kwargs): |
5260 |
-- if not kwargs.has_key('smartQuotesTo'): |
5261 |
-+ if 'smartQuotesTo' not in kwargs: |
5262 |
- kwargs['smartQuotesTo'] = self.HTML_ENTITIES |
5263 |
- kwargs['isHTML'] = True |
5264 |
- BeautifulStoneSoup.__init__(self, *args, **kwargs) |
5265 |
-@@ -1652,7 +1653,7 @@ class BeautifulSOAP(BeautifulStoneSoup): |
5266 |
- parent._getAttrMap() |
5267 |
- if (isinstance(tag, Tag) and len(tag.contents) == 1 and |
5268 |
- isinstance(tag.contents[0], NavigableString) and |
5269 |
-- not parent.attrMap.has_key(tag.name)): |
5270 |
-+ tag.name not in parent.attrMap): |
5271 |
- parent[tag.name] = tag.contents[0] |
5272 |
- BeautifulStoneSoup.popTag(self) |
5273 |
- |
5274 |
-@@ -1726,9 +1727,9 @@ class UnicodeDammit: |
5275 |
- self._detectEncoding(markup, isHTML) |
5276 |
- self.smartQuotesTo = smartQuotesTo |
5277 |
- self.triedEncodings = [] |
5278 |
-- if markup == '' or isinstance(markup, unicode): |
5279 |
-+ if markup == '' or isinstance(markup, str): |
5280 |
- self.originalEncoding = None |
5281 |
-- self.unicode = unicode(markup) |
5282 |
-+ self.str = str(markup) |
5283 |
- return |
5284 |
- |
5285 |
- u = None |
5286 |
-@@ -1741,7 +1742,7 @@ class UnicodeDammit: |
5287 |
- if u: break |
5288 |
- |
5289 |
- # If no luck and we have auto-detection library, try that: |
5290 |
-- if not u and chardet and not isinstance(self.markup, unicode): |
5291 |
-+ if not u and chardet and not isinstance(self.markup, str): |
5292 |
- u = self._convertFrom(chardet.detect(self.markup)['encoding']) |
5293 |
- |
5294 |
- # As a last resort, try utf-8 and windows-1252: |
5295 |
-@@ -1750,14 +1751,14 @@ class UnicodeDammit: |
5296 |
- u = self._convertFrom(proposed_encoding) |
5297 |
- if u: break |
5298 |
- |
5299 |
-- self.unicode = u |
5300 |
-+ self.str = u |
5301 |
- if not u: self.originalEncoding = None |
5302 |
- |
5303 |
- def _subMSChar(self, orig): |
5304 |
- """Changes a MS smart quote character to an XML or HTML |
5305 |
- entity.""" |
5306 |
- sub = self.MS_CHARS.get(orig) |
5307 |
-- if type(sub) == types.TupleType: |
5308 |
-+ if type(sub) == tuple: |
5309 |
- if self.smartQuotesTo == 'xml': |
5310 |
- sub = '&#x%s;' % sub[1] |
5311 |
- else: |
5312 |
-@@ -1777,7 +1778,7 @@ class UnicodeDammit: |
5313 |
- "iso-8859-1", |
5314 |
- "iso-8859-2"): |
5315 |
- markup = re.compile("([\x80-\x9f])").sub \ |
5316 |
-- (lambda(x): self._subMSChar(x.group(1)), |
5317 |
-+ (lambda x: self._subMSChar(x.group(1)), |
5318 |
- markup) |
5319 |
- |
5320 |
- try: |
5321 |
-@@ -1785,7 +1786,7 @@ class UnicodeDammit: |
5322 |
- u = self._toUnicode(markup, proposed) |
5323 |
- self.markup = u |
5324 |
- self.originalEncoding = proposed |
5325 |
-- except Exception, e: |
5326 |
-+ except Exception as e: |
5327 |
- # print "That didn't work!" |
5328 |
- # print e |
5329 |
- return None |
5330 |
-@@ -1814,7 +1815,7 @@ class UnicodeDammit: |
5331 |
- elif data[:4] == '\xff\xfe\x00\x00': |
5332 |
- encoding = 'utf-32le' |
5333 |
- data = data[4:] |
5334 |
-- newdata = unicode(data, encoding) |
5335 |
-+ newdata = str(data, encoding) |
5336 |
- return newdata |
5337 |
- |
5338 |
- def _detectEncoding(self, xml_data, isHTML=False): |
5339 |
-@@ -1827,41 +1828,41 @@ class UnicodeDammit: |
5340 |
- elif xml_data[:4] == '\x00\x3c\x00\x3f': |
5341 |
- # UTF-16BE |
5342 |
- sniffed_xml_encoding = 'utf-16be' |
5343 |
-- xml_data = unicode(xml_data, 'utf-16be').encode('utf-8') |
5344 |
-+ xml_data = str(xml_data, 'utf-16be').encode('utf-8') |
5345 |
- elif (len(xml_data) >= 4) and (xml_data[:2] == '\xfe\xff') \ |
5346 |
- and (xml_data[2:4] != '\x00\x00'): |
5347 |
- # UTF-16BE with BOM |
5348 |
- sniffed_xml_encoding = 'utf-16be' |
5349 |
-- xml_data = unicode(xml_data[2:], 'utf-16be').encode('utf-8') |
5350 |
-+ xml_data = str(xml_data[2:], 'utf-16be').encode('utf-8') |
5351 |
- elif xml_data[:4] == '\x3c\x00\x3f\x00': |
5352 |
- # UTF-16LE |
5353 |
- sniffed_xml_encoding = 'utf-16le' |
5354 |
-- xml_data = unicode(xml_data, 'utf-16le').encode('utf-8') |
5355 |
-+ xml_data = str(xml_data, 'utf-16le').encode('utf-8') |
5356 |
- elif (len(xml_data) >= 4) and (xml_data[:2] == '\xff\xfe') and \ |
5357 |
- (xml_data[2:4] != '\x00\x00'): |
5358 |
- # UTF-16LE with BOM |
5359 |
- sniffed_xml_encoding = 'utf-16le' |
5360 |
-- xml_data = unicode(xml_data[2:], 'utf-16le').encode('utf-8') |
5361 |
-+ xml_data = str(xml_data[2:], 'utf-16le').encode('utf-8') |
5362 |
- elif xml_data[:4] == '\x00\x00\x00\x3c': |
5363 |
- # UTF-32BE |
5364 |
- sniffed_xml_encoding = 'utf-32be' |
5365 |
-- xml_data = unicode(xml_data, 'utf-32be').encode('utf-8') |
5366 |
-+ xml_data = str(xml_data, 'utf-32be').encode('utf-8') |
5367 |
- elif xml_data[:4] == '\x3c\x00\x00\x00': |
5368 |
- # UTF-32LE |
5369 |
- sniffed_xml_encoding = 'utf-32le' |
5370 |
-- xml_data = unicode(xml_data, 'utf-32le').encode('utf-8') |
5371 |
-+ xml_data = str(xml_data, 'utf-32le').encode('utf-8') |
5372 |
- elif xml_data[:4] == '\x00\x00\xfe\xff': |
5373 |
- # UTF-32BE with BOM |
5374 |
- sniffed_xml_encoding = 'utf-32be' |
5375 |
-- xml_data = unicode(xml_data[4:], 'utf-32be').encode('utf-8') |
5376 |
-+ xml_data = str(xml_data[4:], 'utf-32be').encode('utf-8') |
5377 |
- elif xml_data[:4] == '\xff\xfe\x00\x00': |
5378 |
- # UTF-32LE with BOM |
5379 |
- sniffed_xml_encoding = 'utf-32le' |
5380 |
-- xml_data = unicode(xml_data[4:], 'utf-32le').encode('utf-8') |
5381 |
-+ xml_data = str(xml_data[4:], 'utf-32le').encode('utf-8') |
5382 |
- elif xml_data[:3] == '\xef\xbb\xbf': |
5383 |
- # UTF-8 with BOM |
5384 |
- sniffed_xml_encoding = 'utf-8' |
5385 |
-- xml_data = unicode(xml_data[3:], 'utf-8').encode('utf-8') |
5386 |
-+ xml_data = str(xml_data[3:], 'utf-8').encode('utf-8') |
5387 |
- else: |
5388 |
- sniffed_xml_encoding = 'ascii' |
5389 |
- pass |
5390 |
-@@ -1924,7 +1925,7 @@ class UnicodeDammit: |
5391 |
- 250,251,252,253,254,255) |
5392 |
- import string |
5393 |
- c.EBCDIC_TO_ASCII_MAP = string.maketrans( \ |
5394 |
-- ''.join(map(chr, range(256))), ''.join(map(chr, emap))) |
5395 |
-+ ''.join(map(chr, list(range(256)))), ''.join(map(chr, emap))) |
5396 |
- return s.translate(c.EBCDIC_TO_ASCII_MAP) |
5397 |
- |
5398 |
- MS_CHARS = { '\x80' : ('euro', '20AC'), |
5399 |
-@@ -1967,4 +1968,4 @@ class UnicodeDammit: |
5400 |
- if __name__ == '__main__': |
5401 |
- import sys |
5402 |
- soup = BeautifulSoup(sys.stdin) |
5403 |
-- print soup.prettify() |
5404 |
-+ print(soup.prettify()) |
5405 |
-diff --git a/imdb/parser/http/bsouplxml/bsoupxpath.py b/imdb/parser/http/bsouplxml/bsoupxpath.py |
5406 |
-index c5c489d..45d1254 100644 |
5407 |
---- a/imdb/parser/http/bsouplxml/bsoupxpath.py |
5408 |
-+++ b/imdb/parser/http/bsouplxml/bsoupxpath.py |
5409 |
-@@ -26,7 +26,7 @@ __docformat__ = 'restructuredtext' |
5410 |
- |
5411 |
- import re |
5412 |
- import string |
5413 |
--import _bsoup as BeautifulSoup |
5414 |
-+from . import _bsoup as BeautifulSoup |
5415 |
- |
5416 |
- |
5417 |
- # XPath related enumerations and constants |
5418 |
-@@ -226,7 +226,7 @@ class PathStep: |
5419 |
- attribute_value = True |
5420 |
- else: |
5421 |
- attribute_value = None |
5422 |
-- if not self.soup_args.has_key('attrs'): |
5423 |
-+ if 'attrs' not in self.soup_args: |
5424 |
- self.soup_args['attrs'] = {} |
5425 |
- self.soup_args['attrs'][attribute_name] = attribute_value |
5426 |
- return None |
5427 |
-@@ -284,7 +284,7 @@ class PathStep: |
5428 |
- |
5429 |
- if found: |
5430 |
- for checker in self.checkers: |
5431 |
-- found = filter(checker, found) |
5432 |
-+ found = list(filter(checker, found)) |
5433 |
- result.extend(found) |
5434 |
- |
5435 |
- return result |
5436 |
-@@ -311,14 +311,14 @@ class PredicateFilter: |
5437 |
- self.__filter = self.__starts_with |
5438 |
- else: |
5439 |
- self.__filter = self.__contains |
5440 |
-- args = map(string.strip, arguments.split(',')) |
5441 |
-+ args = list(map(string.strip, arguments.split(','))) |
5442 |
- if args[0][0] == '@': |
5443 |
- self.arguments = (True, args[0][1:], args[1][1:-1]) |
5444 |
- else: |
5445 |
- self.arguments = (False, args[0], args[1][1:-1]) |
5446 |
- elif name == 'string-length': |
5447 |
- self.__filter = self.__string_length |
5448 |
-- args = map(string.strip, arguments.split(',')) |
5449 |
-+ args = list(map(string.strip, arguments.split(','))) |
5450 |
- if args[0][0] == '@': |
5451 |
- self.arguments = (True, args[0][1:]) |
5452 |
- else: |
5453 |
-@@ -356,7 +356,7 @@ class PredicateFilter: |
5454 |
- if self.arguments[0]: |
5455 |
- # this is an attribute |
5456 |
- attribute_name = self.arguments[1] |
5457 |
-- if node.has_key(attribute_name): |
5458 |
-+ if attribute_name in node: |
5459 |
- first = node[attribute_name] |
5460 |
- return first.startswith(self.arguments[2]) |
5461 |
- elif self.arguments[1] == 'text()': |
5462 |
-@@ -369,7 +369,7 @@ class PredicateFilter: |
5463 |
- if self.arguments[0]: |
5464 |
- # this is an attribute |
5465 |
- attribute_name = self.arguments[1] |
5466 |
-- if node.has_key(attribute_name): |
5467 |
-+ if attribute_name in node: |
5468 |
- first = node[attribute_name] |
5469 |
- return self.arguments[2] in first |
5470 |
- elif self.arguments[1] == 'text()': |
5471 |
-@@ -382,7 +382,7 @@ class PredicateFilter: |
5472 |
- if self.arguments[0]: |
5473 |
- # this is an attribute |
5474 |
- attribute_name = self.arguments[1] |
5475 |
-- if node.has_key(attribute_name): |
5476 |
-+ if attribute_name in node: |
5477 |
- value = node[attribute_name] |
5478 |
- else: |
5479 |
- value = None |
5480 |
-@@ -399,11 +399,11 @@ _steps = {} |
5481 |
- def get_path(path): |
5482 |
- """Utility for eliminating repeated parsings of the same paths and steps. |
5483 |
- """ |
5484 |
-- if not _paths.has_key(path): |
5485 |
-+ if path not in _paths: |
5486 |
- p = Path(path, parse=False) |
5487 |
- steps = tokenize_path(path) |
5488 |
- for step in steps: |
5489 |
-- if not _steps.has_key(step): |
5490 |
-+ if step not in _steps: |
5491 |
- _steps[step] = PathStep(step) |
5492 |
- p.steps.append(_steps[step]) |
5493 |
- _paths[path] = p |
5494 |
-diff --git a/imdb/parser/http/bsouplxml/etree.py b/imdb/parser/http/bsouplxml/etree.py |
5495 |
-index 28465f5..9e4a203 100644 |
5496 |
---- a/imdb/parser/http/bsouplxml/etree.py |
5497 |
-+++ b/imdb/parser/http/bsouplxml/etree.py |
5498 |
-@@ -21,10 +21,10 @@ along with this program; if not, write to the Free Software |
5499 |
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
5500 |
- """ |
5501 |
- |
5502 |
--import _bsoup as BeautifulSoup |
5503 |
--from _bsoup import Tag as Element |
5504 |
-+from . import _bsoup as BeautifulSoup |
5505 |
-+from ._bsoup import Tag as Element |
5506 |
- |
5507 |
--import bsoupxpath |
5508 |
-+from . import bsoupxpath |
5509 |
- |
5510 |
- # Not directly used by IMDbPY, but do not remove: it's used by IMDbPYKit, |
5511 |
- # for example. |
5512 |
-@@ -38,7 +38,7 @@ def fromstring(xml_string): |
5513 |
- |
5514 |
- def tostring(element, encoding=None, pretty_print=False): |
5515 |
- """Return a string or unicode representation of an element.""" |
5516 |
-- if encoding is unicode: |
5517 |
-+ if encoding is str: |
5518 |
- encoding = None |
5519 |
- # For BeautifulSoup 3.1 |
5520 |
- #encArgs = {'prettyPrint': pretty_print} |
5521 |
-diff --git a/imdb/parser/http/bsouplxml/html.py b/imdb/parser/http/bsouplxml/html.py |
5522 |
-index bbf13bd..eb0c928 100644 |
5523 |
---- a/imdb/parser/http/bsouplxml/html.py |
5524 |
-+++ b/imdb/parser/http/bsouplxml/html.py |
5525 |
-@@ -21,7 +21,7 @@ along with this program; if not, write to the Free Software |
5526 |
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
5527 |
- """ |
5528 |
- |
5529 |
--import _bsoup as BeautifulSoup |
5530 |
-+from . import _bsoup as BeautifulSoup |
5531 |
- |
5532 |
- |
5533 |
- def fromstring(html_string): |
5534 |
-diff --git a/imdb/parser/http/characterParser.py b/imdb/parser/http/characterParser.py |
5535 |
-index ff5ea09..7fa17d5 100644 |
5536 |
---- a/imdb/parser/http/characterParser.py |
5537 |
-+++ b/imdb/parser/http/characterParser.py |
5538 |
-@@ -27,9 +27,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
5539 |
- """ |
5540 |
- |
5541 |
- import re |
5542 |
--from utils import Attribute, Extractor, DOMParserBase, build_movie, \ |
5543 |
-+from .utils import Attribute, Extractor, DOMParserBase, build_movie, \ |
5544 |
- analyze_imdbid |
5545 |
--from personParser import DOMHTMLMaindetailsParser |
5546 |
-+from .personParser import DOMHTMLMaindetailsParser |
5547 |
- |
5548 |
- from imdb.Movie import Movie |
5549 |
- |
5550 |
-@@ -55,9 +55,9 @@ class DOMHTMLCharacterMaindetailsParser(DOMHTMLMaindetailsParser): |
5551 |
- 'roleID': "./a/@href" |
5552 |
- }, |
5553 |
- postprocess=lambda x: |
5554 |
-- build_movie(x.get('title') or u'', |
5555 |
-- movieID=analyze_imdbid(x.get('link') or u''), |
5556 |
-- roleID=_personIDs.findall(x.get('roleID') or u''), |
5557 |
-+ build_movie(x.get('title') or '', |
5558 |
-+ movieID=analyze_imdbid(x.get('link') or ''), |
5559 |
-+ roleID=_personIDs.findall(x.get('roleID') or ''), |
5560 |
- status=x.get('status') or None, |
5561 |
- _parsingCharacter=True))] |
5562 |
- |
5563 |
-@@ -125,7 +125,7 @@ class DOMHTMLCharacterBioParser(DOMParserBase): |
5564 |
- 'info': "./preceding-sibling::h4[1]//text()", |
5565 |
- 'text': ".//text()" |
5566 |
- }, |
5567 |
-- postprocess=lambda x: u'%s: %s' % ( |
5568 |
-+ postprocess=lambda x: '%s: %s' % ( |
5569 |
- x.get('info').strip(), |
5570 |
- x.get('text').replace('\n', |
5571 |
- ' ').replace('||', '\n\n').strip()))), |
5572 |
-@@ -190,7 +190,7 @@ class DOMHTMLCharacterQuotesParser(DOMParserBase): |
5573 |
- return {'quotes': newData} |
5574 |
- |
5575 |
- |
5576 |
--from personParser import DOMHTMLSeriesParser |
5577 |
-+from .personParser import DOMHTMLSeriesParser |
5578 |
- |
5579 |
- _OBJECTS = { |
5580 |
- 'character_main_parser': ((DOMHTMLCharacterMaindetailsParser,), |
5581 |
-diff --git a/imdb/parser/http/companyParser.py b/imdb/parser/http/companyParser.py |
5582 |
-index 8433791..b0a65ab 100644 |
5583 |
---- a/imdb/parser/http/companyParser.py |
5584 |
-+++ b/imdb/parser/http/companyParser.py |
5585 |
-@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
5586 |
- """ |
5587 |
- |
5588 |
- import re |
5589 |
--from utils import build_movie, Attribute, Extractor, DOMParserBase, \ |
5590 |
-+from .utils import build_movie, Attribute, Extractor, DOMParserBase, \ |
5591 |
- analyze_imdbid |
5592 |
- |
5593 |
- from imdb.utils import analyze_company_name |
5594 |
-@@ -64,9 +64,9 @@ class DOMCompanyParser(DOMParserBase): |
5595 |
- 'year': "./text()[1]" |
5596 |
- }, |
5597 |
- postprocess=lambda x: |
5598 |
-- build_movie(u'%s %s' % \ |
5599 |
-+ build_movie('%s %s' % \ |
5600 |
- (x.get('title'), x.get('year').strip()), |
5601 |
-- movieID=analyze_imdbid(x.get('link') or u''), |
5602 |
-+ movieID=analyze_imdbid(x.get('link') or ''), |
5603 |
- _parsingCompany=True))), |
5604 |
- ] |
5605 |
- |
5606 |
-@@ -75,7 +75,7 @@ class DOMCompanyParser(DOMParserBase): |
5607 |
- ] |
5608 |
- |
5609 |
- def postprocess_data(self, data): |
5610 |
-- for key in data.keys(): |
5611 |
-+ for key in list(data.keys()): |
5612 |
- new_key = key.replace('company', 'companies') |
5613 |
- new_key = new_key.replace('other', 'miscellaneous') |
5614 |
- new_key = new_key.replace('distributor', 'distributors') |
5615 |
-diff --git a/imdb/parser/http/movieParser.py b/imdb/parser/http/movieParser.py |
5616 |
-index d05b9e0..fe64371 100644 |
5617 |
---- a/imdb/parser/http/movieParser.py |
5618 |
-+++ b/imdb/parser/http/movieParser.py |
5619 |
-@@ -28,14 +28,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
5620 |
- """ |
5621 |
- |
5622 |
- import re |
5623 |
--import urllib |
5624 |
-+import urllib.request, urllib.parse, urllib.error |
5625 |
- |
5626 |
- from imdb import imdbURL_base |
5627 |
- from imdb.Person import Person |
5628 |
- from imdb.Movie import Movie |
5629 |
- from imdb.Company import Company |
5630 |
- from imdb.utils import analyze_title, split_company_name_notes, _Container |
5631 |
--from utils import build_person, DOMParserBase, Attribute, Extractor, \ |
5632 |
-+from .utils import build_person, DOMParserBase, Attribute, Extractor, \ |
5633 |
- analyze_imdbid |
5634 |
- |
5635 |
- |
5636 |
-@@ -105,12 +105,12 @@ def _manageRoles(mo): |
5637 |
- continue |
5638 |
- roleID = analyze_imdbid(role) |
5639 |
- if roleID is None: |
5640 |
-- roleID = u'/' |
5641 |
-+ roleID = '/' |
5642 |
- else: |
5643 |
-- roleID += u'/' |
5644 |
-- newRoles.append(u'<div class="_imdbpyrole" roleid="%s">%s</div>' % \ |
5645 |
-+ roleID += '/' |
5646 |
-+ newRoles.append('<div class="_imdbpyrole" roleid="%s">%s</div>' % \ |
5647 |
- (roleID, role.strip())) |
5648 |
-- return firstHalf + u' / '.join(newRoles) + mo.group(3) |
5649 |
-+ return firstHalf + ' / '.join(newRoles) + mo.group(3) |
5650 |
- |
5651 |
- |
5652 |
- _reRolesMovie = re.compile(r'(<td class="char">)(.*?)(</td>)', |
5653 |
-@@ -133,7 +133,7 @@ def makeSplitter(lstrip=None, sep='|', comments=True, |
5654 |
- if lstrip is not None: |
5655 |
- x = x.lstrip(lstrip).lstrip() |
5656 |
- lx = x.split(sep) |
5657 |
-- lx[:] = filter(None, [j.strip() for j in lx]) |
5658 |
-+ lx[:] = [_f for _f in [j.strip() for j in lx] if _f] |
5659 |
- if comments: |
5660 |
- lx[:] = [j.replace(origNotesSep, newNotesSep, 1) for j in lx] |
5661 |
- if strip: |
5662 |
-@@ -182,7 +182,7 @@ class DOMHTMLMovieParser(DOMParserBase): |
5663 |
- path={'person': ".//text()", |
5664 |
- 'link': "./td[1]/a[@href]/@href"}, |
5665 |
- postprocess=lambda x: \ |
5666 |
-- build_person(x.get('person') or u'', |
5667 |
-+ build_person(x.get('person') or '', |
5668 |
- personID=analyze_imdbid(x.get('link'))) |
5669 |
- )), |
5670 |
- |
5671 |
-@@ -195,9 +195,9 @@ class DOMHTMLMovieParser(DOMParserBase): |
5672 |
- 'roleID': \ |
5673 |
- "td[4]/div[@class='_imdbpyrole']/@roleid"}, |
5674 |
- postprocess=lambda x: \ |
5675 |
-- build_person(x.get('person') or u'', |
5676 |
-+ build_person(x.get('person') or '', |
5677 |
- personID=analyze_imdbid(x.get('link')), |
5678 |
-- roleID=(x.get('roleID') or u'').split('/')) |
5679 |
-+ roleID=(x.get('roleID') or '').split('/')) |
5680 |
- )), |
5681 |
- |
5682 |
- Extractor(label='genres', |
5683 |
-@@ -290,7 +290,7 @@ class DOMHTMLMovieParser(DOMParserBase): |
5684 |
- path={'name': "./text()", |
5685 |
- 'link': "./@href"}, |
5686 |
- postprocess=lambda x: \ |
5687 |
-- build_person(x.get('name') or u'', |
5688 |
-+ build_person(x.get('name') or '', |
5689 |
- personID=analyze_imdbid(x.get('link'))) |
5690 |
- )), |
5691 |
- |
5692 |
-@@ -300,7 +300,7 @@ class DOMHTMLMovieParser(DOMParserBase): |
5693 |
- path={'name': "./text()", |
5694 |
- 'link': "./@href"}, |
5695 |
- postprocess=lambda x: \ |
5696 |
-- build_person(x.get('name') or u'', |
5697 |
-+ build_person(x.get('name') or '', |
5698 |
- personID=analyze_imdbid(x.get('link'))) |
5699 |
- )), |
5700 |
- |
5701 |
-@@ -310,7 +310,7 @@ class DOMHTMLMovieParser(DOMParserBase): |
5702 |
- path={'name': "./text()", |
5703 |
- 'link': "@href"}, |
5704 |
- postprocess=lambda x: \ |
5705 |
-- build_person(x.get('name') or u'', |
5706 |
-+ build_person(x.get('name') or '', |
5707 |
- personID=analyze_imdbid(x.get('link'))) |
5708 |
- )), |
5709 |
- |
5710 |
-@@ -377,9 +377,9 @@ class DOMHTMLMovieParser(DOMParserBase): |
5711 |
- 'comp-link': "./a/@href", |
5712 |
- 'notes': "./text()"}, |
5713 |
- postprocess=lambda x: \ |
5714 |
-- Company(name=x.get('name') or u'', |
5715 |
-+ Company(name=x.get('name') or '', |
5716 |
- companyID=analyze_imdbid(x.get('comp-link')), |
5717 |
-- notes=(x.get('notes') or u'').strip()) |
5718 |
-+ notes=(x.get('notes') or '').strip()) |
5719 |
- )), |
5720 |
- |
5721 |
- Extractor(label='rating', |
5722 |
-@@ -431,7 +431,7 @@ class DOMHTMLMovieParser(DOMParserBase): |
5723 |
- re_airdate = re.compile(r'(.*)\s*\(season (\d+), episode (\d+)\)', re.I) |
5724 |
- def postprocess_data(self, data): |
5725 |
- # Convert section names. |
5726 |
-- for sect in data.keys(): |
5727 |
-+ for sect in list(data.keys()): |
5728 |
- if sect in _SECT_CONV: |
5729 |
- data[_SECT_CONV[sect]] = data[sect] |
5730 |
- del data[sect] |
5731 |
-@@ -441,7 +441,7 @@ class DOMHTMLMovieParser(DOMParserBase): |
5732 |
- value = data[key] |
5733 |
- if isinstance(value, list) and value: |
5734 |
- if isinstance(value[0], Person): |
5735 |
-- data[key] = filter(lambda x: x.personID is not None, value) |
5736 |
-+ data[key] = [x for x in value if x.personID is not None] |
5737 |
- if isinstance(value[0], _Container): |
5738 |
- for obj in data[key]: |
5739 |
- obj.accessSystem = self._as |
5740 |
-@@ -463,7 +463,7 @@ class DOMHTMLMovieParser(DOMParserBase): |
5741 |
- if nakas: |
5742 |
- data['akas'] = nakas |
5743 |
- if 'runtimes' in data: |
5744 |
-- data['runtimes'] = [x.replace(' min', u'') |
5745 |
-+ data['runtimes'] = [x.replace(' min', '') |
5746 |
- for x in data['runtimes']] |
5747 |
- if 'original air date' in data: |
5748 |
- oid = self.re_space.sub(' ', data['original air date']).strip() |
5749 |
-@@ -534,9 +534,9 @@ def _process_plotsummary(x): |
5750 |
- if xauthor: |
5751 |
- xauthor = xauthor.replace('{', '<').replace('}', '>').replace('(', |
5752 |
- '<').replace(')', '>').strip() |
5753 |
-- xplot = x.get('plot', u'').strip() |
5754 |
-+ xplot = x.get('plot', '').strip() |
5755 |
- if xauthor: |
5756 |
-- xplot += u'::%s' % xauthor |
5757 |
-+ xplot += '::%s' % xauthor |
5758 |
- return xplot |
5759 |
- |
5760 |
- class DOMHTMLPlotParser(DOMParserBase): |
5761 |
-@@ -670,18 +670,18 @@ class DOMHTMLAwardsParser(DOMParserBase): |
5762 |
- if len(data) == 0: |
5763 |
- return {} |
5764 |
- nd = [] |
5765 |
-- for key in data.keys(): |
5766 |
-+ for key in list(data.keys()): |
5767 |
- dom = self.get_dom(key) |
5768 |
- assigner = self.xpath(dom, "//a/text()")[0] |
5769 |
- for entry in data[key]: |
5770 |
-- if not entry.has_key('name'): |
5771 |
-+ if 'name' not in entry: |
5772 |
- if not entry: |
5773 |
- continue |
5774 |
- # this is an award, not a recipient |
5775 |
- entry['assigner'] = assigner.strip() |
5776 |
- # find the recipients |
5777 |
- matches = [p for p in data[key] |
5778 |
-- if p.has_key('name') and (entry['anchor'] == |
5779 |
-+ if 'name' in p and (entry['anchor'] == |
5780 |
- p['anchor'])] |
5781 |
- if self.subject == 'title': |
5782 |
- recipients = [Person(name=recipient['name'], |
5783 |
-@@ -860,7 +860,7 @@ class DOMHTMLGoofsParser(DOMParserBase): |
5784 |
- |
5785 |
- extractors = [Extractor(label='goofs', path="//ul[@class='trivia']/li", |
5786 |
- attrs=Attribute(key='goofs', multi=True, path=".//text()", |
5787 |
-- postprocess=lambda x: (x or u'').strip()))] |
5788 |
-+ postprocess=lambda x: (x or '').strip()))] |
5789 |
- |
5790 |
- |
5791 |
- class DOMHTMLQuotesParser(DOMParserBase): |
5792 |
-@@ -947,7 +947,7 @@ class DOMHTMLReleaseinfoParser(DOMParserBase): |
5793 |
- date = date.strip() |
5794 |
- if not (country and date): continue |
5795 |
- notes = i['notes'] |
5796 |
-- info = u'%s::%s' % (country, date) |
5797 |
-+ info = '%s::%s' % (country, date) |
5798 |
- if notes: |
5799 |
- info += notes |
5800 |
- rl.append(info) |
5801 |
-@@ -1023,7 +1023,7 @@ class DOMHTMLRatingsParser(DOMParserBase): |
5802 |
- votes = data.get('votes', []) |
5803 |
- if votes: |
5804 |
- nd['number of votes'] = {} |
5805 |
-- for i in xrange(1, 11): |
5806 |
-+ for i in range(1, 11): |
5807 |
- _ordinal = int(votes[i]['ordinal']) |
5808 |
- _strvts = votes[i]['votes'] or '0' |
5809 |
- nd['number of votes'][_ordinal] = \ |
5810 |
-@@ -1046,7 +1046,7 @@ class DOMHTMLRatingsParser(DOMParserBase): |
5811 |
- dem_voters = data.get('demographic voters') |
5812 |
- if dem_voters: |
5813 |
- nd['demographic'] = {} |
5814 |
-- for i in xrange(1, len(dem_voters)): |
5815 |
-+ for i in range(1, len(dem_voters)): |
5816 |
- if (dem_voters[i]['votes'] is not None) \ |
5817 |
- and (dem_voters[i]['votes'].strip()): |
5818 |
- nd['demographic'][dem_voters[i]['voters'].strip().lower()] \ |
5819 |
-@@ -1111,10 +1111,10 @@ class DOMHTMLEpisodesRatings(DOMParserBase): |
5820 |
- except: |
5821 |
- pass |
5822 |
- ept = ept.strip() |
5823 |
-- ept = u'%s {%s' % (title, ept) |
5824 |
-+ ept = '%s {%s' % (title, ept) |
5825 |
- nr = i['nr'] |
5826 |
- if nr: |
5827 |
-- ept += u' (#%s)' % nr.strip() |
5828 |
-+ ept += ' (#%s)' % nr.strip() |
5829 |
- ept += '}' |
5830 |
- if movieID is not None: |
5831 |
- movieID = str(movieID) |
5832 |
-@@ -1160,7 +1160,7 @@ class DOMHTMLOfficialsitesParser(DOMParserBase): |
5833 |
- 'info': "./text()" |
5834 |
- }, |
5835 |
- postprocess=lambda x: (x.get('info').strip(), |
5836 |
-- urllib.unquote(_normalize_href(x.get('link')))))) |
5837 |
-+ urllib.parse.unquote(_normalize_href(x.get('link')))))) |
5838 |
- ] |
5839 |
- |
5840 |
- |
5841 |
-@@ -1195,13 +1195,13 @@ class DOMHTMLConnectionParser(DOMParserBase): |
5842 |
- ] |
5843 |
- |
5844 |
- def postprocess_data(self, data): |
5845 |
-- for key in data.keys(): |
5846 |
-+ for key in list(data.keys()): |
5847 |
- nl = [] |
5848 |
- for v in data[key]: |
5849 |
- title = v['title'] |
5850 |
- ts = title.split('::', 1) |
5851 |
- title = ts[0].strip() |
5852 |
-- notes = u'' |
5853 |
-+ notes = '' |
5854 |
- if len(ts) == 2: |
5855 |
- notes = ts[1].strip() |
5856 |
- m = Movie(title=title, |
5857 |
-@@ -1229,9 +1229,9 @@ class DOMHTMLLocationsParser(DOMParserBase): |
5858 |
- path={'place': ".//text()", |
5859 |
- 'note': "./following-sibling::dd[1]" \ |
5860 |
- "//text()"}, |
5861 |
-- postprocess=lambda x: (u'%s::%s' % ( |
5862 |
-+ postprocess=lambda x: ('%s::%s' % ( |
5863 |
- x['place'].strip(), |
5864 |
-- (x['note'] or u'').strip())).strip(':')))] |
5865 |
-+ (x['note'] or '').strip())).strip(':')))] |
5866 |
- |
5867 |
- |
5868 |
- class DOMHTMLTechParser(DOMParserBase): |
5869 |
-@@ -1272,7 +1272,7 @@ class DOMHTMLTechParser(DOMParserBase): |
5870 |
- |
5871 |
- def postprocess_data(self, data): |
5872 |
- for key in data: |
5873 |
-- data[key] = filter(None, data[key]) |
5874 |
-+ data[key] = [_f for _f in data[key] if _f] |
5875 |
- if self.kind in ('literature', 'business', 'contacts') and data: |
5876 |
- if 'screenplay/teleplay' in data: |
5877 |
- data['screenplay-teleplay'] = data['screenplay/teleplay'] |
5878 |
-@@ -1284,7 +1284,7 @@ class DOMHTMLTechParser(DOMParserBase): |
5879 |
- data['biography-print'] = data['biography (print)'] |
5880 |
- del data['biography (print)'] |
5881 |
- # Tech info. |
5882 |
-- for key in data.keys(): |
5883 |
-+ for key in list(data.keys()): |
5884 |
- if key.startswith('film negative format'): |
5885 |
- data['film negative format'] = data[key] |
5886 |
- del data[key] |
5887 |
-@@ -1313,7 +1313,7 @@ class DOMHTMLRecParser(DOMParserBase): |
5888 |
- path={'title': ".//text()", |
5889 |
- 'movieID': ".//a/@href"}))] |
5890 |
- def postprocess_data(self, data): |
5891 |
-- for key in data.keys(): |
5892 |
-+ for key in list(data.keys()): |
5893 |
- n_key = key |
5894 |
- n_keyl = n_key.lower() |
5895 |
- if n_keyl == 'suggested by the database': |
5896 |
-@@ -1361,7 +1361,7 @@ class DOMHTMLNewsParser(DOMParserBase): |
5897 |
- 'date': x.get('fromdate').split('|')[0].strip(), |
5898 |
- 'from': x.get('fromdate').split('|')[1].replace('From ', |
5899 |
- '').strip(), |
5900 |
-- 'body': (x.get('body') or u'').strip(), |
5901 |
-+ 'body': (x.get('body') or '').strip(), |
5902 |
- 'link': _normalize_href(x.get('link')), |
5903 |
- 'full article link': _normalize_href(x.get('fulllink')) |
5904 |
- })) |
5905 |
-@@ -1374,10 +1374,10 @@ class DOMHTMLNewsParser(DOMParserBase): |
5906 |
- ] |
5907 |
- |
5908 |
- def postprocess_data(self, data): |
5909 |
-- if not data.has_key('news'): |
5910 |
-+ if 'news' not in data: |
5911 |
- return {} |
5912 |
- for news in data['news']: |
5913 |
-- if news.has_key('full article link'): |
5914 |
-+ if 'full article link' in news: |
5915 |
- if news['full article link'] is None: |
5916 |
- del news['full article link'] |
5917 |
- return data |
5918 |
-@@ -1467,11 +1467,11 @@ class DOMHTMLSeasonEpisodesParser(DOMParserBase): |
5919 |
- series = Movie(title=series_title, movieID=str(series_id), |
5920 |
- accessSystem=self._as, modFunct=self._modFunct) |
5921 |
- if series.get('kind') == 'movie': |
5922 |
-- series['kind'] = u'tv series' |
5923 |
-+ series['kind'] = 'tv series' |
5924 |
- try: selected_season = int(selected_season) |
5925 |
- except: pass |
5926 |
- nd = {selected_season: {}} |
5927 |
-- for episode_nr, episode in data.iteritems(): |
5928 |
-+ for episode_nr, episode in data.items(): |
5929 |
- if not (episode and episode[0] and |
5930 |
- episode_nr.startswith('episode ')): |
5931 |
- continue |
5932 |
-@@ -1488,7 +1488,7 @@ class DOMHTMLSeasonEpisodesParser(DOMParserBase): |
5933 |
- continue |
5934 |
- ep_obj = Movie(movieID=episode_id, title=episode_title, |
5935 |
- accessSystem=self._as, modFunct=self._modFunct) |
5936 |
-- ep_obj['kind'] = u'episode' |
5937 |
-+ ep_obj['kind'] = 'episode' |
5938 |
- ep_obj['episode of'] = series |
5939 |
- ep_obj['season'] = selected_season |
5940 |
- ep_obj['episode'] = episode_nr |
5941 |
-@@ -1512,14 +1512,14 @@ def _build_episode(x): |
5942 |
- episode_id = analyze_imdbid(x.get('link')) |
5943 |
- episode_title = x.get('title') |
5944 |
- e = Movie(movieID=episode_id, title=episode_title) |
5945 |
-- e['kind'] = u'episode' |
5946 |
-+ e['kind'] = 'episode' |
5947 |
- oad = x.get('oad') |
5948 |
- if oad: |
5949 |
- e['original air date'] = oad.strip() |
5950 |
- year = x.get('year') |
5951 |
- if year is not None: |
5952 |
- year = year[5:] |
5953 |
-- if year == 'unknown': year = u'????' |
5954 |
-+ if year == 'unknown': year = '????' |
5955 |
- if year and year.isdigit(): |
5956 |
- year = int(year) |
5957 |
- e['year'] = year |
5958 |
-@@ -1597,9 +1597,9 @@ class DOMHTMLEpisodesParser(DOMParserBase): |
5959 |
- 'roleID': \ |
5960 |
- "../td[4]/div[@class='_imdbpyrole']/@roleid"}, |
5961 |
- postprocess=lambda x: \ |
5962 |
-- build_person(x.get('person') or u'', |
5963 |
-+ build_person(x.get('person') or '', |
5964 |
- personID=analyze_imdbid(x.get('link')), |
5965 |
-- roleID=(x.get('roleID') or u'').split('/'), |
5966 |
-+ roleID=(x.get('roleID') or '').split('/'), |
5967 |
- accessSystem=self._as, |
5968 |
- modFunct=self._modFunct))) |
5969 |
- ] |
5970 |
-@@ -1628,7 +1628,7 @@ class DOMHTMLEpisodesParser(DOMParserBase): |
5971 |
- series = Movie(title=stitle, movieID=str(seriesID), |
5972 |
- accessSystem=self._as, modFunct=self._modFunct) |
5973 |
- nd = {} |
5974 |
-- for key in data.keys(): |
5975 |
-+ for key in list(data.keys()): |
5976 |
- if key.startswith('filter-season-') or key.startswith('season-'): |
5977 |
- season_key = key.replace('filter-season-', '').replace('season-', '') |
5978 |
- try: season_key = int(season_key) |
5979 |
-@@ -1644,9 +1644,9 @@ class DOMHTMLEpisodesParser(DOMParserBase): |
5980 |
- ep_counter += 1 |
5981 |
- cast_key = 'Season %s, Episode %s:' % (season_key, |
5982 |
- episode_key) |
5983 |
-- if data.has_key(cast_key): |
5984 |
-+ if cast_key in data: |
5985 |
- cast = data[cast_key] |
5986 |
-- for i in xrange(len(cast)): |
5987 |
-+ for i in range(len(cast)): |
5988 |
- cast[i].billingPos = i + 1 |
5989 |
- episode['cast'] = cast |
5990 |
- episode['episode of'] = series |
5991 |
-@@ -1694,7 +1694,7 @@ class DOMHTMLFaqsParser(DOMParserBase): |
5992 |
- 'question': "./h3/a/span/text()", |
5993 |
- 'answer': "../following-sibling::div[1]//text()" |
5994 |
- }, |
5995 |
-- postprocess=lambda x: u'%s::%s' % (x.get('question').strip(), |
5996 |
-+ postprocess=lambda x: '%s::%s' % (x.get('question').strip(), |
5997 |
- '\n\n'.join(x.get('answer').replace( |
5998 |
- '\n\n', '\n').strip().split('||'))))) |
5999 |
- ] |
6000 |
-@@ -1724,7 +1724,7 @@ class DOMHTMLAiringParser(DOMParserBase): |
6001 |
- path="//title", |
6002 |
- attrs=Attribute(key='series title', path="./text()", |
6003 |
- postprocess=lambda x: \ |
6004 |
-- x.replace(' - TV schedule', u''))), |
6005 |
-+ x.replace(' - TV schedule', ''))), |
6006 |
- Extractor(label='series id', |
6007 |
- path="//h1/a[@href]", |
6008 |
- attrs=Attribute(key='series id', path="./@href")), |
6009 |
-@@ -1757,7 +1757,7 @@ class DOMHTMLAiringParser(DOMParserBase): |
6010 |
- return {} |
6011 |
- seriesTitle = data['series title'] |
6012 |
- seriesID = analyze_imdbid(data['series id']) |
6013 |
-- if data.has_key('airing'): |
6014 |
-+ if 'airing' in data: |
6015 |
- for airing in data['airing']: |
6016 |
- title = airing.get('title', '').strip() |
6017 |
- if not title: |
6018 |
-@@ -1780,7 +1780,7 @@ class DOMHTMLAiringParser(DOMParserBase): |
6019 |
- if 'series id' in data: |
6020 |
- del data['series id'] |
6021 |
- if 'airing' in data: |
6022 |
-- data['airing'] = filter(None, data['airing']) |
6023 |
-+ data['airing'] = [_f for _f in data['airing'] if _f] |
6024 |
- if 'airing' not in data or not data['airing']: |
6025 |
- return {} |
6026 |
- return data |
6027 |
-diff --git a/imdb/parser/http/personParser.py b/imdb/parser/http/personParser.py |
6028 |
-index af96721..e93895a 100644 |
6029 |
---- a/imdb/parser/http/personParser.py |
6030 |
-+++ b/imdb/parser/http/personParser.py |
6031 |
-@@ -30,11 +30,11 @@ import re |
6032 |
- from imdb.Movie import Movie |
6033 |
- from imdb.utils import analyze_name, canonicalName, normalizeName, \ |
6034 |
- analyze_title, date_and_notes |
6035 |
--from utils import build_movie, DOMParserBase, Attribute, Extractor, \ |
6036 |
-+from .utils import build_movie, DOMParserBase, Attribute, Extractor, \ |
6037 |
- analyze_imdbid |
6038 |
- |
6039 |
- |
6040 |
--from movieParser import _manageRoles |
6041 |
-+from .movieParser import _manageRoles |
6042 |
- _reRoles = re.compile(r'(<li>.*? \.\.\.\. )(.*?)(</li>|<br>)', |
6043 |
- re.I | re.M | re.S) |
6044 |
- |
6045 |
-@@ -84,13 +84,13 @@ class DOMHTMLMaindetailsParser(DOMParserBase): |
6046 |
- 'roleID': "./a[starts-with(@href, '/character/')]/@href" |
6047 |
- }, |
6048 |
- postprocess=lambda x: |
6049 |
-- build_movie(x.get('title') or u'', |
6050 |
-+ build_movie(x.get('title') or '', |
6051 |
- year=x.get('year'), |
6052 |
-- movieID=analyze_imdbid(x.get('link') or u''), |
6053 |
-- rolesNoChar=(x.get('rolesNoChar') or u'').strip(), |
6054 |
-- chrRoles=(x.get('chrRoles') or u'').strip(), |
6055 |
-+ movieID=analyze_imdbid(x.get('link') or ''), |
6056 |
-+ rolesNoChar=(x.get('rolesNoChar') or '').strip(), |
6057 |
-+ chrRoles=(x.get('chrRoles') or '').strip(), |
6058 |
- additionalNotes=x.get('notes'), |
6059 |
-- roleID=(x.get('roleID') or u''), |
6060 |
-+ roleID=(x.get('roleID') or ''), |
6061 |
- status=x.get('status') or None))] |
6062 |
- |
6063 |
- extractors = [ |
6064 |
-@@ -137,9 +137,9 @@ class DOMHTMLMaindetailsParser(DOMParserBase): |
6065 |
- 'title': './a/text()' |
6066 |
- }, |
6067 |
- postprocess=lambda x: |
6068 |
-- build_movie(x.get('title') or u'', |
6069 |
-- movieID=analyze_imdbid(x.get('link') or u''), |
6070 |
-- roleID=(x.get('roleID') or u'').split('/'), |
6071 |
-+ build_movie(x.get('title') or '', |
6072 |
-+ movieID=analyze_imdbid(x.get('link') or ''), |
6073 |
-+ roleID=(x.get('roleID') or '').split('/'), |
6074 |
- status=x.get('status') or None))) |
6075 |
- ] |
6076 |
- |
6077 |
-@@ -154,19 +154,19 @@ class DOMHTMLMaindetailsParser(DOMParserBase): |
6078 |
- del data[what] |
6079 |
- # XXX: the code below is for backwards compatibility |
6080 |
- # probably could be removed |
6081 |
-- for key in data.keys(): |
6082 |
-+ for key in list(data.keys()): |
6083 |
- if key.startswith('actor '): |
6084 |
-- if not data.has_key('actor'): |
6085 |
-+ if 'actor' not in data: |
6086 |
- data['actor'] = [] |
6087 |
- data['actor'].extend(data[key]) |
6088 |
- del data[key] |
6089 |
- if key.startswith('actress '): |
6090 |
-- if not data.has_key('actress'): |
6091 |
-+ if 'actress' not in data: |
6092 |
- data['actress'] = [] |
6093 |
- data['actress'].extend(data[key]) |
6094 |
- del data[key] |
6095 |
- if key.startswith('self '): |
6096 |
-- if not data.has_key('self'): |
6097 |
-+ if 'self' not in data: |
6098 |
- data['self'] = [] |
6099 |
- data['self'].extend(data[key]) |
6100 |
- del data[key] |
6101 |
-@@ -213,7 +213,7 @@ class DOMHTMLBioParser(DOMParserBase): |
6102 |
- Attribute(key='death notes', |
6103 |
- path="./text()", |
6104 |
- # TODO: check if this slicing is always correct |
6105 |
-- postprocess=lambda x: u''.join(x).strip()[2:])] |
6106 |
-+ postprocess=lambda x: ''.join(x).strip()[2:])] |
6107 |
- extractors = [ |
6108 |
- Extractor(label='headshot', |
6109 |
- path="//a[@name='headshot']", |
6110 |
-@@ -253,7 +253,7 @@ class DOMHTMLBioParser(DOMParserBase): |
6111 |
- }, |
6112 |
- postprocess=lambda x: "%s::%s" % \ |
6113 |
- (x.get('bio').strip(), |
6114 |
-- (x.get('by') or u'').strip() or u'Anonymous'))), |
6115 |
-+ (x.get('by') or '').strip() or 'Anonymous'))), |
6116 |
- Extractor(label='spouse', |
6117 |
- path="//div[h5='Spouse']/table/tr", |
6118 |
- attrs=Attribute(key='spouse', |
6119 |
-@@ -264,7 +264,7 @@ class DOMHTMLBioParser(DOMParserBase): |
6120 |
- }, |
6121 |
- postprocess=lambda x: ("%s::%s" % \ |
6122 |
- (x.get('name').strip(), |
6123 |
-- (x.get('info') or u'').strip())).strip(':'))), |
6124 |
-+ (x.get('info') or '').strip())).strip(':'))), |
6125 |
- Extractor(label='trade mark', |
6126 |
- path="//div[h5='Trade Mark']/p", |
6127 |
- attrs=Attribute(key='trade mark', |
6128 |
-@@ -351,7 +351,7 @@ class DOMHTMLOtherWorksParser(DOMParserBase): |
6129 |
- def _build_episode(link, title, minfo, role, roleA, roleAID): |
6130 |
- """Build an Movie object for a given episode of a series.""" |
6131 |
- episode_id = analyze_imdbid(link) |
6132 |
-- notes = u'' |
6133 |
-+ notes = '' |
6134 |
- minidx = minfo.find(' -') |
6135 |
- # Sometimes, for some unknown reason, the role is left in minfo. |
6136 |
- if minidx != -1: |
6137 |
-@@ -365,7 +365,7 @@ def _build_episode(link, title, minfo, role, roleA, roleAID): |
6138 |
- if slfRole and role is None and roleA is None: |
6139 |
- role = slfRole |
6140 |
- eps_data = analyze_title(title) |
6141 |
-- eps_data['kind'] = u'episode' |
6142 |
-+ eps_data['kind'] = 'episode' |
6143 |
- # FIXME: it's wrong for multiple characters (very rare on tv series?). |
6144 |
- if role is None: |
6145 |
- role = roleA # At worse, it's None. |
6146 |
-@@ -419,7 +419,7 @@ class DOMHTMLSeriesParser(DOMParserBase): |
6147 |
- }, |
6148 |
- postprocess=lambda x: _build_episode(x.get('link'), |
6149 |
- x.get('title'), |
6150 |
-- (x.get('info') or u'').strip(), |
6151 |
-+ (x.get('info') or '').strip(), |
6152 |
- x.get('role'), |
6153 |
- x.get('roleA'), |
6154 |
- x.get('roleAID')))) |
6155 |
-@@ -429,7 +429,7 @@ class DOMHTMLSeriesParser(DOMParserBase): |
6156 |
- if len(data) == 0: |
6157 |
- return {} |
6158 |
- nd = {} |
6159 |
-- for key in data.keys(): |
6160 |
-+ for key in list(data.keys()): |
6161 |
- dom = self.get_dom(key) |
6162 |
- link = self.xpath(dom, "//a/@href")[0] |
6163 |
- title = self.xpath(dom, "//a/text()")[0][1:-1] |
6164 |
-@@ -483,10 +483,10 @@ class DOMHTMLPersonGenresParser(DOMParserBase): |
6165 |
- return {self.kind: data} |
6166 |
- |
6167 |
- |
6168 |
--from movieParser import DOMHTMLTechParser |
6169 |
--from movieParser import DOMHTMLOfficialsitesParser |
6170 |
--from movieParser import DOMHTMLAwardsParser |
6171 |
--from movieParser import DOMHTMLNewsParser |
6172 |
-+from .movieParser import DOMHTMLTechParser |
6173 |
-+from .movieParser import DOMHTMLOfficialsitesParser |
6174 |
-+from .movieParser import DOMHTMLAwardsParser |
6175 |
-+from .movieParser import DOMHTMLNewsParser |
6176 |
- |
6177 |
- |
6178 |
- _OBJECTS = { |
6179 |
-diff --git a/imdb/parser/http/searchCharacterParser.py b/imdb/parser/http/searchCharacterParser.py |
6180 |
-index c81ca7e..4a540b5 100644 |
6181 |
---- a/imdb/parser/http/searchCharacterParser.py |
6182 |
-+++ b/imdb/parser/http/searchCharacterParser.py |
6183 |
-@@ -26,9 +26,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
6184 |
- """ |
6185 |
- |
6186 |
- from imdb.utils import analyze_name, build_name |
6187 |
--from utils import Extractor, Attribute, analyze_imdbid |
6188 |
-+from .utils import Extractor, Attribute, analyze_imdbid |
6189 |
- |
6190 |
--from searchMovieParser import DOMHTMLSearchMovieParser, DOMBasicMovieParser |
6191 |
-+from .searchMovieParser import DOMHTMLSearchMovieParser, DOMBasicMovieParser |
6192 |
- |
6193 |
- |
6194 |
- class DOMBasicCharacterParser(DOMBasicMovieParser): |
6195 |
-@@ -37,7 +37,7 @@ class DOMBasicCharacterParser(DOMBasicMovieParser): |
6196 |
- It's used by the DOMHTMLSearchCharacterParser class to return a result |
6197 |
- for a direct match (when a search on IMDb results in a single |
6198 |
- character, the web server sends directly the movie page.""" |
6199 |
-- _titleFunct = lambda self, x: analyze_name(x or u'', canonical=False) |
6200 |
-+ _titleFunct = lambda self, x: analyze_name(x or '', canonical=False) |
6201 |
- |
6202 |
- |
6203 |
- class DOMHTMLSearchCharacterParser(DOMHTMLSearchMovieParser): |
6204 |
-@@ -53,7 +53,7 @@ class DOMHTMLSearchCharacterParser(DOMHTMLSearchMovieParser): |
6205 |
- 'name': "./a[1]/text()" |
6206 |
- }, |
6207 |
- postprocess=lambda x: ( |
6208 |
-- analyze_imdbid(x.get('link') or u''), |
6209 |
-+ analyze_imdbid(x.get('link') or ''), |
6210 |
- {'name': x.get('name')} |
6211 |
- ))] |
6212 |
- extractors = [Extractor(label='search', |
6213 |
-diff --git a/imdb/parser/http/searchCompanyParser.py b/imdb/parser/http/searchCompanyParser.py |
6214 |
-index ab666fb..84ca0ed 100644 |
6215 |
---- a/imdb/parser/http/searchCompanyParser.py |
6216 |
-+++ b/imdb/parser/http/searchCompanyParser.py |
6217 |
-@@ -26,9 +26,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
6218 |
- """ |
6219 |
- |
6220 |
- from imdb.utils import analyze_company_name, build_company_name |
6221 |
--from utils import Extractor, Attribute, analyze_imdbid |
6222 |
-+from .utils import Extractor, Attribute, analyze_imdbid |
6223 |
- |
6224 |
--from searchMovieParser import DOMHTMLSearchMovieParser, DOMBasicMovieParser |
6225 |
-+from .searchMovieParser import DOMHTMLSearchMovieParser, DOMBasicMovieParser |
6226 |
- |
6227 |
- class DOMBasicCompanyParser(DOMBasicMovieParser): |
6228 |
- """Simply get the name of a company and the imdbID. |
6229 |
-@@ -37,7 +37,7 @@ class DOMBasicCompanyParser(DOMBasicMovieParser): |
6230 |
- for a direct match (when a search on IMDb results in a single |
6231 |
- company, the web server sends directly the company page. |
6232 |
- """ |
6233 |
-- _titleFunct = lambda self, x: analyze_company_name(x or u'') |
6234 |
-+ _titleFunct = lambda self, x: analyze_company_name(x or '') |
6235 |
- |
6236 |
- |
6237 |
- class DOMHTMLSearchCompanyParser(DOMHTMLSearchMovieParser): |
6238 |
-@@ -56,7 +56,7 @@ class DOMHTMLSearchCompanyParser(DOMHTMLSearchMovieParser): |
6239 |
- postprocess=lambda x: ( |
6240 |
- analyze_imdbid(x.get('link')), |
6241 |
- analyze_company_name(x.get('name')+(x.get('notes') |
6242 |
-- or u''), stripNotes=True) |
6243 |
-+ or ''), stripNotes=True) |
6244 |
- ))] |
6245 |
- extractors = [Extractor(label='search', |
6246 |
- path="//td[3]/a[starts-with(@href, " \ |
6247 |
-diff --git a/imdb/parser/http/searchKeywordParser.py b/imdb/parser/http/searchKeywordParser.py |
6248 |
-index ed72906..973560d 100644 |
6249 |
---- a/imdb/parser/http/searchKeywordParser.py |
6250 |
-+++ b/imdb/parser/http/searchKeywordParser.py |
6251 |
-@@ -24,10 +24,10 @@ along with this program; if not, write to the Free Software |
6252 |
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
6253 |
- """ |
6254 |
- |
6255 |
--from utils import Extractor, Attribute, analyze_imdbid |
6256 |
-+from .utils import Extractor, Attribute, analyze_imdbid |
6257 |
- from imdb.utils import analyze_title, analyze_company_name |
6258 |
- |
6259 |
--from searchMovieParser import DOMHTMLSearchMovieParser, DOMBasicMovieParser |
6260 |
-+from .searchMovieParser import DOMHTMLSearchMovieParser, DOMBasicMovieParser |
6261 |
- |
6262 |
- class DOMBasicKeywordParser(DOMBasicMovieParser): |
6263 |
- """Simply get the name of a keyword. |
6264 |
-@@ -38,7 +38,7 @@ class DOMBasicKeywordParser(DOMBasicMovieParser): |
6265 |
- """ |
6266 |
- # XXX: it's still to be tested! |
6267 |
- # I'm not even sure there can be a direct hit, searching for keywords. |
6268 |
-- _titleFunct = lambda self, x: analyze_company_name(x or u'') |
6269 |
-+ _titleFunct = lambda self, x: analyze_company_name(x or '') |
6270 |
- |
6271 |
- |
6272 |
- class DOMHTMLSearchKeywordParser(DOMHTMLSearchMovieParser): |
6273 |
-@@ -91,10 +91,10 @@ class DOMHTMLSearchMovieKeywordParser(DOMHTMLSearchMovieParser): |
6274 |
- 'outline': "./span[@class='outline']//text()" |
6275 |
- }, |
6276 |
- postprocess=lambda x: ( |
6277 |
-- analyze_imdbid(x.get('link') or u''), |
6278 |
-- custom_analyze_title4kwd(x.get('info') or u'', |
6279 |
-- x.get('ynote') or u'', |
6280 |
-- x.get('outline') or u'') |
6281 |
-+ analyze_imdbid(x.get('link') or ''), |
6282 |
-+ custom_analyze_title4kwd(x.get('info') or '', |
6283 |
-+ x.get('ynote') or '', |
6284 |
-+ x.get('outline') or '') |
6285 |
- ))] |
6286 |
- |
6287 |
- extractors = [Extractor(label='search', |
6288 |
-diff --git a/imdb/parser/http/searchMovieParser.py b/imdb/parser/http/searchMovieParser.py |
6289 |
-index 44c78d0..8e61f56 100644 |
6290 |
---- a/imdb/parser/http/searchMovieParser.py |
6291 |
-+++ b/imdb/parser/http/searchMovieParser.py |
6292 |
-@@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
6293 |
- |
6294 |
- import re |
6295 |
- from imdb.utils import analyze_title, build_title |
6296 |
--from utils import DOMParserBase, Attribute, Extractor, analyze_imdbid |
6297 |
-+from .utils import DOMParserBase, Attribute, Extractor, analyze_imdbid |
6298 |
- |
6299 |
- |
6300 |
- class DOMBasicMovieParser(DOMParserBase): |
6301 |
-@@ -40,7 +40,7 @@ class DOMBasicMovieParser(DOMParserBase): |
6302 |
- # Stay generic enough to be used also for other DOMBasic*Parser classes. |
6303 |
- _titleAttrPath = ".//text()" |
6304 |
- _linkPath = "//link[@rel='canonical']" |
6305 |
-- _titleFunct = lambda self, x: analyze_title(x or u'') |
6306 |
-+ _titleFunct = lambda self, x: analyze_title(x or '') |
6307 |
- |
6308 |
- def _init(self): |
6309 |
- self.preprocessors += [('<span class="tv-extra">TV mini-series</span>', |
6310 |
-@@ -54,7 +54,7 @@ class DOMBasicMovieParser(DOMParserBase): |
6311 |
- path=self._linkPath, |
6312 |
- attrs=Attribute(key='link', path="./@href", |
6313 |
- postprocess=lambda x: \ |
6314 |
-- analyze_imdbid((x or u'').replace( |
6315 |
-+ analyze_imdbid((x or '').replace( |
6316 |
- 'http://pro.imdb.com', '')) |
6317 |
- ))] |
6318 |
- |
6319 |
-@@ -105,18 +105,18 @@ class DOMHTMLSearchMovieParser(DOMParserBase): |
6320 |
- 'akas': ".//p[@class='find-aka']//text()" |
6321 |
- }, |
6322 |
- postprocess=lambda x: ( |
6323 |
-- analyze_imdbid(x.get('link') or u''), |
6324 |
-- custom_analyze_title(x.get('info') or u''), |
6325 |
-+ analyze_imdbid(x.get('link') or ''), |
6326 |
-+ custom_analyze_title(x.get('info') or ''), |
6327 |
- x.get('akas') |
6328 |
- ))] |
6329 |
- extractors = [Extractor(label='search', |
6330 |
- path="//td[3]/a[starts-with(@href, '/title/tt')]/..", |
6331 |
- attrs=_attrs)] |
6332 |
- def _init(self): |
6333 |
-- self.url = u'' |
6334 |
-+ self.url = '' |
6335 |
- |
6336 |
- def _reset(self): |
6337 |
-- self.url = u'' |
6338 |
-+ self.url = '' |
6339 |
- |
6340 |
- def preprocess_string(self, html_string): |
6341 |
- if self._notDirectHitTitle in html_string[:1024].lower(): |
6342 |
-@@ -131,22 +131,22 @@ class DOMHTMLSearchMovieParser(DOMParserBase): |
6343 |
- # Direct hit! |
6344 |
- dbme = self._BaseParser(useModule=self._useModule) |
6345 |
- res = dbme.parse(html_string, url=self.url) |
6346 |
-- if not res: return u'' |
6347 |
-+ if not res: return '' |
6348 |
- res = res['data'] |
6349 |
-- if not (res and res[0]): return u'' |
6350 |
-+ if not (res and res[0]): return '' |
6351 |
- link = '%s%s' % (self._linkPrefix, res[0][0]) |
6352 |
- # # Tries to cope with companies for which links to pro.imdb.com |
6353 |
- # # are missing. |
6354 |
- # link = self.url.replace(imdbURL_base[:-1], '') |
6355 |
- title = self._titleBuilder(res[0][1]) |
6356 |
-- if not (link and title): return u'' |
6357 |
-+ if not (link and title): return '' |
6358 |
- link = link.replace('http://pro.imdb.com', '') |
6359 |
- new_html = '<td></td><td></td><td><a href="%s">%s</a></td>' % (link, |
6360 |
- title) |
6361 |
- return new_html |
6362 |
- |
6363 |
- def postprocess_data(self, data): |
6364 |
-- if not data.has_key('data'): |
6365 |
-+ if 'data' not in data: |
6366 |
- data['data'] = [] |
6367 |
- results = getattr(self, 'results', None) |
6368 |
- if results is not None: |
6369 |
-@@ -161,7 +161,7 @@ class DOMHTMLSearchMovieParser(DOMParserBase): |
6370 |
- if not datum[0] and datum[1]: |
6371 |
- continue |
6372 |
- if datum[2] is not None: |
6373 |
-- akas = filter(None, datum[2].split('::')) |
6374 |
-+ akas = [_f for _f in datum[2].split('::') if _f] |
6375 |
- if self._linkPrefix == '/title/tt': |
6376 |
- akas = [a.replace('" - ', '::').rstrip() for a in akas] |
6377 |
- akas = [a.replace('aka "', '', 1).replace('aka "', |
6378 |
-diff --git a/imdb/parser/http/searchPersonParser.py b/imdb/parser/http/searchPersonParser.py |
6379 |
-index 1756efc..e0b33f0 100644 |
6380 |
---- a/imdb/parser/http/searchPersonParser.py |
6381 |
-+++ b/imdb/parser/http/searchPersonParser.py |
6382 |
-@@ -27,15 +27,15 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
6383 |
- |
6384 |
- import re |
6385 |
- from imdb.utils import analyze_name, build_name |
6386 |
--from utils import Extractor, Attribute, analyze_imdbid |
6387 |
-+from .utils import Extractor, Attribute, analyze_imdbid |
6388 |
- |
6389 |
--from searchMovieParser import DOMHTMLSearchMovieParser, DOMBasicMovieParser |
6390 |
-+from .searchMovieParser import DOMHTMLSearchMovieParser, DOMBasicMovieParser |
6391 |
- |
6392 |
- |
6393 |
- def _cleanName(n): |
6394 |
- """Clean the name in a title tag.""" |
6395 |
- if not n: |
6396 |
-- return u'' |
6397 |
-+ return '' |
6398 |
- n = n.replace('Filmography by type for', '') # FIXME: temporary. |
6399 |
- return n |
6400 |
- |
6401 |
-@@ -68,9 +68,9 @@ class DOMHTMLSearchPersonParser(DOMHTMLSearchMovieParser): |
6402 |
- 'akas': ".//div[@class='_imdbpyAKA']/text()" |
6403 |
- }, |
6404 |
- postprocess=lambda x: ( |
6405 |
-- analyze_imdbid(x.get('link') or u''), |
6406 |
-- analyze_name((x.get('name') or u'') + \ |
6407 |
-- (x.get('index') or u''), |
6408 |
-+ analyze_imdbid(x.get('link') or ''), |
6409 |
-+ analyze_name((x.get('name') or '') + \ |
6410 |
-+ (x.get('index') or ''), |
6411 |
- canonical=1), x.get('akas') |
6412 |
- ))] |
6413 |
- extractors = [Extractor(label='search', |
6414 |
-diff --git a/imdb/parser/http/topBottomParser.py b/imdb/parser/http/topBottomParser.py |
6415 |
-index f0f2950..3e2950b 100644 |
6416 |
---- a/imdb/parser/http/topBottomParser.py |
6417 |
-+++ b/imdb/parser/http/topBottomParser.py |
6418 |
-@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
6419 |
- """ |
6420 |
- |
6421 |
- from imdb.utils import analyze_title |
6422 |
--from utils import DOMParserBase, Attribute, Extractor, analyze_imdbid |
6423 |
-+from .utils import DOMParserBase, Attribute, Extractor, analyze_imdbid |
6424 |
- |
6425 |
- |
6426 |
- class DOMHTMLTop250Parser(DOMParserBase): |
6427 |
-diff --git a/imdb/parser/http/utils.py b/imdb/parser/http/utils.py |
6428 |
-index f8dbc05..4b52f2a 100644 |
6429 |
---- a/imdb/parser/http/utils.py |
6430 |
-+++ b/imdb/parser/http/utils.py |
6431 |
-@@ -32,6 +32,7 @@ from imdb.utils import flatten, _Container |
6432 |
- from imdb.Movie import Movie |
6433 |
- from imdb.Person import Person |
6434 |
- from imdb.Character import Character |
6435 |
-+import collections |
6436 |
- |
6437 |
- |
6438 |
- # Year, imdbIndex and kind. |
6439 |
-@@ -55,77 +56,77 @@ def _putRefs(d, re_titles, re_names, re_characters, lastKey=None): |
6440 |
- """Iterate over the strings inside list items or dictionary values, |
6441 |
- substitutes movie titles and person names with the (qv) references.""" |
6442 |
- if isinstance(d, list): |
6443 |
-- for i in xrange(len(d)): |
6444 |
-- if isinstance(d[i], (unicode, str)): |
6445 |
-+ for i in range(len(d)): |
6446 |
-+ if isinstance(d[i], str): |
6447 |
- if lastKey in _modify_keys: |
6448 |
- if re_names: |
6449 |
-- d[i] = re_names.sub(ur"'\1' (qv)", d[i]) |
6450 |
-+ d[i] = re_names.sub(r"'\1' (qv)", d[i]) |
6451 |
- if re_titles: |
6452 |
-- d[i] = re_titles.sub(ur'_\1_ (qv)', d[i]) |
6453 |
-+ d[i] = re_titles.sub(r'_\1_ (qv)', d[i]) |
6454 |
- if re_characters: |
6455 |
-- d[i] = re_characters.sub(ur'#\1# (qv)', d[i]) |
6456 |
-+ d[i] = re_characters.sub(r'#\1# (qv)', d[i]) |
6457 |
- elif isinstance(d[i], (list, dict)): |
6458 |
- _putRefs(d[i], re_titles, re_names, re_characters, |
6459 |
- lastKey=lastKey) |
6460 |
- elif isinstance(d, dict): |
6461 |
-- for k, v in d.items(): |
6462 |
-+ for k, v in list(d.items()): |
6463 |
- lastKey = k |
6464 |
-- if isinstance(v, (unicode, str)): |
6465 |
-+ if isinstance(v, str): |
6466 |
- if lastKey in _modify_keys: |
6467 |
- if re_names: |
6468 |
-- d[k] = re_names.sub(ur"'\1' (qv)", v) |
6469 |
-+ d[k] = re_names.sub(r"'\1' (qv)", v) |
6470 |
- if re_titles: |
6471 |
-- d[k] = re_titles.sub(ur'_\1_ (qv)', v) |
6472 |
-+ d[k] = re_titles.sub(r'_\1_ (qv)', v) |
6473 |
- if re_characters: |
6474 |
-- d[k] = re_characters.sub(ur'#\1# (qv)', v) |
6475 |
-+ d[k] = re_characters.sub(r'#\1# (qv)', v) |
6476 |
- elif isinstance(v, (list, dict)): |
6477 |
- _putRefs(d[k], re_titles, re_names, re_characters, |
6478 |
- lastKey=lastKey) |
6479 |
- |
6480 |
- |
6481 |
- # Handle HTML/XML/SGML entities. |
6482 |
--from htmlentitydefs import entitydefs |
6483 |
-+from html.entities import entitydefs |
6484 |
- entitydefs = entitydefs.copy() |
6485 |
- entitydefsget = entitydefs.get |
6486 |
- entitydefs['nbsp'] = ' ' |
6487 |
- |
6488 |
- sgmlentity = {'lt': '<', 'gt': '>', 'amp': '&', 'quot': '"', 'apos': '\'', 'ndash': '-'} |
6489 |
- sgmlentityget = sgmlentity.get |
6490 |
--_sgmlentkeys = sgmlentity.keys() |
6491 |
-+_sgmlentkeys = list(sgmlentity.keys()) |
6492 |
- |
6493 |
- entcharrefs = {} |
6494 |
- entcharrefsget = entcharrefs.get |
6495 |
--for _k, _v in entitydefs.items(): |
6496 |
-+for _k, _v in list(entitydefs.items()): |
6497 |
- if _k in _sgmlentkeys: continue |
6498 |
- if _v[0:2] == '&#': |
6499 |
- dec_code = _v[1:-1] |
6500 |
-- _v = unichr(int(_v[2:-1])) |
6501 |
-+ _v = chr(int(_v[2:-1])) |
6502 |
- entcharrefs[dec_code] = _v |
6503 |
- else: |
6504 |
- dec_code = '#' + str(ord(_v)) |
6505 |
-- _v = unicode(_v, 'latin_1', 'replace') |
6506 |
-+ _v = str(_v, 'latin_1', 'replace') |
6507 |
- entcharrefs[dec_code] = _v |
6508 |
- entcharrefs[_k] = _v |
6509 |
- del _sgmlentkeys, _k, _v |
6510 |
--entcharrefs['#160'] = u' ' |
6511 |
--entcharrefs['#xA0'] = u' ' |
6512 |
--entcharrefs['#xa0'] = u' ' |
6513 |
--entcharrefs['#XA0'] = u' ' |
6514 |
--entcharrefs['#x22'] = u'"' |
6515 |
--entcharrefs['#X22'] = u'"' |
6516 |
-+entcharrefs['#160'] = ' ' |
6517 |
-+entcharrefs['#xA0'] = ' ' |
6518 |
-+entcharrefs['#xa0'] = ' ' |
6519 |
-+entcharrefs['#XA0'] = ' ' |
6520 |
-+entcharrefs['#x22'] = '"' |
6521 |
-+entcharrefs['#X22'] = '"' |
6522 |
- # convert &x26; to &, to make BeautifulSoup happy; beware that this |
6523 |
- # leaves lone '&' in the html broken, but I assume this is better than |
6524 |
- # the contrary... |
6525 |
--entcharrefs['#38'] = u'&' |
6526 |
--entcharrefs['#x26'] = u'&' |
6527 |
--entcharrefs['#x26'] = u'&' |
6528 |
-+entcharrefs['#38'] = '&' |
6529 |
-+entcharrefs['#x26'] = '&' |
6530 |
-+entcharrefs['#x26'] = '&' |
6531 |
- |
6532 |
- re_entcharrefs = re.compile('&(%s|\#160|\#\d{1,5}|\#x[0-9a-f]{1,4});' % |
6533 |
- '|'.join(map(re.escape, entcharrefs)), re.I) |
6534 |
- re_entcharrefssub = re_entcharrefs.sub |
6535 |
- |
6536 |
--sgmlentity.update(dict([('#34', u'"'), ('#38', u'&'), |
6537 |
-- ('#60', u'<'), ('#62', u'>'), ('#39', u"'")])) |
6538 |
-+sgmlentity.update(dict([('#34', '"'), ('#38', '&'), |
6539 |
-+ ('#60', '<'), ('#62', '>'), ('#39', "'")])) |
6540 |
- re_sgmlref = re.compile('&(%s);' % '|'.join(map(re.escape, sgmlentity))) |
6541 |
- re_sgmlrefsub = re_sgmlref.sub |
6542 |
- |
6543 |
-@@ -148,9 +149,9 @@ def _replXMLRef(match): |
6544 |
- #if ref[2:] == '26': |
6545 |
- # # Don't convert &x26; to &, to make BeautifulSoup happy. |
6546 |
- # return '&' |
6547 |
-- return unichr(int(ref[2:], 16)) |
6548 |
-+ return chr(int(ref[2:], 16)) |
6549 |
- else: |
6550 |
-- return unichr(int(ref[1:])) |
6551 |
-+ return chr(int(ref[1:])) |
6552 |
- else: |
6553 |
- return ref |
6554 |
- return value |
6555 |
-@@ -179,8 +180,8 @@ def build_person(txt, personID=None, billingPos=None, |
6556 |
- found in the IMDb's web site.""" |
6557 |
- #if personID is None |
6558 |
- # _b_p_logger.debug('empty name or personID for "%s"', txt) |
6559 |
-- notes = u'' |
6560 |
-- role = u'' |
6561 |
-+ notes = '' |
6562 |
-+ role = '' |
6563 |
- # Search the (optional) separator between name and role/notes. |
6564 |
- if txt.find('....') != -1: |
6565 |
- sep = '....' |
6566 |
-@@ -219,7 +220,7 @@ def build_person(txt, personID=None, billingPos=None, |
6567 |
- # We're managing something that doesn't have a 'role', so |
6568 |
- # everything are notes. |
6569 |
- notes = role_comment |
6570 |
-- if role == '....': role = u'' |
6571 |
-+ if role == '....': role = '' |
6572 |
- roleNotes = [] |
6573 |
- # Manages multiple roleIDs. |
6574 |
- if isinstance(roleID, list): |
6575 |
-@@ -245,7 +246,7 @@ def build_person(txt, personID=None, billingPos=None, |
6576 |
- if lr == 1: |
6577 |
- role = role[0] |
6578 |
- roleID = roleID[0] |
6579 |
-- notes = roleNotes[0] or u'' |
6580 |
-+ notes = roleNotes[0] or '' |
6581 |
- elif roleID is not None: |
6582 |
- roleID = str(roleID) |
6583 |
- if personID is not None: |
6584 |
-@@ -287,8 +288,8 @@ def build_movie(txt, movieID=None, roleID=None, status=None, |
6585 |
- title = re_spaces.sub(' ', txt).strip() |
6586 |
- # Split the role/notes from the movie title. |
6587 |
- tsplit = title.split(_defSep, 1) |
6588 |
-- role = u'' |
6589 |
-- notes = u'' |
6590 |
-+ role = '' |
6591 |
-+ notes = '' |
6592 |
- roleNotes = [] |
6593 |
- if len(tsplit) == 2: |
6594 |
- title = tsplit[0].rstrip() |
6595 |
-@@ -346,16 +347,16 @@ def build_movie(txt, movieID=None, roleID=None, status=None, |
6596 |
- if notes: notes = '%s %s' % (title[fpIdx:], notes) |
6597 |
- else: notes = title[fpIdx:] |
6598 |
- title = title[:fpIdx].rstrip() |
6599 |
-- title = u'%s (%s)' % (title, year) |
6600 |
-+ title = '%s (%s)' % (title, year) |
6601 |
- if _parsingCharacter and roleID and not role: |
6602 |
- roleID = None |
6603 |
- if not roleID: |
6604 |
- roleID = None |
6605 |
- elif len(roleID) == 1: |
6606 |
- roleID = roleID[0] |
6607 |
-- if not role and chrRoles and isinstance(roleID, (str, unicode)): |
6608 |
-+ if not role and chrRoles and isinstance(roleID, str): |
6609 |
- roleID = _re_chrIDs.findall(roleID) |
6610 |
-- role = ' / '.join(filter(None, chrRoles.split('@@'))) |
6611 |
-+ role = ' / '.join([_f for _f in chrRoles.split('@@') if _f]) |
6612 |
- # Manages multiple roleIDs. |
6613 |
- if isinstance(roleID, list): |
6614 |
- tmprole = role.split('/') |
6615 |
-@@ -387,7 +388,7 @@ def build_movie(txt, movieID=None, roleID=None, status=None, |
6616 |
- if (not title) or (movieID is None): |
6617 |
- _b_m_logger.error('empty title or movieID for "%s"', txt) |
6618 |
- if rolesNoChar: |
6619 |
-- rolesNoChar = filter(None, [x.strip() for x in rolesNoChar.split('/')]) |
6620 |
-+ rolesNoChar = [_f for _f in [x.strip() for x in rolesNoChar.split('/')] if _f] |
6621 |
- if not role: |
6622 |
- role = [] |
6623 |
- elif not isinstance(role, list): |
6624 |
-@@ -397,7 +398,7 @@ def build_movie(txt, movieID=None, roleID=None, status=None, |
6625 |
- if additionalNotes: |
6626 |
- additionalNotes = re_spaces.sub(' ', additionalNotes).strip() |
6627 |
- if notes: |
6628 |
-- notes += u' ' |
6629 |
-+ notes += ' ' |
6630 |
- notes += additionalNotes |
6631 |
- if role and isinstance(role, list) and notes.endswith(role[-1].replace('\n', ' ')): |
6632 |
- role = role[:-1] |
6633 |
-@@ -450,8 +451,8 @@ class DOMParserBase(object): |
6634 |
- self._is_xml_unicode = False |
6635 |
- self.usingModule = 'lxml' |
6636 |
- elif mod == 'beautifulsoup': |
6637 |
-- from bsouplxml.html import fromstring |
6638 |
-- from bsouplxml.etree import tostring |
6639 |
-+ from .bsouplxml.html import fromstring |
6640 |
-+ from .bsouplxml.etree import tostring |
6641 |
- self._is_xml_unicode = True |
6642 |
- self.usingModule = 'beautifulsoup' |
6643 |
- else: |
6644 |
-@@ -462,7 +463,7 @@ class DOMParserBase(object): |
6645 |
- if _gotError: |
6646 |
- warnings.warn('falling back to "%s"' % mod) |
6647 |
- break |
6648 |
-- except ImportError, e: |
6649 |
-+ except ImportError as e: |
6650 |
- if idx+1 >= nrMods: |
6651 |
- # Raise the exception, if we don't have any more |
6652 |
- # options to try. |
6653 |
-@@ -507,8 +508,8 @@ class DOMParserBase(object): |
6654 |
- else: |
6655 |
- self.getRefs = self._defGetRefs |
6656 |
- # Useful only for the testsuite. |
6657 |
-- if not isinstance(html_string, unicode): |
6658 |
-- html_string = unicode(html_string, 'latin_1', 'replace') |
6659 |
-+ if not isinstance(html_string, str): |
6660 |
-+ html_string = str(html_string, 'latin_1', 'replace') |
6661 |
- html_string = subXMLRefs(html_string) |
6662 |
- # Temporary fix: self.parse_dom must work even for empty strings. |
6663 |
- html_string = self.preprocess_string(html_string) |
6664 |
-@@ -526,13 +527,13 @@ class DOMParserBase(object): |
6665 |
- #print self.tostring(dom).encode('utf8') |
6666 |
- try: |
6667 |
- dom = self.preprocess_dom(dom) |
6668 |
-- except Exception, e: |
6669 |
-+ except Exception as e: |
6670 |
- self._logger.error('%s: caught exception preprocessing DOM', |
6671 |
- self._cname, exc_info=True) |
6672 |
- if self.getRefs: |
6673 |
- try: |
6674 |
- self.gather_refs(dom) |
6675 |
-- except Exception, e: |
6676 |
-+ except Exception as e: |
6677 |
- self._logger.warn('%s: unable to gather refs: %s', |
6678 |
- self._cname, exc_info=True) |
6679 |
- data = self.parse_dom(dom) |
6680 |
-@@ -540,7 +541,7 @@ class DOMParserBase(object): |
6681 |
- data = {} |
6682 |
- try: |
6683 |
- data = self.postprocess_data(data) |
6684 |
-- except Exception, e: |
6685 |
-+ except Exception as e: |
6686 |
- self._logger.error('%s: caught exception postprocessing data', |
6687 |
- self._cname, exc_info=True) |
6688 |
- if self._containsObjects: |
6689 |
-@@ -549,7 +550,7 @@ class DOMParserBase(object): |
6690 |
- return data |
6691 |
- |
6692 |
- def _build_empty_dom(self): |
6693 |
-- from bsouplxml import _bsoup |
6694 |
-+ from .bsouplxml import _bsoup |
6695 |
- return _bsoup.BeautifulSoup('') |
6696 |
- |
6697 |
- def get_dom(self, html_string): |
6698 |
-@@ -560,7 +561,7 @@ class DOMParserBase(object): |
6699 |
- dom = self._build_empty_dom() |
6700 |
- self._logger.error('%s: using a fake empty DOM', self._cname) |
6701 |
- return dom |
6702 |
-- except Exception, e: |
6703 |
-+ except Exception as e: |
6704 |
- self._logger.error('%s: caught exception parsing DOM', |
6705 |
- self._cname, exc_info=True) |
6706 |
- return self._build_empty_dom() |
6707 |
-@@ -574,25 +575,25 @@ class DOMParserBase(object): |
6708 |
- result = [] |
6709 |
- for item in xpath_result: |
6710 |
- if isinstance(item, str): |
6711 |
-- item = unicode(item) |
6712 |
-+ item = str(item) |
6713 |
- result.append(item) |
6714 |
- return result |
6715 |
-- except Exception, e: |
6716 |
-+ except Exception as e: |
6717 |
- self._logger.error('%s: caught exception extracting XPath "%s"', |
6718 |
- self._cname, path, exc_info=True) |
6719 |
- return [] |
6720 |
- |
6721 |
- def tostring(self, element): |
6722 |
- """Convert the element to a string.""" |
6723 |
-- if isinstance(element, (unicode, str)): |
6724 |
-- return unicode(element) |
6725 |
-+ if isinstance(element, str): |
6726 |
-+ return str(element) |
6727 |
- else: |
6728 |
- try: |
6729 |
-- return self._tostring(element, encoding=unicode) |
6730 |
-- except Exception, e: |
6731 |
-+ return self._tostring(element, encoding=str) |
6732 |
-+ except Exception as e: |
6733 |
- self._logger.error('%s: unable to convert to string', |
6734 |
- self._cname, exc_info=True) |
6735 |
-- return u'' |
6736 |
-+ return '' |
6737 |
- |
6738 |
- def clone(self, element): |
6739 |
- """Clone an element.""" |
6740 |
-@@ -603,22 +604,22 @@ class DOMParserBase(object): |
6741 |
- if not html_string: |
6742 |
- return html_string |
6743 |
- # Remove silly » and – chars. |
6744 |
-- html_string = html_string.replace(u' \xbb', u'') |
6745 |
-- html_string = html_string.replace(u'–', u'-') |
6746 |
-+ html_string = html_string.replace(' \xbb', '') |
6747 |
-+ html_string = html_string.replace('–', '-') |
6748 |
- try: |
6749 |
- preprocessors = self.preprocessors |
6750 |
- except AttributeError: |
6751 |
- return html_string |
6752 |
- for src, sub in preprocessors: |
6753 |
- # re._pattern_type is present only since Python 2.5. |
6754 |
-- if callable(getattr(src, 'sub', None)): |
6755 |
-+ if isinstance(getattr(src, 'sub', None), collections.Callable): |
6756 |
- html_string = src.sub(sub, html_string) |
6757 |
- elif isinstance(src, str): |
6758 |
- html_string = html_string.replace(src, sub) |
6759 |
-- elif callable(src): |
6760 |
-+ elif isinstance(src, collections.Callable): |
6761 |
- try: |
6762 |
- html_string = src(html_string) |
6763 |
-- except Exception, e: |
6764 |
-+ except Exception as e: |
6765 |
- _msg = '%s: caught exception preprocessing html' |
6766 |
- self._logger.error(_msg, self._cname, exc_info=True) |
6767 |
- continue |
6768 |
-@@ -663,10 +664,10 @@ class DOMParserBase(object): |
6769 |
- group_key = self.tostring(group_key) |
6770 |
- normalizer = extractor.group_key_normalize |
6771 |
- if normalizer is not None: |
6772 |
-- if callable(normalizer): |
6773 |
-+ if isinstance(normalizer, collections.Callable): |
6774 |
- try: |
6775 |
- group_key = normalizer(group_key) |
6776 |
-- except Exception, e: |
6777 |
-+ except Exception as e: |
6778 |
- _m = '%s: unable to apply group_key normalizer' |
6779 |
- self._logger.error(_m, self._cname, |
6780 |
- exc_info=True) |
6781 |
-@@ -677,7 +678,7 @@ class DOMParserBase(object): |
6782 |
- for attr in extractor.attrs: |
6783 |
- if isinstance(attr.path, dict): |
6784 |
- data = {} |
6785 |
-- for field in attr.path.keys(): |
6786 |
-+ for field in list(attr.path.keys()): |
6787 |
- path = attr.path[field] |
6788 |
- value = self.xpath(element, path) |
6789 |
- if not value: |
6790 |
-@@ -694,10 +695,10 @@ class DOMParserBase(object): |
6791 |
- if not data: |
6792 |
- continue |
6793 |
- attr_postprocess = attr.postprocess |
6794 |
-- if callable(attr_postprocess): |
6795 |
-+ if isinstance(attr_postprocess, collections.Callable): |
6796 |
- try: |
6797 |
- data = attr_postprocess(data) |
6798 |
-- except Exception, e: |
6799 |
-+ except Exception as e: |
6800 |
- _m = '%s: unable to apply attr postprocess' |
6801 |
- self._logger.error(_m, self._cname, exc_info=True) |
6802 |
- key = attr.key |
6803 |
-@@ -737,17 +738,17 @@ class DOMParserBase(object): |
6804 |
- def add_refs(self, data): |
6805 |
- """Modify data according to the expected output.""" |
6806 |
- if self.getRefs: |
6807 |
-- titl_re = ur'(%s)' % '|'.join([re.escape(x) for x |
6808 |
-- in self._titlesRefs.keys()]) |
6809 |
-- if titl_re != ur'()': re_titles = re.compile(titl_re, re.U) |
6810 |
-+ titl_re = r'(%s)' % '|'.join([re.escape(x) for x |
6811 |
-+ in list(self._titlesRefs.keys())]) |
6812 |
-+ if titl_re != r'()': re_titles = re.compile(titl_re, re.U) |
6813 |
- else: re_titles = None |
6814 |
-- nam_re = ur'(%s)' % '|'.join([re.escape(x) for x |
6815 |
-- in self._namesRefs.keys()]) |
6816 |
-- if nam_re != ur'()': re_names = re.compile(nam_re, re.U) |
6817 |
-+ nam_re = r'(%s)' % '|'.join([re.escape(x) for x |
6818 |
-+ in list(self._namesRefs.keys())]) |
6819 |
-+ if nam_re != r'()': re_names = re.compile(nam_re, re.U) |
6820 |
- else: re_names = None |
6821 |
-- chr_re = ur'(%s)' % '|'.join([re.escape(x) for x |
6822 |
-- in self._charactersRefs.keys()]) |
6823 |
-- if chr_re != ur'()': re_characters = re.compile(chr_re, re.U) |
6824 |
-+ chr_re = r'(%s)' % '|'.join([re.escape(x) for x |
6825 |
-+ in list(self._charactersRefs.keys())]) |
6826 |
-+ if chr_re != r'()': re_characters = re.compile(chr_re, re.U) |
6827 |
- else: re_characters = None |
6828 |
- _putRefs(data, re_titles, re_names, re_characters) |
6829 |
- return {'data': data, 'titlesRefs': self._titlesRefs, |
6830 |
-@@ -827,8 +828,8 @@ class GatherRefs(DOMParserBase): |
6831 |
- 'link': './@href', |
6832 |
- 'info': './following::text()[1]' |
6833 |
- }, |
6834 |
-- postprocess=lambda x: _parse_ref(x.get('text') or u'', x.get('link') or '', |
6835 |
-- (x.get('info') or u'').strip()))] |
6836 |
-+ postprocess=lambda x: _parse_ref(x.get('text') or '', x.get('link') or '', |
6837 |
-+ (x.get('info') or '').strip()))] |
6838 |
- extractors = [ |
6839 |
- Extractor(label='names refs', |
6840 |
- path="//a[starts-with(@href, '/name/nm')][string-length(@href)=16]", |
6841 |
-diff --git a/imdb/parser/mobile/__init__.py b/imdb/parser/mobile/__init__.py |
6842 |
-index c391386..f9b8539 100644 |
6843 |
---- a/imdb/parser/mobile/__init__.py |
6844 |
-+++ b/imdb/parser/mobile/__init__.py |
6845 |
-@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
6846 |
- |
6847 |
- import re |
6848 |
- import logging |
6849 |
--from urllib import unquote |
6850 |
-+from urllib.parse import unquote |
6851 |
- |
6852 |
- from imdb.Movie import Movie |
6853 |
- from imdb.utils import analyze_title, analyze_name, canonicalName, \ |
6854 |
-@@ -259,7 +259,7 @@ class IMDbMobileAccessSystem(IMDbHTTPAccessSystem): |
6855 |
- m = Movie(movieID=str(mid[0]), data=s_data, |
6856 |
- accessSystem=self.accessSystem, |
6857 |
- modFunct=self._defModFunct) |
6858 |
-- d['kind'] = kind = u'episode' |
6859 |
-+ d['kind'] = kind = 'episode' |
6860 |
- d['episode of'] = m |
6861 |
- if kind in ('tv series', 'tv mini series'): |
6862 |
- years = _findBetween(cont, '<h1>', '</h1>', maxRes=1) |
6863 |
-@@ -471,7 +471,7 @@ class IMDbMobileAccessSystem(IMDbHTTPAccessSystem): |
6864 |
- cont = self._mretrieve(self.urls['movie_main'] % movieID + 'plotsummary') |
6865 |
- plot = _findBetween(cont, '<p class="plotpar">', '</p>') |
6866 |
- plot[:] = [_unHtml(x) for x in plot] |
6867 |
-- for i in xrange(len(plot)): |
6868 |
-+ for i in range(len(plot)): |
6869 |
- p = plot[i] |
6870 |
- wbyidx = p.rfind(' Written by ') |
6871 |
- if wbyidx != -1: |
6872 |
-@@ -555,7 +555,7 @@ class IMDbMobileAccessSystem(IMDbHTTPAccessSystem): |
6873 |
- #date, notes = date_and_notes(date) |
6874 |
- # TODO: fix to handle real names. |
6875 |
- date_notes = date.split(' in ', 1) |
6876 |
-- notes = u'' |
6877 |
-+ notes = '' |
6878 |
- date = date_notes[0] |
6879 |
- if len(date_notes) == 2: |
6880 |
- notes = date_notes[1] |
6881 |
-@@ -576,7 +576,7 @@ class IMDbMobileAccessSystem(IMDbHTTPAccessSystem): |
6882 |
- akas = akas.split(' | ') |
6883 |
- else: |
6884 |
- akas = akas.split(' / ') |
6885 |
-- if akas: r['akas'] = filter(None, [x.strip() for x in akas]) |
6886 |
-+ if akas: r['akas'] = [_f for _f in [x.strip() for x in akas] if _f] |
6887 |
- hs = _findBetween(s, "rel='image_src'", '>', maxRes=1) |
6888 |
- if not hs: |
6889 |
- hs = _findBetween(s, 'rel="image_src"', '>', maxRes=1) |
6890 |
-@@ -607,7 +607,7 @@ class IMDbMobileAccessSystem(IMDbHTTPAccessSystem): |
6891 |
- #if _parseChr: |
6892 |
- # ws.append(('filmography', 'filmography')) |
6893 |
- for sect, sectName in ws: |
6894 |
-- raws = u'' |
6895 |
-+ raws = '' |
6896 |
- if sectName == 'self': |
6897 |
- sect = 'Self' |
6898 |
- # Everything between the current section link and the end |
6899 |
-@@ -657,7 +657,7 @@ class IMDbMobileAccessSystem(IMDbHTTPAccessSystem): |
6900 |
- movieID = str(movieID[0]) |
6901 |
- # Search the status. |
6902 |
- stidx = m.find('<i>') |
6903 |
-- status = u'' |
6904 |
-+ status = '' |
6905 |
- if stidx != -1: |
6906 |
- stendidx = m.rfind('</i>') |
6907 |
- if stendidx != -1: |
6908 |
-@@ -691,7 +691,7 @@ class IMDbMobileAccessSystem(IMDbHTTPAccessSystem): |
6909 |
- if vtag: |
6910 |
- try: |
6911 |
- vtag = unquote(str(vtag[0])) |
6912 |
-- vtag = unicode(vtag, 'latin_1') |
6913 |
-+ vtag = str(vtag, 'latin_1') |
6914 |
- r.update(analyze_name(vtag)) |
6915 |
- except UnicodeEncodeError: |
6916 |
- pass |
6917 |
-@@ -725,7 +725,7 @@ class IMDbMobileAccessSystem(IMDbHTTPAccessSystem): |
6918 |
- misc_sects[:] = [x for x in misc_sects if len(x) == 2] |
6919 |
- for sect, data in misc_sects: |
6920 |
- sect = sect.lower().replace(':', '').strip() |
6921 |
-- if d.has_key(sect) and sect != 'mini biography': continue |
6922 |
-+ if sect in d and sect != 'mini biography': continue |
6923 |
- elif sect in ('spouse', 'nickname'): continue |
6924 |
- if sect == 'salary': sect = 'salary history' |
6925 |
- elif sect == 'where are they now': sect = 'where now' |
6926 |
-@@ -761,7 +761,7 @@ class IMDbMobileAccessSystem(IMDbHTTPAccessSystem): |
6927 |
- bioAuth = bio[:byidx].rstrip() |
6928 |
- else: |
6929 |
- bioAuth = 'Anonymous' |
6930 |
-- bio = u'%s::%s' % (bioAuth, bio[byidx+23:].lstrip()) |
6931 |
-+ bio = '%s::%s' % (bioAuth, bio[byidx+23:].lstrip()) |
6932 |
- ndata.append(bio) |
6933 |
- data[:] = ndata |
6934 |
- if 'mini biography' in d: |
6935 |
-diff --git a/imdb/parser/sql/__init__.py b/imdb/parser/sql/__init__.py |
6936 |
-index 4ab5adc..4dafc53 100644 |
6937 |
---- a/imdb/parser/sql/__init__.py |
6938 |
-+++ b/imdb/parser/sql/__init__.py |
6939 |
-@@ -53,9 +53,9 @@ _aux_logger = logging.getLogger('imdbpy.parser.sql.aux') |
6940 |
- def titleVariations(title, fromPtdf=0): |
6941 |
- """Build title variations useful for searches; if fromPtdf is true, |
6942 |
- the input is assumed to be in the plain text data files format.""" |
6943 |
-- if fromPtdf: title1 = u'' |
6944 |
-+ if fromPtdf: title1 = '' |
6945 |
- else: title1 = title |
6946 |
-- title2 = title3 = u'' |
6947 |
-+ title2 = title3 = '' |
6948 |
- if fromPtdf or re_year_index.search(title): |
6949 |
- # If it appears to have a (year[/imdbIndex]) indication, |
6950 |
- # assume that a long imdb canonical name was provided. |
6951 |
-@@ -73,13 +73,13 @@ def titleVariations(title, fromPtdf=0): |
6952 |
- # Just a title. |
6953 |
- # title1: the canonical title. |
6954 |
- title1 = canonicalTitle(title) |
6955 |
-- title3 = u'' |
6956 |
-+ title3 = '' |
6957 |
- # title2 is title1 without the article, or title1 unchanged. |
6958 |
- if title1: |
6959 |
- title2 = title1 |
6960 |
-- t2s = title2.split(u', ') |
6961 |
-+ t2s = title2.split(', ') |
6962 |
- if t2s[-1].lower() in _unicodeArticles: |
6963 |
-- title2 = u', '.join(t2s[:-1]) |
6964 |
-+ title2 = ', '.join(t2s[:-1]) |
6965 |
- _aux_logger.debug('title variations: 1:[%s] 2:[%s] 3:[%s]', |
6966 |
- title1, title2, title3) |
6967 |
- return title1, title2, title3 |
6968 |
-@@ -90,7 +90,7 @@ re_nameIndex = re.compile(r'\(([IVXLCDM]+)\)') |
6969 |
- def nameVariations(name, fromPtdf=0): |
6970 |
- """Build name variations useful for searches; if fromPtdf is true, |
6971 |
- the input is assumed to be in the plain text data files format.""" |
6972 |
-- name1 = name2 = name3 = u'' |
6973 |
-+ name1 = name2 = name3 = '' |
6974 |
- if fromPtdf or re_nameIndex.search(name): |
6975 |
- # We've a name with an (imdbIndex) |
6976 |
- namedict = analyze_name(name, canonical=1) |
6977 |
-@@ -98,17 +98,17 @@ def nameVariations(name, fromPtdf=0): |
6978 |
- name1 = namedict['name'] |
6979 |
- # name3 is the canonical name with the imdbIndex. |
6980 |
- if fromPtdf: |
6981 |
-- if namedict.has_key('imdbIndex'): |
6982 |
-+ if 'imdbIndex' in namedict: |
6983 |
- name3 = name |
6984 |
- else: |
6985 |
- name3 = build_name(namedict, canonical=1) |
6986 |
- else: |
6987 |
- # name1 is the name in the canonical format. |
6988 |
- name1 = canonicalName(name) |
6989 |
-- name3 = u'' |
6990 |
-+ name3 = '' |
6991 |
- # name2 is the name in the normal format, if it differs from name1. |
6992 |
- name2 = normalizeName(name1) |
6993 |
-- if name1 == name2: name2 = u'' |
6994 |
-+ if name1 == name2: name2 = '' |
6995 |
- _aux_logger.debug('name variations: 1:[%s] 2:[%s] 3:[%s]', |
6996 |
- name1, name2, name3) |
6997 |
- return name1, name2, name3 |
6998 |
-@@ -173,10 +173,10 @@ def scan_names(name_list, name1, name2, name3, results=0, ro_thresold=None, |
6999 |
- # XXX: on Symbian, here we get a str; not sure this is the |
7000 |
- # right place to fix it. |
7001 |
- if isinstance(nil, str): |
7002 |
-- nil = unicode(nil, 'latin1', 'ignore') |
7003 |
-+ nil = str(nil, 'latin1', 'ignore') |
7004 |
- # Distance with the canonical name. |
7005 |
- ratios = [ratcliff(name1, nil, sm1) + 0.05] |
7006 |
-- namesurname = u'' |
7007 |
-+ namesurname = '' |
7008 |
- if not _scan_character: |
7009 |
- nils = nil.split(', ', 1) |
7010 |
- surname = nils[0] |
7011 |
-@@ -201,10 +201,10 @@ def scan_names(name_list, name1, name2, name3, results=0, ro_thresold=None, |
7012 |
- build_name(n_data, canonical=1), sm3) + 0.1) |
7013 |
- ratio = max(ratios) |
7014 |
- if ratio >= RO_THRESHOLD: |
7015 |
-- if resd.has_key(i): |
7016 |
-+ if i in resd: |
7017 |
- if ratio > resd[i][0]: resd[i] = (ratio, (i, n_data)) |
7018 |
- else: resd[i] = (ratio, (i, n_data)) |
7019 |
-- res = resd.values() |
7020 |
-+ res = list(resd.values()) |
7021 |
- res.sort() |
7022 |
- res.reverse() |
7023 |
- if results > 0: res[:] = res[:results] |
7024 |
-@@ -250,7 +250,7 @@ def scan_titles(titles_list, title1, title2, title3, results=0, |
7025 |
- # XXX: on Symbian, here we get a str; not sure this is the |
7026 |
- # right place to fix it. |
7027 |
- if isinstance(til, str): |
7028 |
-- til = unicode(til, 'latin1', 'ignore') |
7029 |
-+ til = str(til, 'latin1', 'ignore') |
7030 |
- # Distance with the canonical title (with or without article). |
7031 |
- # titleS -> titleR |
7032 |
- # titleS, the -> titleR, the |
7033 |
-@@ -278,11 +278,11 @@ def scan_titles(titles_list, title1, title2, title3, results=0, |
7034 |
- build_title(t_data, canonical=1, ptdf=1), sm3) + 0.1) |
7035 |
- ratio = max(ratios) |
7036 |
- if ratio >= RO_THRESHOLD: |
7037 |
-- if resd.has_key(i): |
7038 |
-+ if i in resd: |
7039 |
- if ratio > resd[i][0]: |
7040 |
- resd[i] = (ratio, (i, t_data)) |
7041 |
- else: resd[i] = (ratio, (i, t_data)) |
7042 |
-- res = resd.values() |
7043 |
-+ res = list(resd.values()) |
7044 |
- res.sort() |
7045 |
- res.reverse() |
7046 |
- if results > 0: res[:] = res[:results] |
7047 |
-@@ -303,7 +303,7 @@ def scan_company_names(name_list, name1, results=0, ro_thresold=None): |
7048 |
- # XXX: on Symbian, here we get a str; not sure this is the |
7049 |
- # right place to fix it. |
7050 |
- if isinstance(n, str): |
7051 |
-- n = unicode(n, 'latin1', 'ignore') |
7052 |
-+ n = str(n, 'latin1', 'ignore') |
7053 |
- o_name = n |
7054 |
- var = 0.0 |
7055 |
- if withoutCountry and n.endswith(']'): |
7056 |
-@@ -314,12 +314,12 @@ def scan_company_names(name_list, name1, results=0, ro_thresold=None): |
7057 |
- # Distance with the company name. |
7058 |
- ratio = ratcliff(name1, n, sm1) + var |
7059 |
- if ratio >= RO_THRESHOLD: |
7060 |
-- if resd.has_key(i): |
7061 |
-+ if i in resd: |
7062 |
- if ratio > resd[i][0]: resd[i] = (ratio, |
7063 |
- (i, analyze_company_name(o_name))) |
7064 |
- else: |
7065 |
- resd[i] = (ratio, (i, analyze_company_name(o_name))) |
7066 |
-- res = resd.values() |
7067 |
-+ res = list(resd.values()) |
7068 |
- res.sort() |
7069 |
- res.reverse() |
7070 |
- if results > 0: res[:] = res[:results] |
7071 |
-@@ -417,8 +417,8 @@ def _reGroupDict(d, newgr): |
7072 |
- and put it in the subsection (another dictionary) named |
7073 |
- 'laserdisc', using the key 'label'.""" |
7074 |
- r = {} |
7075 |
-- newgrks = newgr.keys() |
7076 |
-- for k, v in d.items(): |
7077 |
-+ newgrks = list(newgr.keys()) |
7078 |
-+ for k, v in list(d.items()): |
7079 |
- if k in newgrks: |
7080 |
- r.setdefault(newgr[k][0], {})[newgr[k][1]] = v |
7081 |
- # A not-so-clearer version: |
7082 |
-@@ -434,7 +434,7 @@ def _groupListBy(l, index): |
7083 |
- tmpd = {} |
7084 |
- for item in l: |
7085 |
- tmpd.setdefault(item[index], []).append(item) |
7086 |
-- res = tmpd.values() |
7087 |
-+ res = list(tmpd.values()) |
7088 |
- return res |
7089 |
- |
7090 |
- |
7091 |
-@@ -458,7 +458,7 @@ def get_movie_data(movieID, kindDict, fromAka=0, _table=None): |
7092 |
- 'season': m.seasonNr, 'episode': m.episodeNr} |
7093 |
- if not fromAka: |
7094 |
- if m.seriesYears is not None: |
7095 |
-- mdict['series years'] = unicode(m.seriesYears) |
7096 |
-+ mdict['series years'] = str(m.seriesYears) |
7097 |
- if mdict['imdbIndex'] is None: del mdict['imdbIndex'] |
7098 |
- if mdict['year'] is None: del mdict['year'] |
7099 |
- else: |
7100 |
-@@ -507,7 +507,7 @@ def getSingleInfo(table, movieID, infoType, notAList=False): |
7101 |
- info = r.info |
7102 |
- note = r.note |
7103 |
- if note: |
7104 |
-- info += u'::%s' % note |
7105 |
-+ info += '::%s' % note |
7106 |
- retList.append(info) |
7107 |
- if not retList: |
7108 |
- return {} |
7109 |
-@@ -552,11 +552,11 @@ class IMDbSqlAccessSystem(IMDbBase): |
7110 |
- mod = mod.strip().lower() |
7111 |
- try: |
7112 |
- if mod == 'sqlalchemy': |
7113 |
-- from alchemyadapter import getDBTables, NotFoundError, \ |
7114 |
-+ from .alchemyadapter import getDBTables, NotFoundError, \ |
7115 |
- setConnection, AND, OR, IN, \ |
7116 |
- ISNULL, CONTAINSSTRING, toUTF8 |
7117 |
- elif mod == 'sqlobject': |
7118 |
-- from objectadapter import getDBTables, NotFoundError, \ |
7119 |
-+ from .objectadapter import getDBTables, NotFoundError, \ |
7120 |
- setConnection, AND, OR, IN, \ |
7121 |
- ISNULL, CONTAINSSTRING, toUTF8 |
7122 |
- else: |
7123 |
-@@ -578,7 +578,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7124 |
- if _gotError: |
7125 |
- self._sql_logger.warn('falling back to "%s"' % mod) |
7126 |
- break |
7127 |
-- except ImportError, e: |
7128 |
-+ except ImportError as e: |
7129 |
- if idx+1 >= nrMods: |
7130 |
- raise IMDbError('unable to use any ORM in %s: %s' % ( |
7131 |
- str(useORM), str(e))) |
7132 |
-@@ -593,7 +593,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7133 |
- self._sql_logger.debug('connecting to %s', uri) |
7134 |
- try: |
7135 |
- self._connection = setConnection(uri, DB_TABLES) |
7136 |
-- except AssertionError, e: |
7137 |
-+ except AssertionError as e: |
7138 |
- raise IMDbDataAccessError( \ |
7139 |
- 'unable to connect to the database server; ' + \ |
7140 |
- 'complete message: "%s"' % str(e)) |
7141 |
-@@ -642,11 +642,11 @@ class IMDbSqlAccessSystem(IMDbBase): |
7142 |
- |
7143 |
- def _findRefs(self, o, trefs, nrefs): |
7144 |
- """Find titles or names references in strings.""" |
7145 |
-- if isinstance(o, (unicode, str)): |
7146 |
-+ if isinstance(o, str): |
7147 |
- for title in re_titleRef.findall(o): |
7148 |
- a_title = analyze_title(title, canonical=0) |
7149 |
- rtitle = build_title(a_title, ptdf=1) |
7150 |
-- if trefs.has_key(rtitle): continue |
7151 |
-+ if rtitle in trefs: continue |
7152 |
- movieID = self._getTitleID(rtitle) |
7153 |
- if movieID is None: |
7154 |
- movieID = self._getTitleID(title) |
7155 |
-@@ -655,7 +655,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7156 |
- m = Movie(title=rtitle, movieID=movieID, |
7157 |
- accessSystem=self.accessSystem) |
7158 |
- trefs[rtitle] = m |
7159 |
-- rtitle2 = canonicalTitle(a_title.get('title', u'')) |
7160 |
-+ rtitle2 = canonicalTitle(a_title.get('title', '')) |
7161 |
- if rtitle2 and rtitle2 != rtitle and rtitle2 != title: |
7162 |
- trefs[rtitle2] = m |
7163 |
- if title != rtitle: |
7164 |
-@@ -663,7 +663,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7165 |
- for name in re_nameRef.findall(o): |
7166 |
- a_name = analyze_name(name, canonical=1) |
7167 |
- rname = build_name(a_name, canonical=1) |
7168 |
-- if nrefs.has_key(rname): continue |
7169 |
-+ if rname in nrefs: continue |
7170 |
- personID = self._getNameID(rname) |
7171 |
- if personID is None: |
7172 |
- personID = self._getNameID(name) |
7173 |
-@@ -671,7 +671,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7174 |
- p = Person(name=rname, personID=personID, |
7175 |
- accessSystem=self.accessSystem) |
7176 |
- nrefs[rname] = p |
7177 |
-- rname2 = normalizeName(a_name.get('name', u'')) |
7178 |
-+ rname2 = normalizeName(a_name.get('name', '')) |
7179 |
- if rname2 and rname2 != rname: |
7180 |
- nrefs[rname2] = p |
7181 |
- if name != rname and name != rname2: |
7182 |
-@@ -680,7 +680,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7183 |
- for item in o: |
7184 |
- self._findRefs(item, trefs, nrefs) |
7185 |
- elif isinstance(o, dict): |
7186 |
-- for value in o.values(): |
7187 |
-+ for value in list(o.values()): |
7188 |
- self._findRefs(value, trefs, nrefs) |
7189 |
- return (trefs, nrefs) |
7190 |
- |
7191 |
-@@ -690,7 +690,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7192 |
- nrefs = {} |
7193 |
- try: |
7194 |
- return self._findRefs(o, trefs, nrefs) |
7195 |
-- except RuntimeError, e: |
7196 |
-+ except RuntimeError as e: |
7197 |
- # Symbian/python 2.2 has a poor regexp implementation. |
7198 |
- import warnings |
7199 |
- warnings.warn('RuntimeError in ' |
7200 |
-@@ -716,7 +716,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7201 |
- try: |
7202 |
- lookup(e) |
7203 |
- lat1 = akatitle.encode('latin_1', 'replace') |
7204 |
-- return unicode(lat1, e, 'replace') |
7205 |
-+ return str(lat1, e, 'replace') |
7206 |
- except (LookupError, ValueError, TypeError): |
7207 |
- continue |
7208 |
- return None |
7209 |
-@@ -726,7 +726,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7210 |
- if val is None: |
7211 |
- return ISNULL(col) |
7212 |
- else: |
7213 |
-- if isinstance(val, (int, long)): |
7214 |
-+ if isinstance(val, int): |
7215 |
- return col == val |
7216 |
- else: |
7217 |
- return col == self.toUTF8(val) |
7218 |
-@@ -919,7 +919,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7219 |
- # s_title = s_title_rebuilt |
7220 |
- #else: |
7221 |
- # _episodes = False |
7222 |
-- if isinstance(s_title, unicode): |
7223 |
-+ if isinstance(s_title, str): |
7224 |
- s_title = s_title.encode('ascii', 'ignore') |
7225 |
- |
7226 |
- soundexCode = soundex(s_title) |
7227 |
-@@ -978,7 +978,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7228 |
- q2 = [(q.movieID, get_movie_data(q.id, self._kind, fromAka=1)) |
7229 |
- for q in AkaTitle.select(conditionAka)] |
7230 |
- qr += q2 |
7231 |
-- except NotFoundError, e: |
7232 |
-+ except NotFoundError as e: |
7233 |
- raise IMDbDataAccessError( \ |
7234 |
- 'unable to search the database: "%s"' % str(e)) |
7235 |
- |
7236 |
-@@ -1025,7 +1025,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7237 |
- infosets = self.get_movie_infoset() |
7238 |
- try: |
7239 |
- res = get_movie_data(movieID, self._kind) |
7240 |
-- except NotFoundError, e: |
7241 |
-+ except NotFoundError as e: |
7242 |
- raise IMDbDataAccessError( \ |
7243 |
- 'unable to get movieID "%s": "%s"' % (movieID, str(e))) |
7244 |
- if not res: |
7245 |
-@@ -1051,9 +1051,9 @@ class IMDbSqlAccessSystem(IMDbBase): |
7246 |
- curRole = robj.name |
7247 |
- curRoleID = robj.id |
7248 |
- p = Person(personID=pdata[0], name=pdata[5], |
7249 |
-- currentRole=curRole or u'', |
7250 |
-+ currentRole=curRole or '', |
7251 |
- roleID=curRoleID, |
7252 |
-- notes=pdata[2] or u'', |
7253 |
-+ notes=pdata[2] or '', |
7254 |
- accessSystem='sql') |
7255 |
- if pdata[6]: p['imdbIndex'] = pdata[6] |
7256 |
- p.billingPos = pdata[3] |
7257 |
-@@ -1088,7 +1088,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7258 |
- cDbTxt += ' %s' % cDb.countryCode |
7259 |
- company = Company(name=cDbTxt, |
7260 |
- companyID=mdata[1], |
7261 |
-- notes=mdata[2] or u'', |
7262 |
-+ notes=mdata[2] or '', |
7263 |
- accessSystem=self.accessSystem) |
7264 |
- res.setdefault(sect, []).append(company) |
7265 |
- # AKA titles. |
7266 |
-@@ -1108,8 +1108,8 @@ class IMDbSqlAccessSystem(IMDbBase): |
7267 |
- for cc in CompleteCast.select(CompleteCast.q.movieID == movieID)] |
7268 |
- if compcast: |
7269 |
- for entry in compcast: |
7270 |
-- val = unicode(entry[1]) |
7271 |
-- res[u'complete %s' % entry[0]] = val |
7272 |
-+ val = str(entry[1]) |
7273 |
-+ res['complete %s' % entry[0]] = val |
7274 |
- # Movie connections. |
7275 |
- mlinks = [[ml.linkedMovieID, self._link[ml.linkTypeID]] |
7276 |
- for ml in MovieLink.select(MovieLink.q.movieID == movieID)] |
7277 |
-@@ -1143,11 +1143,11 @@ class IMDbSqlAccessSystem(IMDbBase): |
7278 |
- if season not in episodes: episodes[season] = {} |
7279 |
- ep_number = episode_data.get('episode') |
7280 |
- if ep_number is None: |
7281 |
-- ep_number = max((episodes[season].keys() or [0])) + 1 |
7282 |
-+ ep_number = max((list(episodes[season].keys()) or [0])) + 1 |
7283 |
- episodes[season][ep_number] = m |
7284 |
- res['episodes'] = episodes |
7285 |
-- res['number of episodes'] = sum([len(x) for x in episodes.values()]) |
7286 |
-- res['number of seasons'] = len(episodes.keys()) |
7287 |
-+ res['number of episodes'] = sum([len(x) for x in list(episodes.values())]) |
7288 |
-+ res['number of seasons'] = len(list(episodes.keys())) |
7289 |
- # Regroup laserdisc information. |
7290 |
- res = _reGroupDict(res, self._moviesubs) |
7291 |
- # Do some transformation to preserve consistency with other |
7292 |
-@@ -1212,7 +1212,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7293 |
- if not name: return [] |
7294 |
- s_name = analyze_name(name)['name'] |
7295 |
- if not s_name: return [] |
7296 |
-- if isinstance(s_name, unicode): |
7297 |
-+ if isinstance(s_name, str): |
7298 |
- s_name = s_name.encode('ascii', 'ignore') |
7299 |
- soundexCode = soundex(s_name) |
7300 |
- name1, name2, name3 = nameVariations(name) |
7301 |
-@@ -1237,7 +1237,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7302 |
- q2 = [(q.personID, {'name': q.name, 'imdbIndex': q.imdbIndex}) |
7303 |
- for q in AkaName.select(conditionAka)] |
7304 |
- qr += q2 |
7305 |
-- except NotFoundError, e: |
7306 |
-+ except NotFoundError as e: |
7307 |
- raise IMDbDataAccessError( \ |
7308 |
- 'unable to search the database: "%s"' % str(e)) |
7309 |
- |
7310 |
-@@ -1278,7 +1278,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7311 |
- infosets = self.get_person_infoset() |
7312 |
- try: |
7313 |
- p = Name.get(personID) |
7314 |
-- except NotFoundError, e: |
7315 |
-+ except NotFoundError as e: |
7316 |
- raise IMDbDataAccessError( \ |
7317 |
- 'unable to get personID "%s": "%s"' % (personID, str(e))) |
7318 |
- res = {'name': p.name, 'imdbIndex': p.imdbIndex} |
7319 |
-@@ -1298,7 +1298,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7320 |
- for mdata in group: |
7321 |
- duty = orig_duty = group[0][3] |
7322 |
- if duty not in seenDuties: seenDuties.append(orig_duty) |
7323 |
-- note = mdata[2] or u'' |
7324 |
-+ note = mdata[2] or '' |
7325 |
- if 'episode of' in mdata[4]: |
7326 |
- duty = 'episodes' |
7327 |
- if orig_duty not in ('actor', 'actress'): |
7328 |
-@@ -1311,7 +1311,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7329 |
- curRole = robj.name |
7330 |
- curRoleID = robj.id |
7331 |
- m = Movie(movieID=mdata[0], data=mdata[4], |
7332 |
-- currentRole=curRole or u'', |
7333 |
-+ currentRole=curRole or '', |
7334 |
- roleID=curRoleID, |
7335 |
- notes=note, accessSystem='sql') |
7336 |
- if duty != 'episodes': |
7337 |
-@@ -1380,7 +1380,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7338 |
- if not name: return [] |
7339 |
- s_name = analyze_name(name)['name'] |
7340 |
- if not s_name: return [] |
7341 |
-- if isinstance(s_name, unicode): |
7342 |
-+ if isinstance(s_name, str): |
7343 |
- s_name = s_name.encode('ascii', 'ignore') |
7344 |
- s_name = normalizeName(s_name) |
7345 |
- soundexCode = soundex(s_name) |
7346 |
-@@ -1413,7 +1413,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7347 |
- try: |
7348 |
- qr = [(q.id, {'name': q.name, 'imdbIndex': q.imdbIndex}) |
7349 |
- for q in CharName.select(condition)] |
7350 |
-- except NotFoundError, e: |
7351 |
-+ except NotFoundError as e: |
7352 |
- raise IMDbDataAccessError( \ |
7353 |
- 'unable to search the database: "%s"' % str(e)) |
7354 |
- res = scan_names(qr, s_name, name2, '', results, |
7355 |
-@@ -1433,7 +1433,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7356 |
- infosets = self.get_character_infoset() |
7357 |
- try: |
7358 |
- c = CharName.get(characterID) |
7359 |
-- except NotFoundError, e: |
7360 |
-+ except NotFoundError as e: |
7361 |
- raise IMDbDataAccessError( \ |
7362 |
- 'unable to get characterID "%s": "%s"' % (characterID, e)) |
7363 |
- res = {'name': c.name, 'imdbIndex': c.imdbIndex} |
7364 |
-@@ -1452,12 +1452,12 @@ class IMDbSqlAccessSystem(IMDbBase): |
7365 |
- for f in filmodata: |
7366 |
- curRole = None |
7367 |
- curRoleID = f[1] |
7368 |
-- note = f[2] or u'' |
7369 |
-+ note = f[2] or '' |
7370 |
- if curRoleID is not None: |
7371 |
- robj = Name.get(curRoleID) |
7372 |
- curRole = robj.name |
7373 |
- m = Movie(movieID=f[0], data=f[3], |
7374 |
-- currentRole=curRole or u'', |
7375 |
-+ currentRole=curRole or '', |
7376 |
- roleID=curRoleID, roleIsPerson=True, |
7377 |
- notes=note, accessSystem='sql') |
7378 |
- fdata.append(m) |
7379 |
-@@ -1473,7 +1473,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7380 |
- def _search_company(self, name, results): |
7381 |
- name = name.strip() |
7382 |
- if not name: return [] |
7383 |
-- if isinstance(name, unicode): |
7384 |
-+ if isinstance(name, str): |
7385 |
- name = name.encode('ascii', 'ignore') |
7386 |
- soundexCode = soundex(name) |
7387 |
- # If the soundex is None, compare only with the first |
7388 |
-@@ -1488,7 +1488,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7389 |
- try: |
7390 |
- qr = [(q.id, {'name': q.name, 'country': q.countryCode}) |
7391 |
- for q in CompanyName.select(condition)] |
7392 |
-- except NotFoundError, e: |
7393 |
-+ except NotFoundError as e: |
7394 |
- raise IMDbDataAccessError( \ |
7395 |
- 'unable to search the database: "%s"' % str(e)) |
7396 |
- qr[:] = [(x[0], build_company_name(x[1])) for x in qr] |
7397 |
-@@ -1509,7 +1509,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7398 |
- infosets = self.get_company_infoset() |
7399 |
- try: |
7400 |
- c = CompanyName.get(companyID) |
7401 |
-- except NotFoundError, e: |
7402 |
-+ except NotFoundError as e: |
7403 |
- raise IMDbDataAccessError( \ |
7404 |
- 'unable to get companyID "%s": "%s"' % (companyID, e)) |
7405 |
- res = {'name': c.name, 'country': c.countryCode} |
7406 |
-@@ -1529,7 +1529,7 @@ class IMDbSqlAccessSystem(IMDbBase): |
7407 |
- ctype = group[0][2] |
7408 |
- for movieID, companyID, ctype, note, movieData in group: |
7409 |
- movie = Movie(data=movieData, movieID=movieID, |
7410 |
-- notes=note or u'', accessSystem=self.accessSystem) |
7411 |
-+ notes=note or '', accessSystem=self.accessSystem) |
7412 |
- res.setdefault(ctype, []).append(movie) |
7413 |
- res.get(ctype, []).sort() |
7414 |
- return {'data': res, 'info sets': infosets} |
7415 |
-diff --git a/imdb/parser/sql/alchemyadapter.py b/imdb/parser/sql/alchemyadapter.py |
7416 |
-index 9b5c79e..47e348e 100644 |
7417 |
---- a/imdb/parser/sql/alchemyadapter.py |
7418 |
-+++ b/imdb/parser/sql/alchemyadapter.py |
7419 |
-@@ -39,7 +39,7 @@ except ImportError: |
7420 |
- 'Keys will not be created.') |
7421 |
- |
7422 |
- from imdb._exceptions import IMDbDataAccessError |
7423 |
--from dbschema import * |
7424 |
-+from .dbschema import * |
7425 |
- |
7426 |
- # Used to convert table and column names. |
7427 |
- re_upper = re.compile(r'([A-Z])') |
7428 |
-@@ -128,7 +128,7 @@ class QAdapter(object): |
7429 |
- |
7430 |
- def __getattr__(self, name): |
7431 |
- try: return getattr(self.table.c, self.colMap[name]) |
7432 |
-- except KeyError, e: raise AttributeError("unable to get '%s'" % name) |
7433 |
-+ except KeyError as e: raise AttributeError("unable to get '%s'" % name) |
7434 |
- |
7435 |
- def __repr__(self): |
7436 |
- return '<QAdapter(table=%s, colMap=%s) [id=%s]>' % \ |
7437 |
-@@ -146,11 +146,11 @@ class RowAdapter(object): |
7438 |
- if colMap is None: |
7439 |
- colMap = {} |
7440 |
- self.colMap = colMap |
7441 |
-- self.colMapKeys = colMap.keys() |
7442 |
-+ self.colMapKeys = list(colMap.keys()) |
7443 |
- |
7444 |
- def __getattr__(self, name): |
7445 |
- try: return getattr(self.row, self.colMap[name]) |
7446 |
-- except KeyError, e: raise AttributeError("unable to get '%s'" % name) |
7447 |
-+ except KeyError as e: raise AttributeError("unable to get '%s'" % name) |
7448 |
- |
7449 |
- def __setattr__(self, name, value): |
7450 |
- # FIXME: I can't even think about how much performances suffer, |
7451 |
-@@ -339,7 +339,7 @@ class TableAdapter(object): |
7452 |
- # db-level. |
7453 |
- try: |
7454 |
- idx.create() |
7455 |
-- except exc.OperationalError, e: |
7456 |
-+ except exc.OperationalError as e: |
7457 |
- _alchemy_logger.warn('Skipping creation of the %s.%s index: %s' % |
7458 |
- (self.sqlmeta.table, col.name, e)) |
7459 |
- |
7460 |
-@@ -388,7 +388,7 @@ class TableAdapter(object): |
7461 |
- def __call__(self, *args, **kwds): |
7462 |
- """To insert a new row with the syntax: TableClass(key=value, ...)""" |
7463 |
- taArgs = {} |
7464 |
-- for key, value in kwds.items(): |
7465 |
-+ for key, value in list(kwds.items()): |
7466 |
- taArgs[self.colMap.get(key, key)] = value |
7467 |
- self._ta_insert.execute(*args, **taArgs) |
7468 |
- |
7469 |
-diff --git a/imdb/parser/sql/dbschema.py b/imdb/parser/sql/dbschema.py |
7470 |
-index 2f359fb..aa2a58c 100644 |
7471 |
---- a/imdb/parser/sql/dbschema.py |
7472 |
-+++ b/imdb/parser/sql/dbschema.py |
7473 |
-@@ -88,8 +88,8 @@ class DBCol(object): |
7474 |
- s += ', foreignKey="%s"' % self.foreignKey |
7475 |
- for param in self.params: |
7476 |
- val = self.params[param] |
7477 |
-- if isinstance(val, (unicode, str)): |
7478 |
-- val = u'"%s"' % val |
7479 |
-+ if isinstance(val, str): |
7480 |
-+ val = '"%s"' % val |
7481 |
- s += ', %s=%s' % (param, val) |
7482 |
- s += ')>' |
7483 |
- return s |
7484 |
-@@ -106,7 +106,7 @@ class DBTable(object): |
7485 |
- def __str__(self): |
7486 |
- """Class representation.""" |
7487 |
- return '<DBTable %s (%d cols, %d values)>' % (self.name, |
7488 |
-- len(self.cols), sum([len(v) for v in self.values.values()])) |
7489 |
-+ len(self.cols), sum([len(v) for v in list(self.values.values())])) |
7490 |
- |
7491 |
- def __repr__(self): |
7492 |
- """Class representation.""" |
7493 |
-@@ -441,7 +441,7 @@ def createTables(tables, ifNotExists=True): |
7494 |
- table._imdbpyName) |
7495 |
- for key in table._imdbpySchema.values: |
7496 |
- for value in table._imdbpySchema.values[key]: |
7497 |
-- table(**{key: unicode(value)}) |
7498 |
-+ table(**{key: str(value)}) |
7499 |
- |
7500 |
- def createIndexes(tables, ifNotExists=True): |
7501 |
- """Create the indexes in the database. |
7502 |
-@@ -452,7 +452,7 @@ def createIndexes(tables, ifNotExists=True): |
7503 |
- table._imdbpyName) |
7504 |
- try: |
7505 |
- table.addIndexes(ifNotExists) |
7506 |
-- except Exception, e: |
7507 |
-+ except Exception as e: |
7508 |
- errors.append(e) |
7509 |
- continue |
7510 |
- return errors |
7511 |
-@@ -469,7 +469,7 @@ def createForeignKeys(tables, ifNotExists=True): |
7512 |
- table._imdbpyName) |
7513 |
- try: |
7514 |
- table.addForeignKeys(mapTables, ifNotExists) |
7515 |
-- except Exception, e: |
7516 |
-+ except Exception as e: |
7517 |
- errors.append(e) |
7518 |
- continue |
7519 |
- return errors |
7520 |
-diff --git a/imdb/parser/sql/objectadapter.py b/imdb/parser/sql/objectadapter.py |
7521 |
-index 9797104..ddc1676 100644 |
7522 |
---- a/imdb/parser/sql/objectadapter.py |
7523 |
-+++ b/imdb/parser/sql/objectadapter.py |
7524 |
-@@ -26,7 +26,7 @@ import logging |
7525 |
- from sqlobject import * |
7526 |
- from sqlobject.sqlbuilder import ISNULL, ISNOTNULL, AND, OR, IN, CONTAINSSTRING |
7527 |
- |
7528 |
--from dbschema import * |
7529 |
-+from .dbschema import * |
7530 |
- |
7531 |
- _object_logger = logging.getLogger('imdbpy.parser.sql.object') |
7532 |
- |
7533 |
-@@ -59,7 +59,7 @@ def addIndexes(cls, ifNotExists=True): |
7534 |
- cls.sqlmeta.addIndex(idx) |
7535 |
- try: |
7536 |
- cls.createIndexes(ifNotExists) |
7537 |
-- except dberrors.OperationalError, e: |
7538 |
-+ except dberrors.OperationalError as e: |
7539 |
- _object_logger.warn('Skipping creation of the %s.%s index: %s' % |
7540 |
- (cls.sqlmeta.table, col.name, e)) |
7541 |
- addIndexes = classmethod(addIndexes) |
7542 |
-@@ -105,7 +105,7 @@ def _buildFakeFKTable(cls, fakeTableName): |
7543 |
- def addForeignKeys(cls, mapTables, ifNotExists=True): |
7544 |
- """Create all required foreign keys.""" |
7545 |
- # Do not even try, if there are no FK, in this table. |
7546 |
-- if not filter(None, [col.foreignKey for col in cls._imdbpySchema.cols]): |
7547 |
-+ if not [_f for _f in [col.foreignKey for col in cls._imdbpySchema.cols] if _f]: |
7548 |
- return |
7549 |
- fakeTableName = 'myfaketable%s' % cls.sqlmeta.table |
7550 |
- if fakeTableName in FAKE_TABLES_REPOSITORY: |
7551 |
-diff --git a/imdb/utils.py b/imdb/utils.py |
7552 |
-index 9c300b0..7ddcb68 100644 |
7553 |
---- a/imdb/utils.py |
7554 |
-+++ b/imdb/utils.py |
7555 |
-@@ -21,7 +21,7 @@ along with this program; if not, write to the Free Software |
7556 |
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
7557 |
- """ |
7558 |
- |
7559 |
--from __future__ import generators |
7560 |
-+ |
7561 |
- import re |
7562 |
- import string |
7563 |
- import logging |
7564 |
-@@ -73,11 +73,11 @@ def canonicalName(name): |
7565 |
- # - Jr.: 8025 |
7566 |
- # Don't convert names already in the canonical format. |
7567 |
- if name.find(', ') != -1: return name |
7568 |
-- if isinstance(name, unicode): |
7569 |
-- joiner = u'%s, %s' |
7570 |
-- sur_joiner = u'%s %s' |
7571 |
-- sur_space = u' %s' |
7572 |
-- space = u' ' |
7573 |
-+ if isinstance(name, str): |
7574 |
-+ joiner = '%s, %s' |
7575 |
-+ sur_joiner = '%s %s' |
7576 |
-+ sur_space = ' %s' |
7577 |
-+ space = ' ' |
7578 |
- else: |
7579 |
- joiner = '%s, %s' |
7580 |
- sur_joiner = '%s %s' |
7581 |
-@@ -117,8 +117,8 @@ def canonicalName(name): |
7582 |
- |
7583 |
- def normalizeName(name): |
7584 |
- """Return a name in the normal "Name Surname" format.""" |
7585 |
-- if isinstance(name, unicode): |
7586 |
-- joiner = u'%s %s' |
7587 |
-+ if isinstance(name, str): |
7588 |
-+ joiner = '%s %s' |
7589 |
- else: |
7590 |
- joiner = '%s %s' |
7591 |
- sname = name.split(', ') |
7592 |
-@@ -195,7 +195,7 @@ def canonicalTitle(title, lang=None): |
7593 |
- title portion, without year[/imdbIndex] or special markup. |
7594 |
- The 'lang' argument can be used to specify the language of the title. |
7595 |
- """ |
7596 |
-- isUnicode = isinstance(title, unicode) |
7597 |
-+ isUnicode = isinstance(title, str) |
7598 |
- articlesDicts = linguistics.articlesDictsForLang(lang) |
7599 |
- try: |
7600 |
- if title.split(', ')[-1].lower() in articlesDicts[isUnicode]: |
7601 |
-@@ -203,7 +203,7 @@ def canonicalTitle(title, lang=None): |
7602 |
- except IndexError: |
7603 |
- pass |
7604 |
- if isUnicode: |
7605 |
-- _format = u'%s, %s' |
7606 |
-+ _format = '%s, %s' |
7607 |
- else: |
7608 |
- _format = '%s, %s' |
7609 |
- ltitle = title.lower() |
7610 |
-@@ -234,7 +234,7 @@ def normalizeTitle(title, lang=None): |
7611 |
- title portion, without year[/imdbIndex] or special markup. |
7612 |
- The 'lang' argument can be used to specify the language of the title. |
7613 |
- """ |
7614 |
-- isUnicode = isinstance(title, unicode) |
7615 |
-+ isUnicode = isinstance(title, str) |
7616 |
- stitle = title.split(', ') |
7617 |
- articlesDicts = linguistics.articlesDictsForLang(lang) |
7618 |
- if len(stitle) > 1 and stitle[-1].lower() in articlesDicts[isUnicode]: |
7619 |
-@@ -242,8 +242,8 @@ def normalizeTitle(title, lang=None): |
7620 |
- if stitle[-1][-1] in ("'", '-'): |
7621 |
- sep = '' |
7622 |
- if isUnicode: |
7623 |
-- _format = u'%s%s%s' |
7624 |
-- _joiner = u', ' |
7625 |
-+ _format = '%s%s%s' |
7626 |
-+ _joiner = ', ' |
7627 |
- else: |
7628 |
- _format = '%s%s%s' |
7629 |
- _joiner = ', ' |
7630 |
-@@ -298,7 +298,7 @@ def is_series_episode(title): |
7631 |
- |
7632 |
- |
7633 |
- def analyze_title(title, canonical=None, canonicalSeries=None, |
7634 |
-- canonicalEpisode=None, _emptyString=u''): |
7635 |
-+ canonicalEpisode=None, _emptyString=''): |
7636 |
- """Analyze the given title and return a dictionary with the |
7637 |
- "stripped" title, the kind of the show ("movie", "tv series", etc.), |
7638 |
- the year of production and the optional imdbIndex (a roman number |
7639 |
-@@ -352,7 +352,7 @@ def analyze_title(title, canonical=None, canonicalSeries=None, |
7640 |
- except (TypeError, ValueError): |
7641 |
- pass |
7642 |
- episode_d = analyze_title(episode_or_year, canonical=canonicalEpisode) |
7643 |
-- episode_d['kind'] = u'episode' |
7644 |
-+ episode_d['kind'] = 'episode' |
7645 |
- episode_d['episode of'] = series_d |
7646 |
- if oad: |
7647 |
- episode_d['original air date'] = oad[1:-1] |
7648 |
-@@ -381,19 +381,19 @@ def analyze_title(title, canonical=None, canonicalSeries=None, |
7649 |
- # video game: 5,490 |
7650 |
- # More up-to-date statistics: http://us.imdb.com/database_statistics |
7651 |
- if title.endswith('(TV)'): |
7652 |
-- kind = u'tv movie' |
7653 |
-+ kind = 'tv movie' |
7654 |
- title = title[:-4].rstrip() |
7655 |
- elif title.endswith('(V)'): |
7656 |
-- kind = u'video movie' |
7657 |
-+ kind = 'video movie' |
7658 |
- title = title[:-3].rstrip() |
7659 |
- elif title.endswith('(video)'): |
7660 |
-- kind = u'video movie' |
7661 |
-+ kind = 'video movie' |
7662 |
- title = title[:-7].rstrip() |
7663 |
- elif title.endswith('(mini)'): |
7664 |
-- kind = u'tv mini series' |
7665 |
-+ kind = 'tv mini series' |
7666 |
- title = title[:-6].rstrip() |
7667 |
- elif title.endswith('(VG)'): |
7668 |
-- kind = u'video game' |
7669 |
-+ kind = 'video game' |
7670 |
- title = title[:-4].rstrip() |
7671 |
- # Search for the year and the optional imdbIndex (a roman number). |
7672 |
- yi = re_year_index.findall(title) |
7673 |
-@@ -403,17 +403,17 @@ def analyze_title(title, canonical=None, canonicalSeries=None, |
7674 |
- yk, yiy, yii = yi[-1] |
7675 |
- yi = [(yiy, yii)] |
7676 |
- if yk == 'TV episode': |
7677 |
-- kind = u'episode' |
7678 |
-+ kind = 'episode' |
7679 |
- elif yk == 'TV': |
7680 |
-- kind = u'tv movie' |
7681 |
-+ kind = 'tv movie' |
7682 |
- elif yk == 'TV Series': |
7683 |
-- kind = u'tv series' |
7684 |
-+ kind = 'tv series' |
7685 |
- elif yk == 'Video': |
7686 |
-- kind = u'video movie' |
7687 |
-+ kind = 'video movie' |
7688 |
- elif yk == 'TV mini-series': |
7689 |
-- kind = u'tv mini series' |
7690 |
-+ kind = 'tv mini series' |
7691 |
- elif yk == 'Video Game': |
7692 |
-- kind = u'video game' |
7693 |
-+ kind = 'video game' |
7694 |
- title = re_remove_kind.sub('(', title) |
7695 |
- if yi: |
7696 |
- last_yi = yi[-1] |
7697 |
-@@ -428,10 +428,10 @@ def analyze_title(title, canonical=None, canonicalSeries=None, |
7698 |
- # XXX: strip('"') is not used for compatibility with Python 2.0. |
7699 |
- if title and title[0] == title[-1] == '"': |
7700 |
- if not kind: |
7701 |
-- kind = u'tv series' |
7702 |
-+ kind = 'tv series' |
7703 |
- title = title[1:-1].strip() |
7704 |
- elif title.endswith('(TV series)'): |
7705 |
-- kind = u'tv series' |
7706 |
-+ kind = 'tv series' |
7707 |
- title = title[:-11].rstrip() |
7708 |
- if not title: |
7709 |
- raise IMDbParserError('invalid title: "%s"' % original_t) |
7710 |
-@@ -443,7 +443,7 @@ def analyze_title(title, canonical=None, canonicalSeries=None, |
7711 |
- # 'kind' is one in ('movie', 'episode', 'tv series', 'tv mini series', |
7712 |
- # 'tv movie', 'video movie', 'video game') |
7713 |
- result['title'] = title |
7714 |
-- result['kind'] = kind or u'movie' |
7715 |
-+ result['kind'] = kind or 'movie' |
7716 |
- if year and year != '????': |
7717 |
- if '-' in year: |
7718 |
- result['series years'] = year |
7719 |
-@@ -461,7 +461,7 @@ def analyze_title(title, canonical=None, canonicalSeries=None, |
7720 |
- |
7721 |
- _web_format = '%d %B %Y' |
7722 |
- _ptdf_format = '(%Y-%m-%d)' |
7723 |
--def _convertTime(title, fromPTDFtoWEB=1, _emptyString=u''): |
7724 |
-+def _convertTime(title, fromPTDFtoWEB=1, _emptyString=''): |
7725 |
- """Convert a time expressed in the pain text data files, to |
7726 |
- the 'Episode dated ...' format used on the web site; if |
7727 |
- fromPTDFtoWEB is false, the inverted conversion is applied.""" |
7728 |
-@@ -470,13 +470,13 @@ def _convertTime(title, fromPTDFtoWEB=1, _emptyString=u''): |
7729 |
- from_format = _ptdf_format |
7730 |
- to_format = _web_format |
7731 |
- else: |
7732 |
-- from_format = u'Episode dated %s' % _web_format |
7733 |
-+ from_format = 'Episode dated %s' % _web_format |
7734 |
- to_format = _ptdf_format |
7735 |
- t = strptime(title, from_format) |
7736 |
- title = strftime(to_format, t) |
7737 |
- if fromPTDFtoWEB: |
7738 |
- if title[0] == '0': title = title[1:] |
7739 |
-- title = u'Episode dated %s' % title |
7740 |
-+ title = 'Episode dated %s' % title |
7741 |
- except ValueError: |
7742 |
- pass |
7743 |
- if isinstance(_emptyString, str): |
7744 |
-@@ -489,7 +489,7 @@ def _convertTime(title, fromPTDFtoWEB=1, _emptyString=u''): |
7745 |
- |
7746 |
- def build_title(title_dict, canonical=None, canonicalSeries=None, |
7747 |
- canonicalEpisode=None, ptdf=0, lang=None, _doYear=1, |
7748 |
-- _emptyString=u''): |
7749 |
-+ _emptyString=''): |
7750 |
- """Given a dictionary that represents a "long" IMDb title, |
7751 |
- return a string. |
7752 |
- |
7753 |
-@@ -555,11 +555,11 @@ def build_title(title_dict, canonical=None, canonicalSeries=None, |
7754 |
- title = normalizeTitle(title, lang=lang) |
7755 |
- if pre_title: |
7756 |
- title = '%s %s' % (pre_title, title) |
7757 |
-- if kind in (u'tv series', u'tv mini series'): |
7758 |
-+ if kind in ('tv series', 'tv mini series'): |
7759 |
- title = '"%s"' % title |
7760 |
- if _doYear: |
7761 |
- imdbIndex = title_dict.get('imdbIndex') |
7762 |
-- year = title_dict.get('year') or u'????' |
7763 |
-+ year = title_dict.get('year') or '????' |
7764 |
- if isinstance(_emptyString, str): |
7765 |
- year = str(year) |
7766 |
- title += ' (%s' % year |
7767 |
-@@ -582,7 +582,7 @@ def split_company_name_notes(name): |
7768 |
- """Return two strings, the first representing the company name, |
7769 |
- and the other representing the (optional) notes.""" |
7770 |
- name = name.strip() |
7771 |
-- notes = u'' |
7772 |
-+ notes = '' |
7773 |
- if name.endswith(')'): |
7774 |
- fpidx = name.find('(') |
7775 |
- if fpidx != -1: |
7776 |
-@@ -616,7 +616,7 @@ def analyze_company_name(name, stripNotes=False): |
7777 |
- return result |
7778 |
- |
7779 |
- |
7780 |
--def build_company_name(name_dict, _emptyString=u''): |
7781 |
-+def build_company_name(name_dict, _emptyString=''): |
7782 |
- """Given a dictionary that represents a "long" IMDb company name, |
7783 |
- return a string. |
7784 |
- """ |
7785 |
-@@ -770,15 +770,15 @@ def modifyStrings(o, modFunct, titlesRefs, namesRefs, charactersRefs): |
7786 |
- in a list), using the provided modFunct function and titlesRefs |
7787 |
- namesRefs and charactersRefs references dictionaries.""" |
7788 |
- # Notice that it doesn't go any deeper than the first two levels in a list. |
7789 |
-- if isinstance(o, (unicode, str)): |
7790 |
-+ if isinstance(o, str): |
7791 |
- return modFunct(o, titlesRefs, namesRefs, charactersRefs) |
7792 |
- elif isinstance(o, (list, tuple, dict)): |
7793 |
- _stillorig = 1 |
7794 |
-- if isinstance(o, (list, tuple)): keys = xrange(len(o)) |
7795 |
-- else: keys = o.keys() |
7796 |
-+ if isinstance(o, (list, tuple)): keys = range(len(o)) |
7797 |
-+ else: keys = list(o.keys()) |
7798 |
- for i in keys: |
7799 |
- v = o[i] |
7800 |
-- if isinstance(v, (unicode, str)): |
7801 |
-+ if isinstance(v, str): |
7802 |
- if _stillorig: |
7803 |
- o = copy(o) |
7804 |
- _stillorig = 0 |
7805 |
-@@ -793,8 +793,8 @@ def date_and_notes(s): |
7806 |
- """Parse (birth|death) date and notes; returns a tuple in the |
7807 |
- form (date, notes).""" |
7808 |
- s = s.strip() |
7809 |
-- if not s: return (u'', u'') |
7810 |
-- notes = u'' |
7811 |
-+ if not s: return ('', '') |
7812 |
-+ notes = '' |
7813 |
- if s[0].isdigit() or s.split()[0].lower() in ('c.', 'january', 'february', |
7814 |
- 'march', 'april', 'may', 'june', |
7815 |
- 'july', 'august', 'september', |
7816 |
-@@ -807,8 +807,8 @@ def date_and_notes(s): |
7817 |
- s = s[:i] |
7818 |
- else: |
7819 |
- notes = s |
7820 |
-- s = u'' |
7821 |
-- if s == '????': s = u'' |
7822 |
-+ s = '' |
7823 |
-+ if s == '????': s = '' |
7824 |
- return s, notes |
7825 |
- |
7826 |
- |
7827 |
-@@ -816,12 +816,12 @@ class RolesList(list): |
7828 |
- """A list of Person or Character instances, used for the currentRole |
7829 |
- property.""" |
7830 |
- def __unicode__(self): |
7831 |
-- return u' / '.join([unicode(x) for x in self]) |
7832 |
-+ return ' / '.join([str(x) for x in self]) |
7833 |
- |
7834 |
- def __str__(self): |
7835 |
- # FIXME: does it make sense at all? Return a unicode doesn't |
7836 |
- # seem right, in __str__. |
7837 |
-- return u' / '.join([unicode(x).encode('utf8') for x in self]) |
7838 |
-+ return ' / '.join([str(x).encode('utf8') for x in self]) |
7839 |
- |
7840 |
- |
7841 |
- # Replace & with &, but only if it's not already part of a charref. |
7842 |
-@@ -836,7 +836,7 @@ def escape4xml(value): |
7843 |
- value = _re_amp.sub('&', value) |
7844 |
- value = value.replace('"', '"').replace("'", ''') |
7845 |
- value = value.replace('<', '<').replace('>', '>') |
7846 |
-- if isinstance(value, unicode): |
7847 |
-+ if isinstance(value, str): |
7848 |
- value = value.encode('ascii', 'xmlcharrefreplace') |
7849 |
- return value |
7850 |
- |
7851 |
-@@ -847,9 +847,9 @@ def _refsToReplace(value, modFunct, titlesRefs, namesRefs, charactersRefs): |
7852 |
- by the user-provided modFunct function, the second is the same |
7853 |
- reference un-escaped.""" |
7854 |
- mRefs = [] |
7855 |
-- for refRe, refTemplate in [(re_titleRef, u'_%s_ (qv)'), |
7856 |
-- (re_nameRef, u"'%s' (qv)"), |
7857 |
-- (re_characterRef, u'#%s# (qv)')]: |
7858 |
-+ for refRe, refTemplate in [(re_titleRef, '_%s_ (qv)'), |
7859 |
-+ (re_nameRef, "'%s' (qv)"), |
7860 |
-+ (re_characterRef, '#%s# (qv)')]: |
7861 |
- theseRefs = [] |
7862 |
- for theRef in refRe.findall(value): |
7863 |
- # refTemplate % theRef values don't change for a single |
7864 |
-@@ -877,7 +877,7 @@ def _handleTextNotes(s): |
7865 |
- ssplit = s.split('::', 1) |
7866 |
- if len(ssplit) == 1: |
7867 |
- return s |
7868 |
-- return u'%s<notes>%s</notes>' % (ssplit[0], ssplit[1]) |
7869 |
-+ return '%s<notes>%s</notes>' % (ssplit[0], ssplit[1]) |
7870 |
- |
7871 |
- |
7872 |
- def _normalizeValue(value, withRefs=False, modFunct=None, titlesRefs=None, |
7873 |
-@@ -885,7 +885,7 @@ def _normalizeValue(value, withRefs=False, modFunct=None, titlesRefs=None, |
7874 |
- """Replace some chars that can't be present in a XML text.""" |
7875 |
- # XXX: use s.encode(encoding, 'xmlcharrefreplace') ? Probably not |
7876 |
- # a great idea: after all, returning a unicode is safe. |
7877 |
-- if isinstance(value, (unicode, str)): |
7878 |
-+ if isinstance(value, str): |
7879 |
- if not withRefs: |
7880 |
- value = _handleTextNotes(escape4xml(value)) |
7881 |
- else: |
7882 |
-@@ -899,7 +899,7 @@ def _normalizeValue(value, withRefs=False, modFunct=None, titlesRefs=None, |
7883 |
- for toReplace, replaceWith in replaceList: |
7884 |
- value = value.replace(toReplace, replaceWith) |
7885 |
- else: |
7886 |
-- value = unicode(value) |
7887 |
-+ value = str(value) |
7888 |
- return value |
7889 |
- |
7890 |
- |
7891 |
-@@ -914,7 +914,7 @@ def _tag4TON(ton, addAccessSystem=False, _containerOnly=False): |
7892 |
- else: |
7893 |
- value = ton.get('long imdb name') or ton.get('name', '') |
7894 |
- value = _normalizeValue(value) |
7895 |
-- extras = u'' |
7896 |
-+ extras = '' |
7897 |
- crl = ton.currentRole |
7898 |
- if crl: |
7899 |
- if not isinstance(crl, list): |
7900 |
-@@ -925,33 +925,33 @@ def _tag4TON(ton, addAccessSystem=False, _containerOnly=False): |
7901 |
- crValue = _normalizeValue(crValue) |
7902 |
- crID = cr.getID() |
7903 |
- if crID is not None: |
7904 |
-- extras += u'<current-role><%s id="%s">' \ |
7905 |
-- u'<name>%s</name></%s>' % (crTag, crID, |
7906 |
-+ extras += '<current-role><%s id="%s">' \ |
7907 |
-+ '<name>%s</name></%s>' % (crTag, crID, |
7908 |
- crValue, crTag) |
7909 |
- else: |
7910 |
-- extras += u'<current-role><%s><name>%s</name></%s>' % \ |
7911 |
-+ extras += '<current-role><%s><name>%s</name></%s>' % \ |
7912 |
- (crTag, crValue, crTag) |
7913 |
- if cr.notes: |
7914 |
-- extras += u'<notes>%s</notes>' % _normalizeValue(cr.notes) |
7915 |
-- extras += u'</current-role>' |
7916 |
-+ extras += '<notes>%s</notes>' % _normalizeValue(cr.notes) |
7917 |
-+ extras += '</current-role>' |
7918 |
- theID = ton.getID() |
7919 |
- if theID is not None: |
7920 |
-- beginTag = u'<%s id="%s"' % (tag, theID) |
7921 |
-+ beginTag = '<%s id="%s"' % (tag, theID) |
7922 |
- if addAccessSystem and ton.accessSystem: |
7923 |
- beginTag += ' access-system="%s"' % ton.accessSystem |
7924 |
- if not _containerOnly: |
7925 |
-- beginTag += u'><%s>%s</%s>' % (what, value, what) |
7926 |
-+ beginTag += '><%s>%s</%s>' % (what, value, what) |
7927 |
- else: |
7928 |
-- beginTag += u'>' |
7929 |
-+ beginTag += '>' |
7930 |
- else: |
7931 |
- if not _containerOnly: |
7932 |
-- beginTag = u'<%s><%s>%s</%s>' % (tag, what, value, what) |
7933 |
-+ beginTag = '<%s><%s>%s</%s>' % (tag, what, value, what) |
7934 |
- else: |
7935 |
-- beginTag = u'<%s>' % tag |
7936 |
-+ beginTag = '<%s>' % tag |
7937 |
- beginTag += extras |
7938 |
- if ton.notes: |
7939 |
-- beginTag += u'<notes>%s</notes>' % _normalizeValue(ton.notes) |
7940 |
-- return (beginTag, u'</%s>' % tag) |
7941 |
-+ beginTag += '<notes>%s</notes>' % _normalizeValue(ton.notes) |
7942 |
-+ return (beginTag, '</%s>' % tag) |
7943 |
- |
7944 |
- |
7945 |
- TAGS_TO_MODIFY = { |
7946 |
-@@ -986,13 +986,13 @@ def _tagAttr(key, fullpath): |
7947 |
- tagName, useTitle = TAGS_TO_MODIFY[fullpath] |
7948 |
- if useTitle: |
7949 |
- attrs['key'] = _escapedKey |
7950 |
-- elif not isinstance(key, unicode): |
7951 |
-+ elif not isinstance(key, str): |
7952 |
- if isinstance(key, str): |
7953 |
-- tagName = unicode(key, 'ascii', 'ignore') |
7954 |
-+ tagName = str(key, 'ascii', 'ignore') |
7955 |
- else: |
7956 |
- strType = str(type(key)).replace("<type '", "").replace("'>", "") |
7957 |
- attrs['keytype'] = strType |
7958 |
-- tagName = unicode(key) |
7959 |
-+ tagName = str(key) |
7960 |
- else: |
7961 |
- tagName = key |
7962 |
- if isinstance(key, int): |
7963 |
-@@ -1011,7 +1011,7 @@ def _tagAttr(key, fullpath): |
7964 |
- tagName = 'item' |
7965 |
- _utils_logger.error('invalid tag: %s [%s]' % (_escapedKey, fullpath)) |
7966 |
- attrs['key'] = _escapedKey |
7967 |
-- return tagName, u' '.join([u'%s="%s"' % i for i in attrs.items()]) |
7968 |
-+ return tagName, ' '.join(['%s="%s"' % i for i in list(attrs.items())]) |
7969 |
- |
7970 |
- |
7971 |
- def _seq2xml(seq, _l=None, withRefs=False, modFunct=None, |
7972 |
-@@ -1032,17 +1032,17 @@ def _seq2xml(seq, _l=None, withRefs=False, modFunct=None, |
7973 |
- tagName = key.__class__.__name__.lower() |
7974 |
- else: |
7975 |
- tagName, attrs = _tagAttr(key, fullpath) |
7976 |
-- openTag = u'<%s' % tagName |
7977 |
-+ openTag = '<%s' % tagName |
7978 |
- if attrs: |
7979 |
- openTag += ' %s' % attrs |
7980 |
- if _topLevel and key2infoset and key in key2infoset: |
7981 |
-- openTag += u' infoset="%s"' % key2infoset[key] |
7982 |
-+ openTag += ' infoset="%s"' % key2infoset[key] |
7983 |
- if isinstance(value, int): |
7984 |
- openTag += ' type="int"' |
7985 |
- elif isinstance(value, float): |
7986 |
- openTag += ' type="float"' |
7987 |
-- openTag += u'>' |
7988 |
-- closeTag = u'</%s>' % tagName |
7989 |
-+ openTag += '>' |
7990 |
-+ closeTag = '</%s>' % tagName |
7991 |
- _l.append(openTag) |
7992 |
- _seq2xml(value, _l, withRefs, modFunct, titlesRefs, |
7993 |
- namesRefs, charactersRefs, _topLevel=False, |
7994 |
-@@ -1050,11 +1050,11 @@ def _seq2xml(seq, _l=None, withRefs=False, modFunct=None, |
7995 |
- _l.append(closeTag) |
7996 |
- elif isinstance(seq, (list, tuple)): |
7997 |
- tagName, attrs = _tagAttr('item', fullpath) |
7998 |
-- beginTag = u'<%s' % tagName |
7999 |
-+ beginTag = '<%s' % tagName |
8000 |
- if attrs: |
8001 |
-- beginTag += u' %s' % attrs |
8002 |
-+ beginTag += ' %s' % attrs |
8003 |
- #beginTag += u'>' |
8004 |
-- closeTag = u'</%s>' % tagName |
8005 |
-+ closeTag = '</%s>' % tagName |
8006 |
- for item in seq: |
8007 |
- if isinstance(item, _Container): |
8008 |
- _seq2xml(item, _l, withRefs, modFunct, titlesRefs, |
8009 |
-@@ -1067,7 +1067,7 @@ def _seq2xml(seq, _l=None, withRefs=False, modFunct=None, |
8010 |
- openTag += ' type="int"' |
8011 |
- elif isinstance(item, float): |
8012 |
- openTag += ' type="float"' |
8013 |
-- openTag += u'>' |
8014 |
-+ openTag += '>' |
8015 |
- _l.append(openTag) |
8016 |
- _seq2xml(item, _l, withRefs, modFunct, titlesRefs, |
8017 |
- namesRefs, charactersRefs, _topLevel=False, |
8018 |
-@@ -1086,7 +1086,7 @@ def _seq2xml(seq, _l=None, withRefs=False, modFunct=None, |
8019 |
- return _l |
8020 |
- |
8021 |
- |
8022 |
--_xmlHead = u"""<?xml version="1.0"?> |
8023 |
-+_xmlHead = """<?xml version="1.0"?> |
8024 |
- <!DOCTYPE %s SYSTEM "http://imdbpy.sf.net/dtd/imdbpy{VERSION}.dtd"> |
8025 |
- |
8026 |
- """ |
8027 |
-@@ -1111,8 +1111,8 @@ class _Container(object): |
8028 |
- # Regular expression used to build the 'full-size (headshot|cover url)'. |
8029 |
- _re_fullsizeURL = re.compile(r'\._V1\._SX(\d+)_SY(\d+)_') |
8030 |
- |
8031 |
-- def __init__(self, myID=None, data=None, notes=u'', |
8032 |
-- currentRole=u'', roleID=None, roleIsPerson=False, |
8033 |
-+ def __init__(self, myID=None, data=None, notes='', |
8034 |
-+ currentRole='', roleID=None, roleIsPerson=False, |
8035 |
- accessSystem=None, titlesRefs=None, namesRefs=None, |
8036 |
- charactersRefs=None, modFunct=None, *args, **kwds): |
8037 |
- """Initialize a Movie, Person, Character or Company object. |
8038 |
-@@ -1199,12 +1199,12 @@ class _Container(object): |
8039 |
- """Return a Character or Person instance.""" |
8040 |
- if self.__role: |
8041 |
- return self.__role |
8042 |
-- return self._roleClass(name=u'', accessSystem=self.accessSystem, |
8043 |
-+ return self._roleClass(name='', accessSystem=self.accessSystem, |
8044 |
- modFunct=self.modFunct) |
8045 |
- |
8046 |
- def _set_currentRole(self, role): |
8047 |
- """Set self.currentRole to a Character or Person instance.""" |
8048 |
-- if isinstance(role, (unicode, str)): |
8049 |
-+ if isinstance(role, str): |
8050 |
- if not role: |
8051 |
- self.__role = None |
8052 |
- else: |
8053 |
-@@ -1213,7 +1213,7 @@ class _Container(object): |
8054 |
- elif isinstance(role, (list, tuple)): |
8055 |
- self.__role = RolesList() |
8056 |
- for item in role: |
8057 |
-- if isinstance(item, (unicode, str)): |
8058 |
-+ if isinstance(item, str): |
8059 |
- self.__role.append(self._roleClass(name=item, |
8060 |
- accessSystem=self.accessSystem, |
8061 |
- modFunct=self.modFunct)) |
8062 |
-@@ -1234,7 +1234,7 @@ class _Container(object): |
8063 |
- """Reset the object.""" |
8064 |
- self.data = {} |
8065 |
- self.myID = None |
8066 |
-- self.notes = u'' |
8067 |
-+ self.notes = '' |
8068 |
- self.titlesRefs = {} |
8069 |
- self.namesRefs = {} |
8070 |
- self.charactersRefs = {} |
8071 |
-@@ -1250,7 +1250,7 @@ class _Container(object): |
8072 |
- def clear(self): |
8073 |
- """Reset the dictionary.""" |
8074 |
- self.data.clear() |
8075 |
-- self.notes = u'' |
8076 |
-+ self.notes = '' |
8077 |
- self.titlesRefs = {} |
8078 |
- self.namesRefs = {} |
8079 |
- self.charactersRefs = {} |
8080 |
-@@ -1393,7 +1393,7 @@ class _Container(object): |
8081 |
- if value is None: |
8082 |
- return None |
8083 |
- tag = self.__class__.__name__.lower() |
8084 |
-- return u''.join(_seq2xml({key: value}, withRefs=withRefs, |
8085 |
-+ return ''.join(_seq2xml({key: value}, withRefs=withRefs, |
8086 |
- modFunct=origModFunct, |
8087 |
- titlesRefs=self.titlesRefs, |
8088 |
- namesRefs=self.namesRefs, |
8089 |
-@@ -1409,14 +1409,14 @@ class _Container(object): |
8090 |
- beginTag, endTag = _tag4TON(self, addAccessSystem=True, |
8091 |
- _containerOnly=True) |
8092 |
- resList = [beginTag] |
8093 |
-- for key in self.keys(): |
8094 |
-+ for key in list(self.keys()): |
8095 |
- value = self.getAsXML(key, _with_add_keys=_with_add_keys) |
8096 |
- if not value: |
8097 |
- continue |
8098 |
- resList.append(value) |
8099 |
- resList.append(endTag) |
8100 |
- head = _xmlHead % self.__class__.__name__.lower() |
8101 |
-- return head + u''.join(resList) |
8102 |
-+ return head + ''.join(resList) |
8103 |
- |
8104 |
- def _getitem(self, key): |
8105 |
- """Handle special keys.""" |
8106 |
-@@ -1436,7 +1436,7 @@ class _Container(object): |
8107 |
- try: |
8108 |
- return modifyStrings(rawData, self.modFunct, self.titlesRefs, |
8109 |
- self.namesRefs, self.charactersRefs) |
8110 |
-- except RuntimeError, e: |
8111 |
-+ except RuntimeError as e: |
8112 |
- # Symbian/python 2.2 has a poor regexp implementation. |
8113 |
- import warnings |
8114 |
- warnings.warn('RuntimeError in ' |
8115 |
-@@ -1460,20 +1460,20 @@ class _Container(object): |
8116 |
- |
8117 |
- def keys(self): |
8118 |
- """Return a list of valid keys.""" |
8119 |
-- return self.data.keys() + self._additional_keys() |
8120 |
-+ return list(self.data.keys()) + self._additional_keys() |
8121 |
- |
8122 |
- def items(self): |
8123 |
- """Return the items in the dictionary.""" |
8124 |
-- return [(k, self.get(k)) for k in self.keys()] |
8125 |
-+ return [(k, self.get(k)) for k in list(self.keys())] |
8126 |
- |
8127 |
- # XXX: is this enough? |
8128 |
-- def iteritems(self): return self.data.iteritems() |
8129 |
-- def iterkeys(self): return self.data.iterkeys() |
8130 |
-- def itervalues(self): return self.data.itervalues() |
8131 |
-+ def iteritems(self): return iter(self.data.items()) |
8132 |
-+ def iterkeys(self): return iter(self.data.keys()) |
8133 |
-+ def itervalues(self): return iter(self.data.values()) |
8134 |
- |
8135 |
- def values(self): |
8136 |
- """Return the values in the dictionary.""" |
8137 |
-- return [self.get(k) for k in self.keys()] |
8138 |
-+ return [self.get(k) for k in list(self.keys())] |
8139 |
- |
8140 |
- def has_key(self, key): |
8141 |
- """Return true if a given section is defined.""" |
8142 |
-@@ -1497,7 +1497,7 @@ class _Container(object): |
8143 |
- return failobj |
8144 |
- |
8145 |
- def setdefault(self, key, failobj=None): |
8146 |
-- if not self.has_key(key): |
8147 |
-+ if key not in self: |
8148 |
- self[key] = failobj |
8149 |
- return self[key] |
8150 |
- |
8151 |
-@@ -1526,7 +1526,7 @@ class _Container(object): |
8152 |
- """Directly store the item with the given key.""" |
8153 |
- self.data[key] = item |
8154 |
- |
8155 |
-- def __nonzero__(self): |
8156 |
-+ def __bool__(self): |
8157 |
- """Return true if self.data contains something.""" |
8158 |
- if self.data: return 1 |
8159 |
- return 0 |
8160 |
-@@ -1551,18 +1551,18 @@ def flatten(seq, toDescend=(list, dict, tuple), yieldDictKeys=0, |
8161 |
- if isinstance(seq, (dict, _Container)): |
8162 |
- if yieldDictKeys: |
8163 |
- # Yield also the keys of the dictionary. |
8164 |
-- for key in seq.iterkeys(): |
8165 |
-+ for key in seq.keys(): |
8166 |
- for k in flatten(key, toDescend=toDescend, |
8167 |
- yieldDictKeys=yieldDictKeys, |
8168 |
- onlyKeysType=onlyKeysType, scalar=scalar): |
8169 |
- if onlyKeysType and isinstance(k, onlyKeysType): |
8170 |
- yield k |
8171 |
-- for value in seq.itervalues(): |
8172 |
-+ for value in seq.values(): |
8173 |
- for v in flatten(value, toDescend=toDescend, |
8174 |
- yieldDictKeys=yieldDictKeys, |
8175 |
- onlyKeysType=onlyKeysType, scalar=scalar): |
8176 |
- yield v |
8177 |
-- elif not isinstance(seq, (str, unicode, int, float)): |
8178 |
-+ elif not isinstance(seq, (str, int, float)): |
8179 |
- for item in seq: |
8180 |
- for i in flatten(item, toDescend=toDescend, |
8181 |
- yieldDictKeys=yieldDictKeys, |
8182 |
-diff --git a/setup.py b/setup.py |
8183 |
-index 09640df..692ada6 100755 |
8184 |
---- a/setup.py |
8185 |
-+++ b/setup.py |
8186 |
-@@ -124,7 +124,7 @@ params = { |
8187 |
- 'license': 'GPL', |
8188 |
- 'platforms': 'any', |
8189 |
- 'keywords': keywords, |
8190 |
-- 'classifiers': filter(None, classifiers.split("\n")), |
8191 |
-+ 'classifiers': [_f for _f in classifiers.split("\n") if _f], |
8192 |
- 'zip_safe': False, # XXX: I guess, at least... |
8193 |
- # Download URLs. |
8194 |
- 'url': home_page, |
8195 |
-@@ -197,9 +197,9 @@ def runRebuildmo(): |
8196 |
- rebuildmo = imp.load_module('rebuildmo', *modInfo) |
8197 |
- os.chdir(modulePath) |
8198 |
- languages = rebuildmo.rebuildmo() |
8199 |
-- print 'Created locale for: %s.' % ' '.join(languages) |
8200 |
-- except Exception, e: |
8201 |
-- print 'ERROR: unable to rebuild .mo files; caught exception %s' % e |
8202 |
-+ print('Created locale for: %s.' % ' '.join(languages)) |
8203 |
-+ except Exception as e: |
8204 |
-+ print('ERROR: unable to rebuild .mo files; caught exception %s' % e) |
8205 |
- sys.path = path |
8206 |
- os.chdir(cwd) |
8207 |
- return languages |
8208 |
-@@ -236,6 +236,6 @@ try: |
8209 |
- data_files.append((os.path.join(distutils.sysconfig.get_python_lib(), base_dir), files_found)) |
8210 |
- setuptools.setup(**params) |
8211 |
- except SystemExit: |
8212 |
-- print ERR_MSG |
8213 |
-+ print(ERR_MSG) |
8214 |
- raise |
8215 |
- |
8216 |
|
8217 |
diff --git a/dev-python/imdbpy/imdbpy-4.9-r2.ebuild b/dev-python/imdbpy/imdbpy-4.9-r2.ebuild |
8218 |
deleted file mode 100644 |
8219 |
index 05196d0..0000000 |
8220 |
--- a/dev-python/imdbpy/imdbpy-4.9-r2.ebuild |
8221 |
+++ /dev/null |
8222 |
@@ -1,44 +0,0 @@ |
8223 |
-# Copyright 1999-2013 Gentoo Foundation |
8224 |
-# Distributed under the terms of the GNU General Public License v2 |
8225 |
-# $Header: /var/cvsroot/gentoo-x86/dev-python/imdbpy/imdbpy-4.9-r1.ebuild,v 1.1 2013/06/23 17:43:11 idella4 Exp $ |
8226 |
- |
8227 |
-EAPI=5 |
8228 |
-PYTHON_COMPAT=( python{2_5,2_6,2_7,3_3} pypy2_0 ) |
8229 |
- |
8230 |
-inherit distutils-r1 |
8231 |
- |
8232 |
-MY_PN="IMDbPY" |
8233 |
-MY_P="${MY_PN}-${PV}" |
8234 |
- |
8235 |
-DESCRIPTION="Python package to access the IMDb movie database" |
8236 |
-HOMEPAGE="http://imdbpy.sourceforge.net/ http://pypi.python.org/pypi/IMDbPY" |
8237 |
-SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz" |
8238 |
- |
8239 |
-LICENSE="GPL-2" |
8240 |
-SLOT="0" |
8241 |
-KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86" |
8242 |
-IUSE="" |
8243 |
- |
8244 |
-DEPEND="dev-python/setuptools[${PYTHON_USEDEP}] |
8245 |
- dev-python/configparser" |
8246 |
-RDEPEND="" |
8247 |
- |
8248 |
-S="${WORKDIR}/${MY_PN}-${PV}" |
8249 |
- |
8250 |
-DISTUTILS_GLOBAL_OPTIONS=("*-jython --without-cutils") |
8251 |
-DOCS=( docs/FAQS.txt docs/imdbpy48.dtd docs/imdbpy.cfg ) |
8252 |
- |
8253 |
-PATCHES=( "${FILESDIR}/updateToPython3.patch" "${FILESDIR}/${PN}-4.6-data_location.patch" ) |
8254 |
- |
8255 |
-src_configure() { |
8256 |
- distutils-r1_src_configure --without-cutils |
8257 |
-} |
8258 |
- |
8259 |
-python_install_all() { |
8260 |
- local doc |
8261 |
- for doc in docs/README* |
8262 |
- do |
8263 |
- DOCS=( "${DOCS[@]}" $doc ) |
8264 |
- done |
8265 |
- distutils-r1_python_install_all |
8266 |
-} |
8267 |
|
8268 |
diff --git a/dev-python/imdbpy/metadata.xml b/dev-python/imdbpy/metadata.xml |
8269 |
deleted file mode 100644 |
8270 |
index 7cd64fc..0000000 |
8271 |
--- a/dev-python/imdbpy/metadata.xml |
8272 |
+++ /dev/null |
8273 |
@@ -1,8 +0,0 @@ |
8274 |
-<?xml version="1.0" encoding="UTF-8"?> |
8275 |
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
8276 |
-<pkgmetadata> |
8277 |
- <herd>mythtv</herd> |
8278 |
- <upstream> |
8279 |
- <remote-id type="pypi">IMDbPY</remote-id> |
8280 |
- </upstream> |
8281 |
-</pkgmetadata> |
8282 |
|
8283 |
diff --git a/media-gfx/blender/Manifest b/media-gfx/blender/Manifest |
8284 |
deleted file mode 100644 |
8285 |
index c6db9de..0000000 |
8286 |
--- a/media-gfx/blender/Manifest |
8287 |
+++ /dev/null |
8288 |
@@ -1,5 +0,0 @@ |
8289 |
-AUX blender-2.78-eigen-3.3.1.patch 666 SHA256 35900be15f8bb0540050ffab9067122ba87433eecf896095e7ce1e889e54af5b SHA512 9a2ee48fa38e23a5b086514468bd1c96ee2b97228e95cdfaac3c5d3b2c21c4e47a0ced4306d7dc89268d63b60e551b655d6d627790215ad68791fe3f35717bf5 WHIRLPOOL b073ba691ada03ead560a9be8907b8c1111c1029fdc7e6a4f59c24f5771a34bc287800f9458d81488fa19faba662afd876693bd9933600e498b13d95c4f134c6 |
8290 |
-AUX blender-fix-install-rules.patch 518 SHA256 4fbdd73c4bb20e316f6a02c7e6a33a90285db787aac5b3baf66394d256fe6e0f SHA512 5343f0e9e6bba2d15a38cb5db95a1aeff0a704c0762e558b9b74d88dd58e2fb5077289f0d8f25a61fa092d083f7db916d27c4642dfd7cf84d4c989258c3253ec WHIRLPOOL 6ae8c113ab1ccac5c1465e0deab3bd101922303c0f60ecdb4d1cbff7dd02d37c299d4897beb5239b60e8724e47b830ecd5b7f6045dd301847f2583d559bdacbb |
8291 |
-DIST blender-2.78a.tar.gz 44188123 SHA256 014a14b1ba00c0e651f106469b2e5dd444f11be5a7af48056f0ed59de90cceaf SHA512 57239b6ce473aaef114453f97a6e88535ec0a2f50cfecd221fa6bdcca6fe6559dcbefd48c3f20dc2235c195de13c59a1a155d5b64d777be31812d32e68be9370 WHIRLPOOL 85ea5ea5594716433a5f2f14233a489841598baf80170f01fff3946b4fa6ebc99086396a232f0f3c5f0e8c8d6c16ec27e98b7b58d79d289f5190214dc7efb677 |
8292 |
-EBUILD blender-2.78a-r2.ebuild 8353 SHA256 c1c9119567498541d027fa46fa8904c2bc5b1911c8663d4a9aa4e4a94fcc81cc SHA512 c12a7c31babf8d837205238bd5e4f0affb53a2e61f6a53d327eeae4b08741e9e9073debfc3f95edb5ea277462ce1898b2cae398190ab94dc2745e91390af3da4 WHIRLPOOL 2395d88212d8c95a7f0c620795a2dabab8f942ac919cf7c4d05bfa885fd3265cd977f8944e7afaa5f2cdf0b6e432a050af395c1fe684f26eb7ebc829d2de2623 |
8293 |
-MISC metadata.xml 3440 SHA256 45cba6ae08884bbca2a5a94993dde5abfd900ead160a2f7eec19a3f4779bb696 SHA512 75c1cfb4998e9bbd2c3d4836bfba2f273d90920a2a72f70b599ee4cdfdfbf02cf1f2508aa24df6c762e3c323000de0a04623b21caaf5843e235888d3906043a8 WHIRLPOOL f20d54a0f468ee3ed1c1d5eca5790f73963d1abceb7fd7ed2040d060882fdf40950e728eea5686f50f60124a1a8ce85c6c5a84da7f67de5660930ce6a3c69c53 |
8294 |
|
8295 |
diff --git a/media-gfx/blender/blender-2.78a-r2.ebuild b/media-gfx/blender/blender-2.78a-r2.ebuild |
8296 |
deleted file mode 100644 |
8297 |
index 3235f0c..0000000 |
8298 |
--- a/media-gfx/blender/blender-2.78a-r2.ebuild |
8299 |
+++ /dev/null |
8300 |
@@ -1,295 +0,0 @@ |
8301 |
-# Copyright 1999-2017 Gentoo Foundation |
8302 |
-# Distributed under the terms of the GNU General Public License v2 |
8303 |
- |
8304 |
-EAPI=6 |
8305 |
-PYTHON_COMPAT=( python3_5 ) |
8306 |
- |
8307 |
-inherit check-reqs cmake-utils fdo-mime flag-o-matic gnome2-utils \ |
8308 |
- pax-utils python-single-r1 toolchain-funcs versionator |
8309 |
- |
8310 |
-DESCRIPTION="3D Creation/Animation/Publishing System" |
8311 |
-HOMEPAGE="http://www.blender.org" |
8312 |
- |
8313 |
-SRC_URI="http://download.blender.org/source/${P}.tar.gz" |
8314 |
- |
8315 |
-# Blender can have letters in the version string, |
8316 |
-# so strip of the letter if it exists. |
8317 |
-MY_PV="$(get_version_component_range 1-2)" |
8318 |
- |
8319 |
-SLOT="0" |
8320 |
-LICENSE="|| ( GPL-2 BL )" |
8321 |
-KEYWORDS="~amd64 ~x86" |
8322 |
-IUSE="+boost +bullet +dds +elbeem +game-engine +openexr collada colorio \ |
8323 |
- cuda cycles debug doc ffmpeg fftw headless jack jemalloc jpeg2k libav \ |
8324 |
- llvm man ndof nls openal openimageio openmp opensubdiv openvdb \ |
8325 |
- player sdl sndfile test tiff valgrind" |
8326 |
- |
8327 |
-# OpenCL and nVidia performance is rubbish with Blender |
8328 |
-# If you have nVidia, use CUDA. |
8329 |
-REQUIRED_USE="${PYTHON_REQUIRED_USE} |
8330 |
- player? ( game-engine !headless ) |
8331 |
- cuda? ( cycles ) |
8332 |
- cycles? ( boost openexr tiff openimageio ) |
8333 |
- colorio? ( boost ) |
8334 |
- openvdb? ( boost ) |
8335 |
- opensubdiv? ( cuda ) |
8336 |
- nls? ( boost ) |
8337 |
- openal? ( boost ) |
8338 |
- game-engine? ( boost ) |
8339 |
- ?? ( ffmpeg libav )" |
8340 |
- |
8341 |
-# Since not using OpenCL with nVidia, depend on ATI binary |
8342 |
-# blobs as Cycles with OpenCL does not work with any open |
8343 |
-# source drivers. |
8344 |
-RDEPEND="${PYTHON_DEPS} |
8345 |
- dev-libs/lzo:2 |
8346 |
- >=dev-python/numpy-1.10.1[${PYTHON_USEDEP}] |
8347 |
- dev-python/requests[${PYTHON_USEDEP}] |
8348 |
- media-libs/freetype |
8349 |
- media-libs/glew:* |
8350 |
- media-libs/libpng:0= |
8351 |
- media-libs/libsamplerate |
8352 |
- sys-libs/zlib |
8353 |
- virtual/glu |
8354 |
- virtual/jpeg:0= |
8355 |
- virtual/libintl |
8356 |
- virtual/opengl |
8357 |
- boost? ( >=dev-libs/boost-1.62:=[nls?,threads(+)] ) |
8358 |
- collada? ( >=media-libs/opencollada-1.6.18:= ) |
8359 |
- colorio? ( >=media-libs/opencolorio-1.0.9-r2 ) |
8360 |
- cuda? ( =dev-util/nvidia-cuda-toolkit-8.0*:= ) |
8361 |
- ffmpeg? ( media-video/ffmpeg:=[x264,mp3,encode,theora,jpeg2k?] ) |
8362 |
- libav? ( >=media-video/libav-11.3:=[x264,mp3,encode,theora,jpeg2k?] ) |
8363 |
- fftw? ( sci-libs/fftw:3.0= ) |
8364 |
- !headless? ( |
8365 |
- x11-libs/libX11 |
8366 |
- x11-libs/libXi |
8367 |
- x11-libs/libXxf86vm |
8368 |
- ) |
8369 |
- jack? ( virtual/jack ) |
8370 |
- jemalloc? ( dev-libs/jemalloc:= ) |
8371 |
- jpeg2k? ( media-libs/openjpeg:0 ) |
8372 |
- llvm? ( sys-devel/llvm ) |
8373 |
- ndof? ( |
8374 |
- app-misc/spacenavd |
8375 |
- dev-libs/libspnav |
8376 |
- ) |
8377 |
- nls? ( virtual/libiconv ) |
8378 |
- openal? ( media-libs/openal ) |
8379 |
- openimageio? ( >=media-libs/openimageio-1.6.9 ) |
8380 |
- openexr? ( |
8381 |
- >=media-libs/ilmbase-2.2.0:= |
8382 |
- >=media-libs/openexr-2.2.0:= |
8383 |
- ) |
8384 |
- opensubdiv? ( media-libs/opensubdiv[cuda=] ) |
8385 |
- openvdb? ( |
8386 |
- media-gfx/openvdb[${PYTHON_USEDEP},abi3-compat(+),openvdb-compression(+)] |
8387 |
- dev-cpp/tbb |
8388 |
- >=dev-libs/c-blosc-1.5.2 |
8389 |
- ) |
8390 |
- sdl? ( media-libs/libsdl2[sound,joystick] ) |
8391 |
- sndfile? ( media-libs/libsndfile ) |
8392 |
- tiff? ( media-libs/tiff:0 ) |
8393 |
- valgrind? ( dev-util/valgrind )" |
8394 |
- |
8395 |
-DEPEND="${RDEPEND} |
8396 |
- >=dev-cpp/eigen-3.2.8:3 |
8397 |
- nls? ( sys-devel/gettext ) |
8398 |
- doc? ( |
8399 |
- app-doc/doxygen[-nodot(-),dot(+),latex] |
8400 |
- dev-python/sphinx[latex] |
8401 |
- )" |
8402 |
- |
8403 |
-PATCHES=( "${FILESDIR}"/${PN}-fix-install-rules.patch |
8404 |
- "${FILESDIR}"/${PN}-2.78-eigen-3.3.1.patch ) |
8405 |
- |
8406 |
-blender_check_requirements() { |
8407 |
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp |
8408 |
- |
8409 |
- if use doc; then |
8410 |
- CHECKREQS_DISK_BUILD="4G" check-reqs_pkg_pretend |
8411 |
- fi |
8412 |
-} |
8413 |
- |
8414 |
-pkg_pretend() { |
8415 |
- blender_check_requirements |
8416 |
-} |
8417 |
- |
8418 |
-pkg_setup() { |
8419 |
- blender_check_requirements |
8420 |
- python-single-r1_pkg_setup |
8421 |
-} |
8422 |
- |
8423 |
-src_prepare() { |
8424 |
- default |
8425 |
- |
8426 |
- # we don't want static glew, but it's scattered across |
8427 |
- # multiple files that differ from version to version |
8428 |
- # !!!CHECK THIS SED ON EVERY VERSION BUMP!!! |
8429 |
- local file |
8430 |
- while IFS="" read -d $'\0' -r file ; do |
8431 |
- sed -i -e '/-DGLEW_STATIC/d' "${file}" || die |
8432 |
- done < <(find . -type f -name "CMakeLists.txt") |
8433 |
- |
8434 |
- # Disable MS Windows help generation. The variable doesn't do what it |
8435 |
- # it sounds like. |
8436 |
- sed -e "s|GENERATE_HTMLHELP = YES|GENERATE_HTMLHELP = NO|" \ |
8437 |
- -i doc/doxygen/Doxyfile || die |
8438 |
-} |
8439 |
- |
8440 |
-src_configure() { |
8441 |
- # FIX: forcing '-funsigned-char' fixes an anti-aliasing issue with menu |
8442 |
- # shadows, see bug #276338 for reference |
8443 |
- append-flags -funsigned-char |
8444 |
- append-lfs-flags |
8445 |
- append-cppflags -DOPENVDB_3_ABI_COMPATIBLE |
8446 |
- |
8447 |
- local mycmakeargs=( |
8448 |
- -DPYTHON_VERSION="${EPYTHON/python/}" |
8449 |
- -DPYTHON_LIBRARY="$(python_get_library_path)" |
8450 |
- -DPYTHON_INCLUDE_DIR="$(python_get_includedir)" |
8451 |
- -DWITH_INSTALL_PORTABLE=OFF |
8452 |
- -DWITH_PYTHON_INSTALL=OFF |
8453 |
- -DWITH_PYTHON_INSTALL_NUMPY=OFF |
8454 |
- -DWITH_STATIC_LIBS=OFF |
8455 |
- -DWITH_SYSTEM_GLEW=ON |
8456 |
- -DWITH_SYSTEM_OPENJPEG=ON |
8457 |
- -DWITH_SYSTEM_EIGEN3=ON |
8458 |
- -DWITH_SYSTEM_LZO=ON |
8459 |
- -DWITH_C11=ON |
8460 |
- -DWITH_CXX11=ON |
8461 |
- -DWITH_BOOST=$(usex boost) |
8462 |
- -DWITH_BULLET=$(usex bullet) |
8463 |
- -DWITH_CODEC_FFMPEG=$(usex ffmpeg) |
8464 |
- -DWITH_CODEC_SNDFILE=$(usex sndfile) |
8465 |
- -DWITH_CUDA=$(usex cuda) |
8466 |
- -DWITH_CYCLES_DEVICE_CUDA=$(usex cuda TRUE FALSE) |
8467 |
- -DWITH_CYCLES=$(usex cycles) |
8468 |
- -DWITH_CYCLES_OSL=OFF |
8469 |
- -DWITH_LLVM=$(usex llvm) |
8470 |
- -DWITH_FFTW3=$(usex fftw) |
8471 |
- -DWITH_GAMEENGINE=$(usex game-engine) |
8472 |
- -DWITH_HEADLESS=$(usex headless) |
8473 |
- -DWITH_X11=$(usex !headless) |
8474 |
- -DWITH_IMAGE_DDS=$(usex dds) |
8475 |
- -DWITH_IMAGE_OPENEXR=$(usex openexr) |
8476 |
- -DWITH_IMAGE_OPENJPEG=$(usex jpeg2k) |
8477 |
- -DWITH_IMAGE_TIFF=$(usex tiff) |
8478 |
- -DWITH_INPUT_NDOF=$(usex ndof) |
8479 |
- -DWITH_INTERNATIONAL=$(usex nls) |
8480 |
- -DWITH_JACK=$(usex jack) |
8481 |
- -DWITH_MOD_FLUID=$(usex elbeem) |
8482 |
- -DWITH_MOD_OCEANSIM=$(usex fftw) |
8483 |
- -DWITH_OPENAL=$(usex openal) |
8484 |
- -DWITH_OPENCL=OFF |
8485 |
- -DWITH_CYCLES_DEVICE_OPENCL=OFF |
8486 |
- -DWITH_OPENCOLORIO=$(usex colorio) |
8487 |
- -DWITH_OPENCOLLADA=$(usex collada) |
8488 |
- -DWITH_OPENIMAGEIO=$(usex openimageio) |
8489 |
- -DWITH_OPENMP=$(usex openmp) |
8490 |
- -DWITH_OPENSUBDIV=$(usex opensubdiv) |
8491 |
- -DWITH_OPENVDB=$(usex openvdb) |
8492 |
- -DWITH_OPENVDB_BLOSC=$(usex openvdb) |
8493 |
- -DWITH_PLAYER=$(usex player) |
8494 |
- -DWITH_SDL=$(usex sdl) |
8495 |
- -DWITH_CXX_GUARDEDALLOC=$(usex debug) |
8496 |
- -DWITH_ASSERT_ABORT=$(usex debug) |
8497 |
- -DWITH_GTESTS=$(usex test) |
8498 |
- -DWITH_DOC_MANPAGE=$(usex man) |
8499 |
- -DWITH_MEM_JEMALLOC=$(usex jemalloc) |
8500 |
- -DWITH_MEM_VALGRIND=$(usex valgrind) |
8501 |
- ) |
8502 |
- cmake-utils_src_configure |
8503 |
-} |
8504 |
- |
8505 |
-src_compile() { |
8506 |
- cmake-utils_src_compile |
8507 |
- |
8508 |
- if use doc; then |
8509 |
- # Workaround for binary drivers. |
8510 |
- addpredict /dev/ati |
8511 |
- addpredict /dev/nvidiactl |
8512 |
- |
8513 |
- einfo "Generating Blender C/C++ API docs ..." |
8514 |
- cd "${CMAKE_USE_DIR}"/doc/doxygen || die |
8515 |
- doxygen -u Doxyfile || die |
8516 |
- doxygen || die "doxygen failed to build API docs." |
8517 |
- |
8518 |
- cd "${CMAKE_USE_DIR}" || die |
8519 |
- einfo "Generating (BPY) Blender Python API docs ..." |
8520 |
- "${BUILD_DIR}"/bin/blender --background --python doc/python_api/sphinx_doc_gen.py -noaudio || die "sphinx failed." |
8521 |
- |
8522 |
- cd "${CMAKE_USE_DIR}"/doc/python_api || die |
8523 |
- sphinx-build sphinx-in BPY_API || die "sphinx failed." |
8524 |
- fi |
8525 |
-} |
8526 |
- |
8527 |
-src_test() { |
8528 |
- if use test; then |
8529 |
- einfo "Running Blender Unit Tests ..." |
8530 |
- cd "${BUILD_DIR}"/bin/tests || die |
8531 |
- local f |
8532 |
- for f in *_test; do |
8533 |
- ./"${f}" || die |
8534 |
- done |
8535 |
- fi |
8536 |
-} |
8537 |
- |
8538 |
-src_install() { |
8539 |
- # Pax mark blender for hardened support. |
8540 |
- pax-mark m "${CMAKE_BUILD_DIR}"/bin/blender |
8541 |
- |
8542 |
- if use doc; then |
8543 |
- docinto "html/API/python" |
8544 |
- dodoc -r "${CMAKE_USE_DIR}"/doc/python_api/BPY_API/. |
8545 |
- |
8546 |
- docinto "html/API/blender" |
8547 |
- dodoc -r "${CMAKE_USE_DIR}"/doc/doxygen/html/. |
8548 |
- fi |
8549 |
- |
8550 |
- cmake-utils_src_install |
8551 |
- |
8552 |
- # fix doc installdir |
8553 |
- docinto "html" |
8554 |
- dodoc "${CMAKE_USE_DIR}"/release/text/readme.html |
8555 |
- rm -r "${ED%/}"/usr/share/doc/blender || die |
8556 |
- |
8557 |
- python_fix_shebang "${ED%/}/usr/bin/blender-thumbnailer.py" |
8558 |
- python_optimize "${ED%/}/usr/share/blender/${MY_PV}/scripts" |
8559 |
-} |
8560 |
- |
8561 |
-pkg_preinst() { |
8562 |
- gnome2_icon_savelist |
8563 |
-} |
8564 |
- |
8565 |
-pkg_postinst() { |
8566 |
- elog |
8567 |
- elog "Blender uses python integration. As such, may have some" |
8568 |
- elog "inherit risks with running unknown python scripts." |
8569 |
- elog |
8570 |
- elog "It is recommended to change your blender temp directory" |
8571 |
- elog "from /tmp to /home/user/tmp or another tmp file under your" |
8572 |
- elog "home directory. This can be done by starting blender, then" |
8573 |
- elog "dragging the main menu down do display all paths." |
8574 |
- elog |
8575 |
- ewarn |
8576 |
- ewarn "This ebuild does not unbundle the massive amount of 3rd party" |
8577 |
- ewarn "libraries which are shipped with blender. Note that" |
8578 |
- ewarn "these have caused security issues in the past." |
8579 |
- ewarn "If you are concerned about security, file a bug upstream:" |
8580 |
- ewarn " https://developer.blender.org/" |
8581 |
- ewarn |
8582 |
- gnome2_icon_cache_update |
8583 |
- fdo-mime_desktop_database_update |
8584 |
-} |
8585 |
- |
8586 |
-pkg_postrm() { |
8587 |
- gnome2_icon_cache_update |
8588 |
- fdo-mime_desktop_database_update |
8589 |
- |
8590 |
- ewarn "" |
8591 |
- ewarn "You may want to remove the following directory." |
8592 |
- ewarn "~/.config/${PN}/${MY_PV}/cache/" |
8593 |
- ewarn "It may contain extra render kernels not tracked by portage" |
8594 |
- ewarn "" |
8595 |
-} |
8596 |
|
8597 |
diff --git a/media-gfx/blender/files/blender-2.78-eigen-3.3.1.patch b/media-gfx/blender/files/blender-2.78-eigen-3.3.1.patch |
8598 |
deleted file mode 100644 |
8599 |
index 540aa6b..0000000 |
8600 |
--- a/media-gfx/blender/files/blender-2.78-eigen-3.3.1.patch |
8601 |
+++ /dev/null |
8602 |
@@ -1,25 +0,0 @@ |
8603 |
---- blender-2.78a-orig/extern/ceres/include/ceres/jet.h 2016-10-25 01:13:56.000000000 +1100 |
8604 |
-+++ blender-2.78a/extern/ceres/include/ceres/jet.h 2017-01-11 13:27:24.708241265 +1100 |
8605 |
-@@ -757,6 +757,7 @@ |
8606 |
- typedef ceres::Jet<T, N> Real; |
8607 |
- typedef ceres::Jet<T, N> NonInteger; |
8608 |
- typedef ceres::Jet<T, N> Nested; |
8609 |
-+ typedef ceres::Jet<T, N> Literal; |
8610 |
- |
8611 |
- static typename ceres::Jet<T, N> dummy_precision() { |
8612 |
- return ceres::Jet<T, N>(1e-12); |
8613 |
-@@ -777,6 +778,14 @@ |
8614 |
- HasFloatingPoint = 1, |
8615 |
- RequireInitialization = 1 |
8616 |
- }; |
8617 |
-+ |
8618 |
-+ template<bool Vectorized> |
8619 |
-+ struct Div { |
8620 |
-+ enum { |
8621 |
-+ AVX = false, |
8622 |
-+ Cost = 1 |
8623 |
-+ }; |
8624 |
-+ }; |
8625 |
- }; |
8626 |
- |
8627 |
- } // namespace Eigen |
8628 |
|
8629 |
diff --git a/media-gfx/blender/files/blender-fix-install-rules.patch b/media-gfx/blender/files/blender-fix-install-rules.patch |
8630 |
deleted file mode 100644 |
8631 |
index e62aba8..0000000 |
8632 |
--- a/media-gfx/blender/files/blender-fix-install-rules.patch |
8633 |
+++ /dev/null |
8634 |
@@ -1,16 +0,0 @@ |
8635 |
-diff -purN a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt |
8636 |
---- a/source/creator/CMakeLists.txt 2016-09-28 10:26:55.000000000 +0100 |
8637 |
-+++ b/source/creator/CMakeLists.txt 2016-10-03 12:17:08.938928486 +0100 |
8638 |
-@@ -328,12 +328,6 @@ endif() |
8639 |
- # Install Targets (Generic, All Platforms) |
8640 |
- |
8641 |
- |
8642 |
--# important to make a clean install each time, else old scripts get loaded. |
8643 |
--install( |
8644 |
-- CODE |
8645 |
-- "file(REMOVE_RECURSE ${TARGETDIR_VER})" |
8646 |
--) |
8647 |
-- |
8648 |
- if(WITH_PYTHON) |
8649 |
- # install(CODE "message(\"copying blender scripts...\")") |
8650 |
- |
8651 |
|
8652 |
diff --git a/media-gfx/blender/metadata.xml b/media-gfx/blender/metadata.xml |
8653 |
deleted file mode 100644 |
8654 |
index ef8d087..0000000 |
8655 |
--- a/media-gfx/blender/metadata.xml |
8656 |
+++ /dev/null |
8657 |
@@ -1,101 +0,0 @@ |
8658 |
-<?xml version="1.0" encoding="UTF-8"?> |
8659 |
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
8660 |
-<pkgmetadata> |
8661 |
- <maintainer restrict=">=media-gfx/blender-2.77" type="person"> |
8662 |
- <email>j.scruggs@×××××.com</email> |
8663 |
- <name>Jonathan Scruggs</name> |
8664 |
- </maintainer> |
8665 |
- <maintainer restrict=">=media-gfx/blender-2.77" type="person"> |
8666 |
- <email>agrigo2001@×××××××××.au</email> |
8667 |
- <name>Adrian Grigo</name> |
8668 |
- </maintainer> |
8669 |
- <maintainer type="project"> |
8670 |
- <email>proxy-maint@g.o</email> |
8671 |
- <name>Proxy Maintainers</name> |
8672 |
- </maintainer> |
8673 |
- <maintainer type="project"> |
8674 |
- <email>graphics@g.o</email> |
8675 |
- <name>Gentoo Graphics Project</name> |
8676 |
- </maintainer> |
8677 |
- |
8678 |
- <longdescription> |
8679 |
- Blender, the open source software for 3D modeling, animation, |
8680 |
- rendering, post-production, interactive creation and playback. |
8681 |
- </longdescription> |
8682 |
- |
8683 |
- <use> |
8684 |
- <flag name="boost"> |
8685 |
- Enable features depending on boost. |
8686 |
- </flag> |
8687 |
- <flag name="bullet"> |
8688 |
- Enable Bullet (Physics Engine). |
8689 |
- </flag> |
8690 |
- <flag name="collada"> |
8691 |
- Add support for Collada interchange format through |
8692 |
- <pkg>media-libs/opencollada</pkg>. |
8693 |
- </flag> |
8694 |
- <flag name="colorio"> |
8695 |
- Enable OpenColorIO color management through |
8696 |
- <pkg>media-libs/opencolorio</pkg>. |
8697 |
- </flag> |
8698 |
- <flag name="cuda"> |
8699 |
- Build cycles renderer with nVidia CUDA support. |
8700 |
- </flag> |
8701 |
- <flag name="cycles"> |
8702 |
- Build cycles renderer (requires <pkg>media-libs/openimageio</pkg> and |
8703 |
- <pkg>dev-libs/boost</pkg>). |
8704 |
- </flag> |
8705 |
- <flag name="dds"> |
8706 |
- Adds DDS textures support to Blender. |
8707 |
- </flag> |
8708 |
- <flag name="doc"> |
8709 |
- Build C and Python API documentation directly from the source code. |
8710 |
- </flag> |
8711 |
- <flag name="elbeem"> |
8712 |
- Adds surface fluid simulation to Blender using El'Beem library. |
8713 |
- </flag> |
8714 |
- <flag name="game-engine" restrict=">=media-gfx/blender-2.50"> |
8715 |
- Adds Game Engine support to Blender. |
8716 |
- </flag> |
8717 |
- <flag name="headless" restrict=">=media-gfx/blender-2.77"> |
8718 |
- Build without graphical support (renderfarm, server mode only). |
8719 |
- </flag> |
8720 |
- <flag name="jemalloc" restrict=">=media-gfx/blender-2.77"> |
8721 |
- Use <pkg>dev-libs/jemalloc</pkg> for memory allocation. |
8722 |
- </flag> |
8723 |
- <flag name="llvm" restrict=">=media-gfx/blender-2.77"> |
8724 |
- Enable features depending on llvm. |
8725 |
- </flag> |
8726 |
- <flag name="man" restrict=">=media-gfx/blender-2.77"> |
8727 |
- Build and install man pages. |
8728 |
- </flag> |
8729 |
- <flag name="ndof"> |
8730 |
- Enable NDOF input devices (SpaceNavigator and friends). |
8731 |
- </flag> |
8732 |
- <flag name="openimageio">Enable OpenImageIO Support</flag> |
8733 |
- <flag name="opennl" restrict="<=media-gfx/blender-2.73"> |
8734 |
- Enable use of Open Numerical Library |
8735 |
- </flag> |
8736 |
- <flag name="opensubdiv" restrict=">=media-gfx/blender-2.77"> |
8737 |
- Add rendering support form OpenSubdiv from Dreamworks Animation |
8738 |
- through <pkg>media-libs/opensubdiv</pkg>. |
8739 |
- </flag> |
8740 |
- <flag name="openvdb" restrict=">=media-gfx/blender-2.77"> |
8741 |
- Add GPU preview rendering. Only works with nVidia cards. |
8742 |
- </flag> |
8743 |
- <flag name="player"> |
8744 |
- Build the Blender Player. THis requires the Game engine. |
8745 |
- </flag> |
8746 |
- <flag name="redcode" restrict="<=media-gfx/blender-2.73"> |
8747 |
- This flag add support for RED CODE camera digital format (5K HD |
8748 |
- images *.r3d) - EXPERIMENTAL. |
8749 |
- </flag> |
8750 |
- <flag name="test" restrict=">=media-gfx/blender-2.77"> |
8751 |
- Build the provided unit tests. |
8752 |
- </flag> |
8753 |
- <flag name="valgrind" restrict=">=media-gfx/blender-2.77"> |
8754 |
- Add support for memory debugging using |
8755 |
- <pkg>dev-util/valgrind</pkg> |
8756 |
- </flag> |
8757 |
- </use> |
8758 |
-</pkgmetadata> |
8759 |
|
8760 |
diff --git a/media-sound/patchage/Manifest b/media-sound/patchage/Manifest |
8761 |
index 05dd597..ead99f8 100644 |
8762 |
--- a/media-sound/patchage/Manifest |
8763 |
+++ b/media-sound/patchage/Manifest |
8764 |
@@ -1,4 +1,4 @@ |
8765 |
-AUX patchage-0.5.0-desktop.patch 224 SHA256 0d078e63c5dbdde508be319e7180fa1694e7575414e0cdc062b0559d66da389c SHA512 ae000bc340d48a9bb89fc067b4b1abba3de39ef9be086c7eeffae71ddca6172ce500ea6ea9854fde8cc19df3117195cb6fdb4ecd0867aa69f332ac0a7d377b69 WHIRLPOOL 4edab48a5b35eba0eb0dbcd6545c09581f85c1910a9a81a16b22f8d8451c053e6567fa8aa5ec98e86a3b74b2639344239ec90508a625e0ac7846db22b3f6d004 |
8766 |
-DIST patchage-1.0.0.tar.bz2 414300 SHA256 6b21d74ef1b54fa62be8d6ba65ca8b61c7b6b5230cc85e093527081239bfeda9 SHA512 0a2be0183257a34a68ec84e6fb17d29a3d8ba7dd54a05fcdd13784ac8f5621eb7a376f17d42168958f5e1a8dab8858a9c5c8c867aa1838736cc2b7775f75f510 WHIRLPOOL 86278e94a71069e86a92d3f00ae61a99aca710738df79345ffa47d797df340719dce452c19b0a6165420bba97f3fc7d27f918dc4e294e90bfe4158d7a4f333bb |
8767 |
-EBUILD patchage-1.0.0-r1.ebuild 1019 SHA256 0709005d9912203d932df8d63290337170f85592aa5887afde9c79c233b0e2c0 SHA512 505b76f877d740939e12849437403f6a76d6bc4d2864be955b6d2727b4a8e413a1236678fb97daf9c3d603d833453b0779d8838ab0db0b5cabcbb6b7901fcdf3 WHIRLPOOL 91f9c63d77b1f74045538462bd8ed2d0e0e152059c0a75a31a2e27164d20d99a8fab040f9a2bebbff23dd85e7a17ec95da89fec19130fbb5bc8e473679593193 |
8768 |
-MISC metadata.xml 600 SHA256 328d5523796f70d83115dfb2ca81d1482e3f2b6fd3fecb4aad9173e1b3fc400f SHA512 d08bd05a57ca03d9f91c0904f9a1b92e332e4475fd6729feefb63c75df2c5ad6eebd718b6e7db8482819f463606dcca888400c1560dd9b2c9e426c26634ece77 WHIRLPOOL d2ae8940cafd4cc656938963bded9738c790a8022edb43f579f23014f05073d1ff7792a177683b760a3722c1c1634bdc656fd265195b2864f9d87402511734b9 |
8769 |
+AUX patchage-0.5.0-desktop.patch 224 BLAKE2B 74bae167f890e5c03043f8906a18576183d2519141d5413780e03091c9b5432044185812d192c12073eadaab0823e8ef1d25c81d57e8614abd120440763d6776 SHA512 ae000bc340d48a9bb89fc067b4b1abba3de39ef9be086c7eeffae71ddca6172ce500ea6ea9854fde8cc19df3117195cb6fdb4ecd0867aa69f332ac0a7d377b69 |
8770 |
+DIST patchage-1.0.0.tar.bz2 414300 BLAKE2B 4f2fd0a0911cb261508883b73305c2736143d9a165b854b8b4042a3c0f6454e1f79bc3b6cd5d28844e1cdeeaf7dd20effc164aa1151390d4c45af0a339c2ef5a SHA512 0a2be0183257a34a68ec84e6fb17d29a3d8ba7dd54a05fcdd13784ac8f5621eb7a376f17d42168958f5e1a8dab8858a9c5c8c867aa1838736cc2b7775f75f510 |
8771 |
+EBUILD patchage-1.0.0-r2.ebuild 1019 BLAKE2B bfbc0c49d65fa91a40eeddef8896bd98bcfb0f0fe9f8a2965be4ed00a09bffef3eca7422107758a89d64bd5ce2d353ac24d156bc1ee302d574f338f68d7ddcf8 SHA512 505b76f877d740939e12849437403f6a76d6bc4d2864be955b6d2727b4a8e413a1236678fb97daf9c3d603d833453b0779d8838ab0db0b5cabcbb6b7901fcdf3 |
8772 |
+MISC metadata.xml 600 BLAKE2B 89bfd8b0da00e90fdd9fb85ca8604c80de0e2a8e471309aec0022f31f844d06c914c7536a3928179256f85b313fefaa3dec8937159f7131a03838276cca86162 SHA512 d08bd05a57ca03d9f91c0904f9a1b92e332e4475fd6729feefb63c75df2c5ad6eebd718b6e7db8482819f463606dcca888400c1560dd9b2c9e426c26634ece77 |
8773 |
|
8774 |
diff --git a/media-sound/patchage/patchage-1.0.0-r1.ebuild b/media-sound/patchage/patchage-1.0.0-r2.ebuild |
8775 |
similarity index 100% |
8776 |
rename from media-sound/patchage/patchage-1.0.0-r1.ebuild |
8777 |
rename to media-sound/patchage/patchage-1.0.0-r2.ebuild |
8778 |
|
8779 |
diff --git a/media-sound/rosegarden/Manifest b/media-sound/rosegarden/Manifest |
8780 |
deleted file mode 100644 |
8781 |
index 8ed579c..0000000 |
8782 |
--- a/media-sound/rosegarden/Manifest |
8783 |
+++ /dev/null |
8784 |
@@ -1,3 +0,0 @@ |
8785 |
-DIST rosegarden-17.04.tar.bz2 6454603 SHA256 988a6141c5b0a8e85c029f650de78bf57100c4d778c22d0194b0692584640ece SHA512 23240522cba8cc3b5d0e3b29ee5b871c911c7634d74f65d04b353f59747bdf6a1bfd9985f16ab331ea2399a797e66b2ebd110e192bb52ba4df453d42d7b8f73b WHIRLPOOL 91b7d8d74578e8666de607f55cecdfc57dde9b9b4e2367d7b5a2f1d3ae76eaf3d0ef6b62d78ae4f9f080448019caf8e0580d5c1e30f56708c9b2dcc2c3113aa9 |
8786 |
-EBUILD rosegarden-17.04-r1.ebuild 1202 SHA256 d904a72c4da845efa51ba8afbf3a80efa9b1dd4c1afa84d4baab6d5b96769932 SHA512 3be5bfa03535520bff740a632080947ca32af0e106994de97fc0277987ae808c283dd64a3b4fa4103d74e463ea866e5789a9bf0dc8b2df9d93dddc3802c8a6d8 WHIRLPOOL c8db3a68cb96715008db0dbf8ce17987fd1685a1990e17b1c8fd5caf3020ce173d357d695074df701026ce00fcb2c6d17691b31b11815d3d434950a3cc51bca4 |
8787 |
-MISC metadata.xml 349 SHA256 97a83e4c15e9cdbac3ca20099643e4dd0a8ba32661aa2b87febcd48445aa1613 SHA512 1790ba05a4f13f358de6890c908b2f1eb0581143063b7237220dd05aba31d16d68f2cf6c4712a08894909b7de5306d592807e9f3171b66b72fd867bd339a0cee WHIRLPOOL ff9d9c24a41d18572aa6396d46f3c2a8646663b0bca8ec7d70459a9e975d10440d63c69ad37e6b4495615c6252ca07246afbaa957115c0d1642668dc976733c7 |
8788 |
|
8789 |
diff --git a/media-sound/rosegarden/metadata.xml b/media-sound/rosegarden/metadata.xml |
8790 |
deleted file mode 100644 |
8791 |
index c399767..0000000 |
8792 |
--- a/media-sound/rosegarden/metadata.xml |
8793 |
+++ /dev/null |
8794 |
@@ -1,11 +0,0 @@ |
8795 |
-<?xml version="1.0" encoding="UTF-8"?> |
8796 |
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
8797 |
-<pkgmetadata> |
8798 |
- <maintainer type="project"> |
8799 |
- <email>proaudio@g.o</email> |
8800 |
- <name>Gentoo ProAudio Project</name> |
8801 |
- </maintainer> |
8802 |
- <upstream> |
8803 |
- <remote-id type="sourceforge">rosegarden</remote-id> |
8804 |
- </upstream> |
8805 |
-</pkgmetadata> |
8806 |
|
8807 |
diff --git a/media-sound/rosegarden/rosegarden-17.04-r1.ebuild b/media-sound/rosegarden/rosegarden-17.04-r1.ebuild |
8808 |
deleted file mode 100644 |
8809 |
index 5403601..0000000 |
8810 |
--- a/media-sound/rosegarden/rosegarden-17.04-r1.ebuild |
8811 |
+++ /dev/null |
8812 |
@@ -1,60 +0,0 @@ |
8813 |
-# Copyright 1999-2017 Gentoo Foundation |
8814 |
-# Distributed under the terms of the GNU General Public License v2 |
8815 |
- |
8816 |
-EAPI=5 |
8817 |
-inherit cmake-utils eutils fdo-mime gnome2-utils |
8818 |
- |
8819 |
-DESCRIPTION="MIDI and audio sequencer and notation editor" |
8820 |
-HOMEPAGE="http://www.rosegardenmusic.com/" |
8821 |
-SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" |
8822 |
- |
8823 |
-LICENSE="GPL-2" |
8824 |
-SLOT="0" |
8825 |
-KEYWORDS="~amd64 ~ppc ~x86" |
8826 |
-IUSE="lirc" |
8827 |
- |
8828 |
-RDEPEND=" |
8829 |
- dev-qt/qtgui:5 |
8830 |
- dev-qt/qtcore:5 |
8831 |
- dev-qt/qtwidgets:5 |
8832 |
- dev-qt/qtxml:5 |
8833 |
- dev-qt/qtnetwork:5 |
8834 |
- dev-qt/qtprintsupport:5 |
8835 |
- media-libs/ladspa-sdk:= |
8836 |
- x11-libs/libSM:= |
8837 |
- virtual/jack |
8838 |
- media-libs/alsa-lib:= |
8839 |
- >=media-libs/dssi-1.0.0:= |
8840 |
- media-libs/liblo:= |
8841 |
- media-libs/liblrdf:= |
8842 |
- sci-libs/fftw:3.0 |
8843 |
- media-libs/libsamplerate:= |
8844 |
- media-libs/libsndfile:= |
8845 |
- sys-libs/zlib:= |
8846 |
- lirc? ( app-misc/lirc:= )" |
8847 |
-DEPEND="${RDEPEND} |
8848 |
- dev-qt/qttest:5 |
8849 |
- virtual/pkgconfig" |
8850 |
- |
8851 |
-src_configure() { |
8852 |
- local mycmakeargs=( |
8853 |
- "-DDISABLE_LIRC=$(usex lirc OFF ON)" |
8854 |
- ) |
8855 |
- cmake-utils_src_configure |
8856 |
-} |
8857 |
- |
8858 |
-pkg_preinst() { |
8859 |
- gnome2_icon_savelist |
8860 |
-} |
8861 |
- |
8862 |
-pkg_postinst() { |
8863 |
- gnome2_icon_cache_update |
8864 |
- fdo-mime_desktop_database_update |
8865 |
- fdo-mime_mime_database_update |
8866 |
-} |
8867 |
- |
8868 |
-pkg_postrm() { |
8869 |
- gnome2_icon_cache_update |
8870 |
- fdo-mime_desktop_database_update |
8871 |
- fdo-mime_mime_database_update |
8872 |
-} |
8873 |
|
8874 |
diff --git a/media-video/dvdstyler/ChangeLog b/media-video/dvdstyler/ChangeLog |
8875 |
deleted file mode 100644 |
8876 |
index 9d0d41c..0000000 |
8877 |
--- a/media-video/dvdstyler/ChangeLog |
8878 |
+++ /dev/null |
8879 |
@@ -1,276 +0,0 @@ |
8880 |
-# ChangeLog for media-video/dvdstyler |
8881 |
-# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 |
8882 |
-# $Header: /var/cvsroot/gentoo-x86/media-video/dvdstyler/ChangeLog,v 1.53 2012/05/05 08:58:59 jdhore Exp $ |
8883 |
- |
8884 |
- 05 May 2012; Jeff Horelick <jdhore@g.o> dvdstyler-2.1.ebuild: |
8885 |
- dev-util/pkgconfig -> virtual/pkgconfig |
8886 |
- |
8887 |
- 23 Dec 2011; Samuli Suominen <ssuominen@g.o> dvdstyler-2.1.ebuild: |
8888 |
- Fix building with FFmpeg >= 0.9 wrt #395793 by Helmut Jarausch |
8889 |
- |
8890 |
- 22 Dec 2011; Samuli Suominen <ssuominen@g.o> |
8891 |
- -dvdstyler-2.0_rc1.ebuild, -dvdstyler-2.0_rc2.ebuild: |
8892 |
- old |
8893 |
- |
8894 |
-*dvdstyler-2.1 (22 Dec 2011) |
8895 |
- |
8896 |
- 22 Dec 2011; Samuli Suominen <ssuominen@g.o> +dvdstyler-2.1.ebuild: |
8897 |
- Version bump. Missing -ljpeg (in wxVillaLib/ for imagjpg.cpp) wrt #367863 by |
8898 |
- Diego Elio Pettenò. |
8899 |
- |
8900 |
-*dvdstyler-2.0_rc2 (16 Oct 2011) |
8901 |
- |
8902 |
- 16 Oct 2011; Samuli Suominen <ssuominen@g.o> |
8903 |
- +dvdstyler-2.0_rc2.ebuild: |
8904 |
- Version bump. |
8905 |
- |
8906 |
- 16 Oct 2011; Samuli Suominen <ssuominen@g.o> -dvdstyler-1.8.1.ebuild, |
8907 |
- -files/dvdstyler-1.8.1-cast.patch: |
8908 |
- old |
8909 |
- |
8910 |
- 09 Oct 2011; Samuli Suominen <ssuominen@g.o> -dvdstyler-1.7.4.ebuild, |
8911 |
- -files/dvdstyler-1.7.4-autoconf.patch, -dvdstyler-1.8.1_beta1.ebuild: |
8912 |
- old |
8913 |
- |
8914 |
-*dvdstyler-2.0_rc1 (09 Oct 2011) |
8915 |
- |
8916 |
- 09 Oct 2011; Samuli Suominen <ssuominen@g.o> |
8917 |
- +dvdstyler-2.0_rc1.ebuild: |
8918 |
- Version bump wrt #353478 by Thomas Rausch. This will also fix building with |
8919 |
- recent FFmpeg wrt #374797 by Diego Elio Pettenò. |
8920 |
- |
8921 |
- 16 Sep 2011; Steve Dibb <beandog@g.o> dvdstyler-1.7.4.ebuild, |
8922 |
- dvdstyler-1.8.1_beta1.ebuild, dvdstyler-1.8.1.ebuild: |
8923 |
- Use ffmpeg virtual, bug 362129 |
8924 |
- |
8925 |
- 13 Aug 2011; Kacper Kowalik <xarthisius@g.o> dvdstyler-1.7.4.ebuild, |
8926 |
- dvdstyler-1.8.1_beta1.ebuild, dvdstyler-1.8.1.ebuild: |
8927 |
- Dropped ppc keywords wrt #361737 |
8928 |
- |
8929 |
- 20 Jul 2011; Pacho Ramos <pacho@g.o> metadata.xml: |
8930 |
- Drop maintainer due retirement, bug #34534 |
8931 |
- |
8932 |
-*dvdstyler-1.8.1 (18 Jul 2010) |
8933 |
- |
8934 |
- 18 Jul 2010; Daniel Black <dragonheart@g.o> |
8935 |
- +dvdstyler-1.8.1.ebuild, +files/dvdstyler-1.8.1-cast.patch: |
8936 |
- version bump as per bug #327289. |
8937 |
- |
8938 |
-*dvdstyler-1.8.1_beta1 (28 Apr 2010) |
8939 |
- |
8940 |
- 28 Apr 2010; Daniel Pielmeier <billie@g.o> |
8941 |
- +dvdstyler-1.8.1_beta1.ebuild: |
8942 |
- Version bump. |
8943 |
- |
8944 |
- 17 Feb 2010; Ryan Hill <dirtyepic@g.o> dvdstyler-1.7.4.ebuild: |
8945 |
- Fix wxsvg dependency to account for the removal of the ffmpeg USE flag in |
8946 |
- later versions. |
8947 |
- |
8948 |
-*dvdstyler-1.7.4 (14 Oct 2009) |
8949 |
- |
8950 |
- 14 Oct 2009; Daniel Black <dragonheart@g.o> |
8951 |
- dvdstyler-1.7.4_rc1.ebuild, +dvdstyler-1.7.4.ebuild, |
8952 |
- +files/dvdstyler-1.7.4-autoconf.patch: |
8953 |
- add missing xmlto dependency as was noticed on irc #gentoo (by I forget |
8954 |
- who). Added version bump |
8955 |
- |
8956 |
-*dvdstyler-1.7.4_rc1 (16 Sep 2009) |
8957 |
- |
8958 |
- 16 Sep 2009; Samuli Suominen <ssuominen@g.o> |
8959 |
- +dvdstyler-1.7.4_rc1.ebuild: |
8960 |
- Version bump (#284035). |
8961 |
- |
8962 |
-*dvdstyler-1.7.3_beta3_p1 (05 Jul 2009) |
8963 |
- |
8964 |
- 05 Jul 2009; Samuli Suominen <ssuominen@g.o> |
8965 |
- +dvdstyler-1.7.3_beta3_p1.ebuild, |
8966 |
- +files/dvdstyler-1.7.3_beta3_p1-link_to_wxgtk_adv.patch: |
8967 |
- Version bump wrt #273422. |
8968 |
- |
8969 |
-*dvdstyler-1.7.3_beta2 (29 Apr 2009) |
8970 |
- |
8971 |
- 29 Apr 2009; Daniel Black <dragonheart@g.o> |
8972 |
- +dvdstyler-1.7.3_beta2.ebuild: |
8973 |
- version bump - bug #265650 - ebuild by Fabio Correa |
8974 |
- |
8975 |
-*dvdstyler-1.7.2 (29 Apr 2009) |
8976 |
- |
8977 |
- 29 Apr 2009; Daniel Black <dragonheart@g.o> |
8978 |
- +files/dvdstyler-1.7.2-skipxmlvalidation.patch, |
8979 |
- dvdstyler-1.7.2_beta4.ebuild, +dvdstyler-1.7.2.ebuild: |
8980 |
- version bug as per bug #262454. Ebuild changes thanks to Fabio |
8981 |
- |
8982 |
- 16 Feb 2009; Daniel Black <dragonheart@g.o> |
8983 |
- -dvdstyler-1.5-r1.ebuild, -dvdstyler-1.5.1.ebuild, |
8984 |
- -dvdstyler-1.5.1_p2.ebuild, -dvdstyler-1.7.2_beta3.ebuild: |
8985 |
- removed as nolonger works - bug #25916 comment 0 |
8986 |
- |
8987 |
- 16 Feb 2009; Daniel Black <dragonheart@g.o> |
8988 |
- -dvdstyler-1.7.2_beta3.ebuild, dvdstyler-1.7.2_beta4.ebuild: |
8989 |
- fix minium ffmpeg version - bug #257964 thanks Jordan Bradley. Fixed bug |
8990 |
- #259160 - ffmpeg required USE=encoder to be useable. Thanks Ed Criscuolo |
8991 |
- |
8992 |
-*dvdstyler-1.7.2_beta4 (08 Feb 2009) |
8993 |
- |
8994 |
- 08 Feb 2009; Daniel Black <dragonheart@g.o> |
8995 |
- +dvdstyler-1.7.2_beta4.ebuild: |
8996 |
- version bump as per bug #257121 thanks Daniel Pielmeier and Bernd Butscheidt |
8997 |
- |
8998 |
-*dvdstyler-1.7.2_beta3 (18 Jan 2009) |
8999 |
-*dvdstyler-1.7.1 (18 Jan 2009) |
9000 |
- |
9001 |
- 18 Jan 2009; Daniel Black <dragonheart@g.o> |
9002 |
- +dvdstyler-1.7.1.ebuild, +dvdstyler-1.7.2_beta3.ebuild: |
9003 |
- version bump as per bug #215665. Thanks to all that waited so long and |
9004 |
- provided feedback |
9005 |
- |
9006 |
- 03 Jan 2009; Christoph Mende <angelos@g.o> dvdstyler-1.5.1.ebuild, |
9007 |
- dvdstyler-1.5.1_p2.ebuild: |
9008 |
- Bumped to EAPI2, changed netpbm dependency to include [jpeg], fixed wxGTK |
9009 |
- dependency |
9010 |
- |
9011 |
- 01 Apr 2008; Daniel Black <dragonheart@g.o> |
9012 |
- dvdstyler-1.5-r1.ebuild, dvdstyler-1.5.1.ebuild, |
9013 |
- dvdstyler-1.5.1_p2.ebuild: |
9014 |
- remove duplicate desktop entry - bug #208806 thanks to Stefan Briesenick |
9015 |
- |
9016 |
-*dvdstyler-1.5.1_p2 (24 Dec 2007) |
9017 |
- |
9018 |
- 24 Dec 2007; Daniel Black <dragonheart@g.o> |
9019 |
- +dvdstyler-1.5.1_p2.ebuild: |
9020 |
- version bump to fix some serious problems - bug #203057 thanks to Michael |
9021 |
- |
9022 |
-*dvdstyler-1.5.1 (16 Aug 2007) |
9023 |
- |
9024 |
- 16 Aug 2007; Daniel Black <dragonheart@g.o> |
9025 |
- +dvdstyler-1.5.1.ebuild: |
9026 |
- version bump |
9027 |
- |
9028 |
- 24 Jul 2007; Daniel Black <dragonheart@g.o> |
9029 |
- -files/dvdstyler-1.4-gcc4.patch, -dvdstyler-1.4.ebuild, |
9030 |
- -dvdstyler-1.5.ebuild: |
9031 |
- old version cleanout |
9032 |
- |
9033 |
- 24 Jul 2007; Christian Faulhammer <opfer@g.o> |
9034 |
- dvdstyler-1.5-r1.ebuild: |
9035 |
- stable x86, bug 185864 |
9036 |
- |
9037 |
- 02 Jul 2007; Daniel Black <dragonheart@g.o> |
9038 |
- dvdstyler-1.5-r1.ebuild: |
9039 |
- addded missing media-libs/netpbm dependency as per bug #183848 thanks to |
9040 |
- Paulo Aragao |
9041 |
- |
9042 |
-*dvdstyler-1.5-r1 (19 Jun 2007) |
9043 |
- |
9044 |
- 19 Jun 2007; Daniel Black <dragonheart@g.o> |
9045 |
- +dvdstyler-1.5-r1.ebuild: |
9046 |
- better make_desktop entry thanks to Chris Mayo bug #181958 |
9047 |
- |
9048 |
-*dvdstyler-1.5 (10 Jun 2007) |
9049 |
- |
9050 |
- 10 Jun 2007; Daniel Black <dragonheart@g.o> +dvdstyler-1.5.ebuild: |
9051 |
- version bump thanks to all supporters in bug #109894 |
9052 |
- |
9053 |
- 03 Feb 2007; Diego Pettenò <flameeyes@g.o> ChangeLog: |
9054 |
- Regenerate digest in Manifest2 format. |
9055 |
- |
9056 |
- 29 Dec 2005; Mark Loeser <halcy0n@g.o> |
9057 |
- +files/dvdstyler-1.4-gcc4.patch, dvdstyler-1.4.ebuild: |
9058 |
- Fix compilation with gcc-4.0; bug #113927 |
9059 |
- |
9060 |
- 15 Dec 2005; Donnie Berkholz <spyderous@g.o>; dvdstyler-1.4.ebuild: |
9061 |
- Port to modular X. Remove virtual/x11, it comes in from gtk+. |
9062 |
- |
9063 |
- 07 Sep 2005; Daniel Black <dragonheart@g.o> -dvdstyler-1.31.ebuild: |
9064 |
- removed 1.31 as per bug #104872 to remove version problem. ~amd64 still has |
9065 |
- issues according to Jim in bug #104872 |
9066 |
- |
9067 |
- 05 Sep 2005; Daniel Black <dragonheart@g.o> dvdstyler-1.31.ebuild: |
9068 |
- drop x86 keyword to avoid downgrade - bug #104872 |
9069 |
- |
9070 |
- 05 Sep 2005; Daniel Black <dragonheart@g.o> dvdstyler-1.4.ebuild: |
9071 |
- x86 stable on 1.4 plan to remove 1.31 |
9072 |
- |
9073 |
-*dvdstyler-1.4 (04 Sep 2005) |
9074 |
- |
9075 |
- 04 Sep 2005; Daniel Black <dragonheart@g.o> +dvdstyler-1.4.ebuild, |
9076 |
- dvdstyler-1.31.ebuild, -dvdstyler-1.40.ebuild: |
9077 |
- QA clean - removed obscelete build commands, corrected versioing, removed |
9078 |
- INSTALL and README from installation. Inspired by flameeyes |
9079 |
- |
9080 |
- 08 Jun 2005; David Holm <dholm@g.o> dvdstyler-1.40.ebuild: |
9081 |
- Added to ~ppc. |
9082 |
- |
9083 |
- 07 Jun 2005; Jan Brinkmann <luckyduck@g.o> dvdstyler-1.31.ebuild, |
9084 |
- dvdstyler-1.40.ebuild: |
9085 |
- We now depend on =wxGTK-2.4*, see #93746 for details. |
9086 |
- |
9087 |
-*dvdstyler-1.40 (07 Jun 2005) |
9088 |
- |
9089 |
- 07 Jun 2005; Jan Brinkmann <luckyduck@g.o> +dvdstyler-1.40.ebuild: |
9090 |
- New upstream release, fixes #95328. |
9091 |
- |
9092 |
- 22 Apr 2005; Jan Brinkmann <luckyduck@g.o> |
9093 |
- -files/1.1-AutoMakefile.patch, -files/1.1-code.patch, |
9094 |
- -files/1.1-gcc34.patch, -files/1.3_beta-code.patch, -dvdstyler-1.1.ebuild, |
9095 |
- dvdstyler-1.31.ebuild, -dvdstyler-1.3_beta.ebuild: |
9096 |
- stable on amd64 and x86, did some cleanup |
9097 |
- |
9098 |
- 22 Apr 2005; Jan Brinkmann <luckyduck@g.o> dvdstyler-1.31.ebuild: |
9099 |
- stable on amd64 and x86 |
9100 |
- |
9101 |
- 19 Apr 2005; Bryan Østergaard <kloeri@g.o> metadata.xml: |
9102 |
- Remove retired developer from metadata.xml. |
9103 |
- |
9104 |
- 30 Mar 2005; Jan Brinkmann <luckyduck@g.o> dvdstyler-1.31.ebuild: |
9105 |
- dvdstyler now generates desktop file using make_desktop_entry, fixes #82209 |
9106 |
- |
9107 |
-*dvdstyler-1.31 (06 Feb 2005) |
9108 |
- |
9109 |
- 06 Feb 2005; <augustus@g.o> +dvdstyler-1.31.ebuild: |
9110 |
- Added new build 1.31. |
9111 |
- |
9112 |
- 15 Jan 2005; Jan Brinkmann <luckyduck@g.o> dvdstyler-1.1.ebuild, |
9113 |
- dvdstyler-1.3_beta.ebuild: |
9114 |
- changed app-cdr/cdrtools dependency to virtual/cdrtools. see bug #77817. |
9115 |
- |
9116 |
-*dvdstyler-1.3_beta (21 Nov 2004) |
9117 |
- |
9118 |
- 21 Nov 2004; Daniel Black <dragonheart@g.o> |
9119 |
- +files/1.3_beta-code.patch, +dvdstyler-1.3_beta.ebuild: |
9120 |
- version bump. |
9121 |
- |
9122 |
-*dvdstyler-1.1 (21 Nov 2004) |
9123 |
- |
9124 |
- 21 Nov 2004; Daniel Black <dragonheart@g.o> |
9125 |
- -files/1.05-AutoMakefile.patch, -files/1.05-code.patch, |
9126 |
- -files/1.05-gcc34.patch, +files/1.1-AutoMakefile.patch, |
9127 |
- +files/1.1-code.patch, +files/1.1-gcc34.patch, -dvdstyler-1.05-r1.ebuild, |
9128 |
- +dvdstyler-1.1.ebuild: |
9129 |
- version bump and cleanout. Ebuild and patches thanks to Philippe Weibel |
9130 |
- <philippe.weibel@××××.fr> and Patrick Dawson <pkdawson@g.o> in bug |
9131 |
- #47899. |
9132 |
- |
9133 |
- 18 Oct 2004; Danny van Dyk <kugelfang@g.o> |
9134 |
- dvdstyler-1.05-r1.ebuild: |
9135 |
- Marked ~amd64. |
9136 |
- |
9137 |
- 04 Oct 2004; Patrick Dawson <pkdawson@g.o> +files/1.05-gcc34.patch, |
9138 |
- dvdstyler-1.05-r1.ebuild: |
9139 |
- gcc-3.4 fix, closes bug #65983. |
9140 |
- |
9141 |
-*dvdstyler-1.05-r1 (05 Aug 2004) |
9142 |
- |
9143 |
- 05 Aug 2004; Daniel Black <dragonheart@g.o> |
9144 |
- files/1.05-AutoMakefile.patch, +dvdstyler-1.05-r1.ebuild, |
9145 |
- -dvdstyler-1.05.ebuild: |
9146 |
- Changed to use installed dev-libs/expat rather than one that came with the |
9147 |
- package. Also moved silence.mp2 to the correct directory. |
9148 |
- |
9149 |
-*dvdstyler-1.05 (30 Jul 2004) |
9150 |
- |
9151 |
- 30 Jul 2004; Daniel Black <dragonheart@g.o> +metadata.xml, |
9152 |
- +dvdstyler-1.05.ebuild, +files/1.05-code.patch, |
9153 |
- +files/1.05-AutoMakefile.patch: |
9154 |
- Inital import as per bug #47899. Thanks to Ian Haylock |
9155 |
- <haylocki@××××××××××.uk> for the bug. |
9156 |
|
9157 |
diff --git a/media-video/dvdstyler/Manifest b/media-video/dvdstyler/Manifest |
9158 |
deleted file mode 100644 |
9159 |
index 0e61149..0000000 |
9160 |
--- a/media-video/dvdstyler/Manifest |
9161 |
+++ /dev/null |
9162 |
@@ -1,7 +0,0 @@ |
9163 |
-AUX dvdstyler-1.7.4-autoconf.patch 3058 SHA256 b85ca996bb831f79d2e61497d09f19313db097207935d3727f145354f8108143 SHA512 64ec0f4b0718fc8b89dfd78691fffd2a50514ea4fe91a56985d3b775394204d91b34858a49e454a0722f1bc4ed3f98622315f51adacfea7ccb160c2e0af4f1c4 WHIRLPOOL aa123edc1e90d96329d8d7dd8fb487243501d10a374b6a23d7e89765c7bf9bfc254a679442cafc23ef43deb9873aa289f41c62411103e5268c1ff91f737eb78c |
9164 |
-AUX dvdstyler-1.8.1-cast.patch 437 SHA256 5efcb4b2f943e2e3ad5b4d0e5891c69655ec0aec912a45c61eec32b8c5862070 SHA512 1e825a9911508a2e43ab41b81cf511b6bd43f15b0394df96a89231e0d97c0bac1259701fcf3b71cac781db74925710d4c8082b4dac4605187b7d5d81aec2f734 WHIRLPOOL e5a4f82e1a6a0d9f6c63e7d653ee2e2958f3f8f559d4532675e452f1f1ac6ac1a6ff1b4ce134f6b3cb8b124f4112b01663657ab9400c578c7cbee1288c080207 |
9165 |
-AUX dvdstyler-1.8.1-fix_enum_error.patch 562 SHA256 d9a11f38dd0245ff0ce687296798139100171f484a7c90b43ff8b37c201a8240 SHA512 af5cdf9d6686b510794c3077ed1ec4551aa48b198b3570db9d4948a5a01246ee496e1c8bdd7b96c9c23372d0cc6d9e415df79a52c4f0f4c2b6cf3050cfded34a WHIRLPOOL 978f08233c30aa52220e89da3e9587753caf372100362d4097f3e856eeddf3b49bb179201994199a2eede0ec1fe44b954465f07b9eeb8795bcbfa1b7e99e1ec7 |
9166 |
-DIST DVDStyler-2.3.tar.bz2 4458253 SHA256 42030f845d24db229e6d5f74fc7ad3d0ec2f2fe6046657aa06c48356b94670b1 SHA512 f7005d0a04968ffa2250a6b298b6b9612dc70611619667455e728131a23ec53d1ee9212839f13426508e419b00aab4c646ff9722885940fef80418be3bc66e9a WHIRLPOOL b0ef1c4a49e54f80e8c9e70280676ba1dac216d5b8d81fac514d193b0fe63341473d0f9a20994a3bb8e2fb6960b6d8afae3809bbee81d1df490d23d95ff44c4d |
9167 |
-EBUILD dvdstyler-2.3.ebuild 1650 SHA256 20046e0f945e7d49343062e1f0865cd04b409a59616073d07732433f9c9b6bca SHA512 81b68756ae2994e40bdd76eaf7ebce0009d0239e1744244866c6e9fc2bfb53220829b085fa1bcba59e8e5eb20bdd70835127400e7b4c0c8aaf58f187ea6645c5 WHIRLPOOL 077e87e69df04243c2be9040685f1446c62ed3d5dc10fbabbdb6d70f11e71ac30536988e012c12c97c89afb38a790379cb6bac987a7be516f133dcc8e6bbccdc |
9168 |
-MISC ChangeLog 9870 SHA256 d06504f6cfe54236c1551ce3b265393ec95e32774e7fea0ce4a0d09ceecbb84a SHA512 5fa60e5faf5ef59ad026628775dfb4e2fbae886c269c20a1be60310757a97cb91325633a1039a3638ce26c8f1f048d865dfaae96e9a3aac1c530098f6da29397 WHIRLPOOL efe178a726ee10999665ff8e09e19125b2b642d3bc4033b543148fd7b490c5db691d4744226a03145bf7467a84c8817cbfe5ea88f5b37ff7b77511b9894328ea |
9169 |
-MISC metadata.xml 158 SHA256 f9dd4fb4a7f368e776ea0d7d394dad8f3a674e67f6103d6fb58a8a98971eeee4 SHA512 0bfb0265d3c42ba1958f8e589316112dba381e7701773668443cf0afe678a8d80675392efb2713e3d376b85b03a5b2bfb390c94411e0c6cf8a223b26aa9a04ca WHIRLPOOL 447b37b9f46058b1adc8d30a57460a8ab6b5ec149870c5ea385956cae9dd10a99b36e63526f2d13cabf13a4185f8b4e22a78156ab141a6e397bba298ab7efb2a |
9170 |
|
9171 |
diff --git a/media-video/dvdstyler/dvdstyler-2.3.ebuild b/media-video/dvdstyler/dvdstyler-2.3.ebuild |
9172 |
deleted file mode 100644 |
9173 |
index 3c0180b..0000000 |
9174 |
--- a/media-video/dvdstyler/dvdstyler-2.3.ebuild |
9175 |
+++ /dev/null |
9176 |
@@ -1,65 +0,0 @@ |
9177 |
-# Copyright 1999-2012 Gentoo Foundation |
9178 |
-# Distributed under the terms of the GNU General Public License v2 |
9179 |
-# $Header: /var/cvsroot/gentoo-x86/media-video/dvdstyler/dvdstyler-2.1.ebuild,v 1.4 2012/05/05 08:58:59 jdhore Exp $ |
9180 |
- |
9181 |
-EAPI=4 |
9182 |
- |
9183 |
-MY_P=${P/dvds/DVDS} |
9184 |
-WX_GTK_VER=2.8 |
9185 |
- |
9186 |
-inherit wxwidgets |
9187 |
- |
9188 |
-DESCRIPTION="A cross-platform free DVD authoring application" |
9189 |
-HOMEPAGE="http://www.dvdstyler.org/" |
9190 |
-SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2" |
9191 |
- |
9192 |
-LICENSE="GPL-2" |
9193 |
-SLOT="0" |
9194 |
-KEYWORDS="~amd64 ~x86" |
9195 |
-IUSE="debug gnome kernel_linux" |
9196 |
- |
9197 |
-COMMON_DEPEND=">=app-cdr/dvd+rw-tools-7.1 |
9198 |
- >=media-libs/libexif-0.6.16 |
9199 |
- >=media-libs/wxsvg-1.1.9 |
9200 |
- >=media-video/dvdauthor-0.7.0 |
9201 |
- >=media-video/xine-ui-0.99.1 |
9202 |
- virtual/cdrtools |
9203 |
- >=virtual/ffmpeg-0.6.90[encode] |
9204 |
- virtual/jpeg |
9205 |
- x11-libs/wxGTK:2.8[gstreamer,X] |
9206 |
- gnome? ( >=gnome-base/libgnomeui-2 ) |
9207 |
- kernel_linux? ( sys-fs/udev )" |
9208 |
-RDEPEND="${COMMON_DEPEND} |
9209 |
- >=app-cdr/dvdisaster-0.72.2" |
9210 |
-DEPEND="${COMMON_DEPEND} |
9211 |
- app-arch/zip |
9212 |
- app-text/xmlto |
9213 |
- virtual/pkgconfig |
9214 |
- sys-devel/gettext" |
9215 |
- |
9216 |
-S=${WORKDIR}/${MY_P} |
9217 |
- |
9218 |
-src_prepare() { |
9219 |
- use gnome || sed -i -e '/PKG_CONFIG/s:libgnomeui-2.0:dIsAbLeAuToMaGiC&:' configure |
9220 |
- |
9221 |
- # rmdir: failed to remove `tempfoobar': Directory not empty |
9222 |
- sed -i -e '/rmdir "$$t"/d' docs/Makefile.in || die |
9223 |
- |
9224 |
- sed -i -e 's:@LIBS@:& -ljpeg:' wxVillaLib/Makefile.in || die #367863 |
9225 |
- |
9226 |
- if has_version ">=media-video/ffmpeg-0.9"; then |
9227 |
- sed -i -e '/^#i/s:vsink_buffer:buffersink:' src/mediatrc_ffmpeg.cpp || die #395793 |
9228 |
- fi |
9229 |
-} |
9230 |
- |
9231 |
-src_configure() { |
9232 |
- econf \ |
9233 |
- --docdir=/usr/share/doc/${PF} \ |
9234 |
- $(use_enable debug) \ |
9235 |
- --with-wx-config=${WX_CONFIG} |
9236 |
-} |
9237 |
- |
9238 |
-src_install() { |
9239 |
- default |
9240 |
- rm -f "${ED}"usr/share/doc/${PF}/{COPYING*,INSTALL*} |
9241 |
-} |
9242 |
|
9243 |
diff --git a/media-video/dvdstyler/files/dvdstyler-1.7.4-autoconf.patch b/media-video/dvdstyler/files/dvdstyler-1.7.4-autoconf.patch |
9244 |
deleted file mode 100644 |
9245 |
index a9d6a2b..0000000 |
9246 |
--- a/media-video/dvdstyler/files/dvdstyler-1.7.4-autoconf.patch |
9247 |
+++ /dev/null |
9248 |
@@ -1,77 +0,0 @@ |
9249 |
---- /tmp/DVDStyler-1.7.4/./src/Makefile.am 2009-09-04 15:49:32.000000000 +1000 |
9250 |
-+++ ./src/Makefile.am 2009-10-14 15:34:46.000000000 +1100 |
9251 |
-@@ -7,7 +7,7 @@ |
9252 |
- VobListBox.cpp TitlePropDlg.cpp TitlesetManager.cpp\ |
9253 |
- BurnDlg.cpp ProgressDlg.cpp DirCtrl.cpp StatusBar.cpp MainWin.cpp dvdstyler.cpp |
9254 |
- |
9255 |
--CXXFLAGS = @CXXFLAGS@ -I.. |
9256 |
-+AM_CXXFLAGS = @CXXFLAGS@ -I.. |
9257 |
- LDADD = ../wxVillaLib/libwxvilla.a |
9258 |
- |
9259 |
- SUBDIRS = rc |
9260 |
---- /tmp/DVDStyler-1.7.4/./Makefile.am 2008-07-15 07:58:46.000000000 +1000 |
9261 |
-+++ ./Makefile.am 2009-10-14 15:23:26.000000000 +1100 |
9262 |
-@@ -1,6 +1,5 @@ |
9263 |
- SUBDIRS = wxVillaLib src locale backgrounds buttons objects data docs |
9264 |
- ACLOCAL_AMFLAGS=-I. |
9265 |
--pkgdatadir=@datadir@/doc/@PACKAGE@ |
9266 |
--pkgdata_DATA = AUTHORS COPYING INSTALL README ChangeLog |
9267 |
-+doc_DATA = AUTHORS COPYING INSTALL README ChangeLog |
9268 |
- run: all |
9269 |
- $(MAKE) -C src run |
9270 |
---- /tmp/DVDStyler-1.7.4/./wxVillaLib/Makefile.am 2007-12-31 09:51:35.000000000 +1100 |
9271 |
-+++ ./wxVillaLib/Makefile.am 2009-10-14 15:35:32.000000000 +1100 |
9272 |
-@@ -3,4 +3,4 @@ |
9273 |
- PipeExecute.cpp PropDlg.cpp SConv.cpp\ |
9274 |
- Thumbnails.cpp ThumbnailFactory.cpp\ |
9275 |
- utils.cpp VerticalToolbar.cpp |
9276 |
--CXXFLAGS = @CXXFLAGS@ @GNOMEUI2_CFLAGS@ @LIBEXIF_CFLAGS@ -DWX_SVG |
9277 |
-+AM_CXXFLAGS = @CXXFLAGS@ @GNOMEUI2_CFLAGS@ @LIBEXIF_CFLAGS@ -DWX_SVG |
9278 |
---- /tmp/DVDStyler-1.7.4/locale/Makefile.in 2009-09-19 18:46:38.000000000 +1000 |
9279 |
-+++ locale/Makefile.in 2009-10-14 15:46:49.000000000 +1100 |
9280 |
-@@ -4,8 +4,10 @@ |
9281 |
- # building lang.mo files from the translated lang.po catalogs. |
9282 |
- |
9283 |
- PROGNAME=dvdstyler |
9284 |
--LINGUAS=cs da de el es eu fr hu it ko mk nl pl pt pt_BR ru sk sl sr sv vi zh_TW |
9285 |
--LINGUAS_ALL=ca cs da de el es eu fr hu it ja ko mk nl pl pt pt_BR ru sk sl sr sv vi zh_TW |
9286 |
-+# ls *.po | cut -f1 -d . | xargs echo >> Makefile.in |
9287 |
-+LINGUAS=cs da de el es fr it ko mk pl pt pt_BR ru sl sr vi zh_TW |
9288 |
-+LINGUAS_ALL=cs da de el es fr it ko mk pl pt pt_BR ru sl sr vi zh_TW |
9289 |
-+ |
9290 |
- |
9291 |
- prefix=@prefix@ |
9292 |
- datarootdir=@datarootdir@ |
9293 |
---- /tmp/DVDStyler-1.7.4/docs/Makefile.am 2009-08-30 00:30:10.000000000 +1000 |
9294 |
-+++ docs/Makefile.am 2009-10-14 16:08:10.000000000 +1100 |
9295 |
-@@ -1,22 +1,19 @@ |
9296 |
--pkgdatadir=@datadir@/man/man1 |
9297 |
--pkgdata_DATA = dvdstyler.1 |
9298 |
-+dist_man_MANS = dvdstyler.1 |
9299 |
- |
9300 |
- LINGUAS=en de |
9301 |
--docdir=@datadir@/@PACKAGE@/docs |
9302 |
- doc_DATA = $(LINGUAS:%=help_%.zip) |
9303 |
- |
9304 |
- help%.zip: DVDStylerGuide%.xml |
9305 |
-- mkdir temp |
9306 |
-- (cd temp && $(XMLTO) --skip-validation htmlhelp ../DVDStylerGuide$*.xml && rm -f *.hh* && $(ZIP) ../help$*.zip *.html) |
9307 |
-- rm -f temp/*.html |
9308 |
-- rmdir temp |
9309 |
-+ t=`mktemp -d tempXXXXXXX`; \ |
9310 |
-+ (cd "$$t" && $(XMLTO) --skip-validation htmlhelp ../DVDStylerGuide$*.xml && rm -f *.hh* && $(ZIP) ../help$*.zip *.html) ; \ |
9311 |
-+ rm -f "$$t"/*.html ; \ |
9312 |
-+ rmdir "$$t" |
9313 |
- $(ZIP) help$*.zip htmlhelp.hhp toc.hhc images/*.png |
9314 |
- |
9315 |
- html: $(LINGUAS:%=html_%) |
9316 |
- |
9317 |
- html%: DVDStylerGuide%.xml |
9318 |
-- rm -rf html$* |
9319 |
-- mkdir html$* |
9320 |
-- (cd html$* && $(XMLTO) --skip-validation htmlhelp ../DVDStylerGuide$*.xml && rm -f *.hh*) |
9321 |
-- mkdir html$*/images |
9322 |
-+ t=`mktemp -d htmlXXXXXX` ; \ |
9323 |
-+ (cd "$$t" && $(XMLTO) --skip-validation htmlhelp ../DVDStylerGuide$*.xml && rm -f *.hh*) ; \ |
9324 |
-+ mkdir "$$t"/images |
9325 |
- cp images/*.png html$*/images/ |
9326 |
|
9327 |
diff --git a/media-video/dvdstyler/files/dvdstyler-1.8.1-cast.patch b/media-video/dvdstyler/files/dvdstyler-1.8.1-cast.patch |
9328 |
deleted file mode 100644 |
9329 |
index fb4bf90..0000000 |
9330 |
--- a/media-video/dvdstyler/files/dvdstyler-1.8.1-cast.patch |
9331 |
+++ /dev/null |
9332 |
@@ -1,11 +0,0 @@ |
9333 |
---- /tmp/imagjpg.cpp 2010-07-18 15:46:11.000000000 +1000 |
9334 |
-+++ ./wxVillaLib/imagjpg.cpp 2010-07-18 15:46:29.000000000 +1000 |
9335 |
-@@ -226,7 +226,7 @@ |
9336 |
- |
9337 |
- bool wxJPGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose, int WXUNUSED(index) ) |
9338 |
- { |
9339 |
-- wxCHECK_MSG( image, false, "NULL image pointer" ); |
9340 |
-+ wxCHECK_MSG( image, false, wxT("NULL image pointer") ); |
9341 |
- |
9342 |
- struct jpeg_decompress_struct cinfo; |
9343 |
- wx_error_mgr jerr; |
9344 |
|
9345 |
diff --git a/media-video/dvdstyler/files/dvdstyler-1.8.1-fix_enum_error.patch b/media-video/dvdstyler/files/dvdstyler-1.8.1-fix_enum_error.patch |
9346 |
deleted file mode 100644 |
9347 |
index a356310..0000000 |
9348 |
--- a/media-video/dvdstyler/files/dvdstyler-1.8.1-fix_enum_error.patch |
9349 |
+++ /dev/null |
9350 |
@@ -1,11 +0,0 @@ |
9351 |
---- DVDStyler-1.8.1/src/mediatrc_ffmpeg.cpp 2011-08-29 19:24:10.000000000 +0200 |
9352 |
-+++ DVDStyler-1.8.1-new/src/mediatrc_ffmpeg.cpp 2011-08-29 19:24:56.000000000 +0200 |
9353 |
-@@ -2242,7 +2242,7 @@ |
9354 |
- } else |
9355 |
- big_picture.quality = (int) ost->st->quality; |
9356 |
- if (!me_threshold) |
9357 |
-- big_picture.pict_type = 0; |
9358 |
-+ big_picture.pict_type = AV_PICTURE_TYPE_NONE; |
9359 |
- // big_picture.pts = AV_NOPTS_VALUE; |
9360 |
- big_picture.pts= ost->sync_opts; |
9361 |
- // big_picture.pts= av_rescale(ost->sync_opts, AV_TIME_BASE*(int64_t)enc->time_base.num, enc->time_base.den); |
9362 |
|
9363 |
diff --git a/media-video/dvdstyler/metadata.xml b/media-video/dvdstyler/metadata.xml |
9364 |
deleted file mode 100644 |
9365 |
index d9df187..0000000 |
9366 |
--- a/media-video/dvdstyler/metadata.xml |
9367 |
+++ /dev/null |
9368 |
@@ -1,5 +0,0 @@ |
9369 |
-<?xml version="1.0" encoding="UTF-8"?> |
9370 |
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
9371 |
-<pkgmetadata> |
9372 |
-<herd>video</herd> |
9373 |
-</pkgmetadata> |
9374 |
|
9375 |
diff --git a/net-news/rssguard/Manifest b/net-news/rssguard/Manifest |
9376 |
deleted file mode 100644 |
9377 |
index c2588da..0000000 |
9378 |
--- a/net-news/rssguard/Manifest |
9379 |
+++ /dev/null |
9380 |
@@ -1,3 +0,0 @@ |
9381 |
-DIST rssguard-3.4.0.tar.gz 5106275 SHA256 5c62e76fe8d3d0fe93234ddced8d97e871c7ff1d9c3cd28da853c8524cad3fd5 SHA512 9f71678354bff5d680234aa99f54452ce9185dc2a8ded835d30e264a9e13540b9b45bfe0e0234679629d8c85eebd3e25d0a94193cab7c9aac4b0d975d6c5ab61 WHIRLPOOL 9eae344e8231e41c3e4ef515d47dd0dd720ce4fdd68358d887780b2a6e618593ec6be98c7a436fb96ea66dedf64fb732e94556104b8582fd384640405c45a8a7 |
9382 |
-EBUILD rssguard-3.4.0.ebuild 984 SHA256 2f00bf17a970eb5966f130ebaeff34a6cea1f592acd4550acfa18006a9967d5e SHA512 561b9982db3badc86cb9d5f8b1831264e15d38c2c59ca01eca3e0341121bf1eacd663c847fe22e6093cd80de523eaf4d53781f690f7cc66fbea7009d29a3b345 WHIRLPOOL ce1780567c3381cb5d9f83c48caf727d7ae867933d1e29f034cb5012b3b2d6c0c5582ba3d102f89c62c8599930bc40b40fa0073434e98855c3ee1f2c54f78c08 |
9383 |
-EBUILD rssguard-9999.ebuild 984 SHA256 2f00bf17a970eb5966f130ebaeff34a6cea1f592acd4550acfa18006a9967d5e SHA512 561b9982db3badc86cb9d5f8b1831264e15d38c2c59ca01eca3e0341121bf1eacd663c847fe22e6093cd80de523eaf4d53781f690f7cc66fbea7009d29a3b345 WHIRLPOOL ce1780567c3381cb5d9f83c48caf727d7ae867933d1e29f034cb5012b3b2d6c0c5582ba3d102f89c62c8599930bc40b40fa0073434e98855c3ee1f2c54f78c08 |
9384 |
|
9385 |
diff --git a/net-news/rssguard/rssguard-3.4.0.ebuild b/net-news/rssguard/rssguard-3.4.0.ebuild |
9386 |
deleted file mode 100644 |
9387 |
index 8873eff..0000000 |
9388 |
--- a/net-news/rssguard/rssguard-3.4.0.ebuild |
9389 |
+++ /dev/null |
9390 |
@@ -1,39 +0,0 @@ |
9391 |
-# Copyright 1999-2017 Gentoo Foundation |
9392 |
-# Distributed under the terms of the GNU General Public License v2 |
9393 |
- |
9394 |
-EAPI=6 |
9395 |
- |
9396 |
-inherit qmake-utils |
9397 |
- |
9398 |
-if [[ ${PV} == *9999 ]]; then |
9399 |
- inherit git-r3 |
9400 |
- EGIT_REPO_URI="https://github.com/martinrotter/${PN}" |
9401 |
- EGIT_SUBMODULES=() |
9402 |
-else |
9403 |
- SRC_URI="https://github.com/martinrotter/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" |
9404 |
- KEYWORDS="~amd64" |
9405 |
-fi |
9406 |
- |
9407 |
-DESCRIPTION="Simple, light and easy-to-use RSS/ATOM feed aggregator developed using Qt framework" |
9408 |
-HOMEPAGE="https://github.com/martinrotter/rssguard" |
9409 |
- |
9410 |
-LICENSE="GPLv3" |
9411 |
-SLOT="0" |
9412 |
-IUSE="+webengine" |
9413 |
- |
9414 |
-# minimum Qt version required |
9415 |
-QT_PV="5.6.0:5" |
9416 |
- |
9417 |
-DEPEND=">=dev-qt/qtcore-${QT_PV} |
9418 |
- >=dev-qt/qtgui-${QT_PV} |
9419 |
- >=dev-qt/qtwidgets-${QT_PV} |
9420 |
- >=dev-qt/qtsql-${QT_PV} |
9421 |
- >=dev-qt/qtnetwork-${QT_PV} |
9422 |
- >=dev-qt/qtxml-${QT_PV} |
9423 |
- webengine? ( >=dev-qt/qtwebengine-${QT_PV}[widgets] )" |
9424 |
-RDEPEND="${DEPEND}" |
9425 |
- |
9426 |
-src_configure() { |
9427 |
- use webengine && WEBENGINE="true" || WEBENGINE="false" |
9428 |
- eqmake5 PREFIX="${D}" USE_WEBENGINE="${WEBENGINE}" |
9429 |
-} |
9430 |
|
9431 |
diff --git a/net-news/rssguard/rssguard-9999.ebuild b/net-news/rssguard/rssguard-9999.ebuild |
9432 |
deleted file mode 100644 |
9433 |
index 8873eff..0000000 |
9434 |
--- a/net-news/rssguard/rssguard-9999.ebuild |
9435 |
+++ /dev/null |
9436 |
@@ -1,39 +0,0 @@ |
9437 |
-# Copyright 1999-2017 Gentoo Foundation |
9438 |
-# Distributed under the terms of the GNU General Public License v2 |
9439 |
- |
9440 |
-EAPI=6 |
9441 |
- |
9442 |
-inherit qmake-utils |
9443 |
- |
9444 |
-if [[ ${PV} == *9999 ]]; then |
9445 |
- inherit git-r3 |
9446 |
- EGIT_REPO_URI="https://github.com/martinrotter/${PN}" |
9447 |
- EGIT_SUBMODULES=() |
9448 |
-else |
9449 |
- SRC_URI="https://github.com/martinrotter/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" |
9450 |
- KEYWORDS="~amd64" |
9451 |
-fi |
9452 |
- |
9453 |
-DESCRIPTION="Simple, light and easy-to-use RSS/ATOM feed aggregator developed using Qt framework" |
9454 |
-HOMEPAGE="https://github.com/martinrotter/rssguard" |
9455 |
- |
9456 |
-LICENSE="GPLv3" |
9457 |
-SLOT="0" |
9458 |
-IUSE="+webengine" |
9459 |
- |
9460 |
-# minimum Qt version required |
9461 |
-QT_PV="5.6.0:5" |
9462 |
- |
9463 |
-DEPEND=">=dev-qt/qtcore-${QT_PV} |
9464 |
- >=dev-qt/qtgui-${QT_PV} |
9465 |
- >=dev-qt/qtwidgets-${QT_PV} |
9466 |
- >=dev-qt/qtsql-${QT_PV} |
9467 |
- >=dev-qt/qtnetwork-${QT_PV} |
9468 |
- >=dev-qt/qtxml-${QT_PV} |
9469 |
- webengine? ( >=dev-qt/qtwebengine-${QT_PV}[widgets] )" |
9470 |
-RDEPEND="${DEPEND}" |
9471 |
- |
9472 |
-src_configure() { |
9473 |
- use webengine && WEBENGINE="true" || WEBENGINE="false" |
9474 |
- eqmake5 PREFIX="${D}" USE_WEBENGINE="${WEBENGINE}" |
9475 |
-} |