2to3 "imports" tables (multiple)

This commit is contained in:
Mark Pilgrim
2009-01-27 00:58:58 -05:00
parent 087d014ff4
commit 17b15123ed
+214 -4
View File
@@ -12,8 +12,11 @@ window.onload = function() {
var arTables = document.getElementsByTagName('table');
for (var i = arTables.length - 1; i >= 0; i--) {
var elmTable = arTables[i];
var arNotes = document.getElementById("skip" + elmTable.id).getElementsByTagName('li');
var olNotes = document.getElementById("skip" + elmTable.id);
if (!olNotes) { continue; }
var arNotes = olNotes.getElementsByTagName('li');
var arTableRows = elmTable.getElementsByTagName('tr');
if (arNotes.length != arTableRows.length - 1) { continue; }
for (var j = arTableRows.length - 1; j >= 1; j--) {
var elmTableRow = arTableRows[j];
var elmNote = arNotes[j - 1];
@@ -894,7 +897,7 @@ except:
<h2 id="imports">imports</h2>
<p>FIXME intro</p>
<p>this includes fixer_imports, fixer_imports2, fixer_urllib</p>
<p><a class="skip" href="#skipcompareimports">skip over this table</a></p>
<table id="compareimports">
<tr>
<th>Notes</th>
@@ -903,13 +906,220 @@ except:
</tr>
<tr>
<th>&#x2460;</th>
<td><code>FIXME</code></td>
<td><code>FIXME</code></td>
<td><pre><code>import StringIO
import cStringIO</code></pre></td>
<td><code>import io</code></td>
</tr>
<tr>
<th>&#x2461;</th>
<td><code>import cPickle</code></td>
<td><code>import pickle</code></td>
</tr>
<tr>
<th>&#x2462;</th>
<td><code>import __builtin__</code></td>
<td><code>import builtins</code></td>
</tr>
<tr>
<th>&#x2463;</th>
<td><code>import copy_reg</code></td>
<td><code>import copyreg</code></td>
</tr>
<tr>
<th>&#x2464;</th>
<td><code>import Queue</code></td>
<td><code>import queue</code></td>
</tr>
<tr>
<th>&#x2465;</th>
<td><code>import SocketServer</code></td>
<td><code>import socketserver</code></td>
</tr>
<tr>
<th>&#x2466;</th>
<td><code>import ConfigParser</code></td>
<td><code>import configparser</code></td>
</tr>
<tr>
<th>&#x2467;</th>
<td><code>import repr</code></td>
<td><code>import reprlib</code></td>
</tr>
<tr>
<th>&#x2468;</th>
<td><code>import commands</code></td>
<td><code>import subprocess</code></td>
</tr>
</table>
<ol id="skipcompareimports">
<li>...</li>
<li>...</li>
<li>...</li>
<li>...</li>
<li>...</li>
<li>...</li>
<li>...</li>
<li>...</li>
<li>...</li>
</ol>
<p><a class="skip" href="#skipcompareimportdbm">skip over this table</a></p>
<table id="compareimportdbm">
<tr>
<th>Notes</th>
<th>Python 2</th>
<th>Python 3</th>
</tr>
<tr>
<th>&#x2460;</th>
<td><code>import dbm</code></td>
<td><code>import dbm.ndbm</code></td>
</tr>
<tr>
<th>&#x2461;</th>
<td><code>import gdbm</code></td>
<td><code>import dbm.gnu</code></td>
</tr>
<tr>
<th>&#x2462;</th>
<td><code>import dbhash</code></td>
<td><code>import dbm.bsd</code></td>
</tr>
<tr>
<th>&#x2463;</th>
<td><code>import dumbdbm</code></td>
<td><code>import dbm.dumb</code></td>
</tr>
<tr>
<th>&#x2464;</th>
<td><pre><code>import anydbm
import whichdb</code></pre></td>
<td><code>import dbm</code></td>
</tr>
</table>
<ol id="skipcompareimportdbm">
<li>...</li>
<li>...</li>
<li>...</li>
<li>...</li>
<li>...</li>
</ol>
<p><a class="skip" href="#skipcompareimportxmlrpc">skip over this table</a></p>
<table id="compareimportxmlrpc">
<tr>
<th>Notes</th>
<th>Python 2</th>
<th>Python 3</th>
</tr>
<tr>
<th>&#x2460;</th>
<td><code>import xmlrpclib</code></td>
<td><code>import xmlrpc.client</code></td>
</tr>
<tr>
<th>&#x2461;</th>
<td><pre><code>import DocXMLRPCServer
import SimpleXMLRPCServer</code></pre></td>
<td><code>import xmlrpc.server</code></td>
</tr>
</table>
<ol id="skipcompareimportxmlrpc">
<li>...</li>
<li>...</li>
</ol>
<p><a class="skip" href="#skipcompareimporthttp">skip over this table</a></p>
<table id="compareimporthttp">
<tr>
<th>Notes</th>
<th>Python 2</th>
<th>Python 3</th>
</tr>
<tr>
<th>&#x2460;</th>
<td><code>import httplib</code></td>
<td><code>import http.client</code></td>
</tr>
<tr>
<th>&#x2461;</th>
<td><code>import Cookie</code></td>
<td><code>import http.cookies</code></td>
</tr>
<tr>
<th>&#x2462;</th>
<td><code>import cookielib</code></td>
<td><code>import http.cookiejar</code></td>
</tr>
<tr>
<th>&#x2463;</th>
<td><pre><code>import BaseHTTPServer
import SimpleHTTPServer
import CGIHttpServer</code></pre></td>
<td><code>import http.server</code></td>
</tr>
</table>
<ol id="skipcompareimporthttp">
<li>...</li>
<li>...</li>
<li>...</li>
<li>...</li>
</ol>
<p><a class="skip" href="#skipcompareimporturllib">skip over this table</a></p>
<table id="compareimporturllib">
<tr>
<th>Notes</th>
<th>Python 2</th>
<th>Python 3</th>
</tr>
<tr>
<th>&#x2460;</th>
<td><code>import urllib</code></td>
<td><code>import urllib.request, urllib.parse, urllib.error</code></td>
</tr>
<tr>
<th>&#x2461;</th>
<td><code>import urllib2</code></td>
<td><code>import urllib.request, urllib.error</code></td>
</tr>
<tr>
<th>&#x2462;</th>
<td><code>import urlparse</code></td>
<td><code>import urllib.parse</code></td>
</tr>
<tr>
<th>&#x2463;</th>
<td><code>import robotparser</code></td>
<td><code>import urllib.robotparser</code></td>
</tr>
<tr>
<th>&#x2464;</th>
<td><pre><code>from urllib import FancyURLOpener
from urllib import urlencode</code></pre></td>
<td><pre><code>from urllib.request import FancyURLOpener
from urllib.parse import urlencode</code></pre></td>
</tr>
<tr>
<th>&#x2465;</th>
<td><pre><code>from urllib2 import Request
from urllib2 import HTTPError</code></pre></td>
<td><pre><code>from urllib.request import Request
from urllib.error import HTTPError</code></pre></td>
</tr>
</table>
<ol id="skipcompareimporturllib">
<li>...</li>
<li>...</li>
<li>...</li>
<li>...</li>
<li>...</li>
<li>...</li>
</ol>
</section>