Compare commits
67 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d06d9be97 | |||
| d1206c3bd8 | |||
| d5b5432fb9 | |||
| 5d823c15cc | |||
| 3b12d8bdb1 | |||
| c198e7d8bf | |||
| a2db4ce5ae | |||
| 0e5ae4dd68 | |||
| 0d4bb5bbd6 | |||
| ee53992acc | |||
| 45736d1771 | |||
| de2673174f | |||
| 1c318bd34d | |||
| e99684a47d | |||
| f8dcd2f401 | |||
| a43601cffd | |||
| 71cc64977b | |||
| 0cd2814fa7 | |||
| 97268211ff | |||
| 9962c452d8 | |||
| abf8fde9f5 | |||
| 1311cf3c63 | |||
| 59e2665de9 | |||
| 05cc5b06c7 | |||
| 54c68bab99 | |||
| 5dc1f4d325 | |||
| 8bede453ae | |||
| 8cbac7a75e | |||
| 1b31d9091a | |||
| eaf50be2ca | |||
| b24f993780 | |||
| e0bf25d72c | |||
| a4a854a2a8 | |||
| a186bf439c | |||
| a6daa709e9 | |||
| 22f98eaa4b | |||
| 38504ab03a | |||
| 1b8a867fbf | |||
| 9a9bd6c60f | |||
| 6002fbaa98 | |||
| e869e16d9f | |||
| 3a5ad68013 | |||
| b8dc49ef84 | |||
| 140f26977a | |||
| d96cf37147 | |||
| 20f1c1d337 | |||
| f32ca9e9fa | |||
| a06e79102d | |||
| 0e2c486178 | |||
| 950bae882b | |||
| 683f3b5bbc | |||
| 5490144788 | |||
| 42a3f98495 | |||
| c395d76231 | |||
| b2d2346eb7 | |||
| ffb33f61a9 | |||
| adbeac9684 | |||
| 4aac47e639 | |||
| 2028c69b3f | |||
| 2649cd268c | |||
| 46b446f0c8 | |||
| 6208cbee02 | |||
| 1d4c3f99b2 | |||
| ba30e74dc9 | |||
| 0e8b97ca40 | |||
| a95ae5126b | |||
| 0e2f859839 |
+31
@@ -0,0 +1,31 @@
|
||||
/OBITools-1.1.19/
|
||||
/OBITools-1.1.20/
|
||||
/OBITools-1.1.21/
|
||||
/OBITools-1.1.22/
|
||||
/OBITools-1.2.0/
|
||||
/obitools.test/
|
||||
/build/
|
||||
/dist/
|
||||
/OBITools-1.2.2/
|
||||
/OBITools-1.2.3/
|
||||
/OBITools-1.2.4/
|
||||
/OBITools-1.2.5/
|
||||
/OBITools-1.2.6/
|
||||
/OBITools-1.2.7/
|
||||
/OBITools-1.2.8/
|
||||
/OBITools-1.2.9/
|
||||
/OBITools-1.2.10/
|
||||
/OBITools-1.2.11/
|
||||
/OBITools-1.2.12/
|
||||
/OBITools-1.2.13/
|
||||
/OBITools-py3/
|
||||
/.DS_Store
|
||||
/obitools.test.old/
|
||||
/coucou
|
||||
/toto.fasta
|
||||
convert_2to3.log
|
||||
distutils_convert_2to3.log
|
||||
setup.py.p2
|
||||
requirements.txt.old
|
||||
/distutils.ext3
|
||||
/src3
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?eclipse-pydev version="1.0"?><pydev_project>
|
||||
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
|
||||
<path>/obitools/src</path>
|
||||
<path>/OBITools-1.1/src</path>
|
||||
<path>/${PROJECT_DIR_NAME}/distutils.ext</path>
|
||||
</pydev_pathproperty>
|
||||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
*.pyc
|
||||
/.DS_Store
|
||||
@@ -0,0 +1 @@
|
||||
/*.pyc
|
||||
@@ -0,0 +1 @@
|
||||
/*.pyc
|
||||
@@ -3,5 +3,5 @@ def build_ext(*args,**kargs):
|
||||
'''
|
||||
Wrapper over the build_ext class to postpone the import of cython
|
||||
'''
|
||||
from build_ext import build_ext as _build_ext
|
||||
from .build_ext import build_ext as _build_ext
|
||||
return _build_ext(*args,**kargs)
|
||||
|
||||
@@ -38,8 +38,8 @@ class build(ori_build):
|
||||
('build_ctools', has_ctools),
|
||||
('build_files', has_files),
|
||||
('build_cexe', has_executables)] \
|
||||
+ ori_build.sub_commands + \
|
||||
[('build_sphinx',has_doc)]
|
||||
+ ori_build.sub_commands # + \
|
||||
# [('build_sphinx',has_doc)]
|
||||
|
||||
def run(self):
|
||||
log.info('\n\nRunning obidistutils build process\n\n')
|
||||
|
||||
@@ -52,21 +52,20 @@ class build_cexe(build_ctools):
|
||||
name of the built file (see --> build_files)
|
||||
"""
|
||||
sources = list(sources)
|
||||
for i in xrange(len(sources)):
|
||||
print exe_name,sources[i],
|
||||
for i in range(len(sources)):
|
||||
print(exe_name,sources[i], end=' ')
|
||||
if sources[i][0]=='@':
|
||||
try:
|
||||
filename = self.built_files[sources[i][1:]]
|
||||
except KeyError:
|
||||
raise DistutilsSetupError, \
|
||||
('The %s filename declared in the source '
|
||||
raise DistutilsSetupError(('The %s filename declared in the source '
|
||||
'files of the program %s have not been '
|
||||
'built by the installation process') % (sources[i],
|
||||
exe_name)
|
||||
exe_name))
|
||||
sources[i]=filename
|
||||
print "changed to ",filename
|
||||
print("changed to ",filename)
|
||||
else:
|
||||
print " ok"
|
||||
print(" ok")
|
||||
|
||||
return sources
|
||||
|
||||
|
||||
@@ -124,30 +124,25 @@ class build_exe(Command):
|
||||
just returns otherwise.
|
||||
"""
|
||||
if not isinstance(executables, list):
|
||||
raise DistutilsSetupError, \
|
||||
"'executables' option must be a list of tuples"
|
||||
raise DistutilsSetupError("'executables' option must be a list of tuples")
|
||||
|
||||
for exe in executables:
|
||||
if not isinstance(exe, tuple) and len(exe) != 2:
|
||||
raise DistutilsSetupError, \
|
||||
"each element of 'executables' must a 2-tuple"
|
||||
raise DistutilsSetupError("each element of 'executables' must a 2-tuple")
|
||||
|
||||
name, build_info = exe
|
||||
|
||||
if not isinstance(name, str):
|
||||
raise DistutilsSetupError, \
|
||||
"first element of each tuple in 'executables' " + \
|
||||
"must be a string (the executables name)"
|
||||
raise DistutilsSetupError("first element of each tuple in 'executables' " + \
|
||||
"must be a string (the executables name)")
|
||||
if '/' in name or (os.sep != '/' and os.sep in name):
|
||||
raise DistutilsSetupError, \
|
||||
("bad executable name '%s': " +
|
||||
raise DistutilsSetupError(("bad executable name '%s': " +
|
||||
"may not contain directory separators") % \
|
||||
exe[0]
|
||||
exe[0])
|
||||
|
||||
if not isinstance(build_info, dict):
|
||||
raise DistutilsSetupError, \
|
||||
"second element of each tuple in 'executables' " + \
|
||||
"must be a dictionary (build info)"
|
||||
raise DistutilsSetupError("second element of each tuple in 'executables' " + \
|
||||
"must be a dictionary (build info)")
|
||||
|
||||
def get_executable_names(self):
|
||||
# Assume the executables list is valid -- 'check_executable_list()' is
|
||||
@@ -167,10 +162,9 @@ class build_exe(Command):
|
||||
for (exe_name, build_info) in self.executables:
|
||||
sources = build_info.get('sources')
|
||||
if sources is None or not isinstance(sources, (list, tuple)):
|
||||
raise DistutilsSetupError, \
|
||||
("in 'executables' option (library '%s'), "
|
||||
raise DistutilsSetupError(("in 'executables' option (library '%s'), "
|
||||
"'sources' must be present and must be "
|
||||
"a list of source filenames") % exe_name
|
||||
"a list of source filenames") % exe_name)
|
||||
|
||||
filenames.extend(sources)
|
||||
return filenames
|
||||
@@ -182,10 +176,9 @@ class build_exe(Command):
|
||||
for (exe_name, build_info) in executables:
|
||||
sources = build_info.get('sources')
|
||||
if sources is None or not isinstance(sources, (list, tuple)):
|
||||
raise DistutilsSetupError, \
|
||||
("in 'executables' option (library '%s'), " +
|
||||
raise DistutilsSetupError(("in 'executables' option (library '%s'), " +
|
||||
"'sources' must be present and must be " +
|
||||
"a list of source filenames") % exe_name
|
||||
"a list of source filenames") % exe_name)
|
||||
sources = self.substitute_sources(exe_name,sources)
|
||||
|
||||
log.info("building '%s' program", exe_name)
|
||||
|
||||
@@ -23,7 +23,7 @@ from distutils.errors import DistutilsSetupError
|
||||
|
||||
class build_ext(ori_build_ext):
|
||||
def modifyDocScripts(self):
|
||||
print >>open("doc/sphinx/build_dir.txt","w"),self.build_lib
|
||||
print(self.build_lib, file=open("doc/sphinx/build_dir.txt","w"))
|
||||
|
||||
def initialize_options(self):
|
||||
ori_build_ext.initialize_options(self) # @UndefinedVariable
|
||||
@@ -54,8 +54,8 @@ class build_ext(ori_build_ext):
|
||||
name of the built file (see --> build_files)
|
||||
"""
|
||||
sources = list(sources)
|
||||
for i in xrange(len(sources)):
|
||||
print exe_name,sources[i],
|
||||
for i in range(len(sources)):
|
||||
print(exe_name,sources[i], end=' ')
|
||||
if sources[i][0]=='@':
|
||||
try:
|
||||
filename = self.built_files[sources[i][1:]]
|
||||
@@ -64,15 +64,14 @@ class build_ext(ori_build_ext):
|
||||
if os.path.isfile (tmpfilename):
|
||||
filename = tmpfilename
|
||||
else:
|
||||
raise DistutilsSetupError, \
|
||||
('The %s filename declared in the source '
|
||||
raise DistutilsSetupError(('The %s filename declared in the source '
|
||||
'files of the program %s have not been '
|
||||
'built by the installation process') % (sources[i],
|
||||
exe_name)
|
||||
exe_name))
|
||||
sources[i]=filename
|
||||
print "changed to ",filename
|
||||
print("changed to ",filename)
|
||||
else:
|
||||
print " ok"
|
||||
print(" ok")
|
||||
|
||||
return sources
|
||||
|
||||
@@ -85,7 +84,7 @@ class build_ext(ori_build_ext):
|
||||
self.check_extensions_list(self.extensions)
|
||||
|
||||
for ext in self.extensions:
|
||||
print "#####>",ext.sources
|
||||
print("#####>",ext.sources)
|
||||
ext.sources = self.cython_sources(ext.sources, ext)
|
||||
self.build_extension(ext)
|
||||
|
||||
|
||||
@@ -7,29 +7,31 @@ Created on 20 oct. 2012
|
||||
import os.path
|
||||
|
||||
from distutils.command.build_scripts import build_scripts as ori_build_scripts,\
|
||||
first_line_re
|
||||
first_line_re
|
||||
from distutils.util import convert_path
|
||||
from distutils import log, sysconfig
|
||||
from distutils.dep_util import newer
|
||||
from stat import ST_MODE
|
||||
|
||||
import tokenize
|
||||
|
||||
|
||||
class build_scripts(ori_build_scripts):
|
||||
|
||||
def copy_scripts (self):
|
||||
"""Copy each script listed in 'self.scripts'; if it's marked as a
|
||||
def copy_scripts(self):
|
||||
r"""Copy each script listed in 'self.scripts'; if it's marked as a
|
||||
Python script in the Unix way (first line matches 'first_line_re',
|
||||
ie. starts with "\#!" and contains "python"), then adjust the first
|
||||
line to refer to the current Python interpreter as we copy.
|
||||
"""
|
||||
"""
|
||||
self.mkpath(self.build_dir)
|
||||
rawbuild_dir = os.path.join(os.path.dirname(self.build_dir),'raw_scripts')
|
||||
self.mkpath(rawbuild_dir)
|
||||
|
||||
updated_files = []
|
||||
outfiles = []
|
||||
for script in self.scripts:
|
||||
adjust = 0
|
||||
adjust = False
|
||||
script = convert_path(script)
|
||||
outfile = os.path.join(self.build_dir, os.path.splitext(os.path.basename(script))[0])
|
||||
rawoutfile = os.path.join(rawbuild_dir, os.path.basename(script))
|
||||
@@ -39,16 +41,18 @@ class build_scripts(ori_build_scripts):
|
||||
log.debug("not copying %s (up-to-date)", script)
|
||||
continue
|
||||
|
||||
# Always open the file but ignore failures in dry-run mode --
|
||||
# Always open the file, but ignore failures in dry-run mode --
|
||||
# that way, we'll get accurate feedback if we can read the
|
||||
# script.
|
||||
try:
|
||||
f = open(script, "r")
|
||||
except IOError:
|
||||
f = open(script, "rb")
|
||||
except OSError:
|
||||
if not self.dry_run:
|
||||
raise
|
||||
f = None
|
||||
else:
|
||||
encoding, lines = tokenize.detect_encoding(f.readline)
|
||||
f.seek(0)
|
||||
first_line = f.readline()
|
||||
if not first_line:
|
||||
self.warn("%s is an empty file (skipping)" % script)
|
||||
@@ -56,8 +60,8 @@ class build_scripts(ori_build_scripts):
|
||||
|
||||
match = first_line_re.match(first_line)
|
||||
if match:
|
||||
adjust = 1
|
||||
post_interp = match.group(1) or ''
|
||||
adjust = True
|
||||
post_interp = match.group(1) or b''
|
||||
|
||||
log.info("Store the raw script %s -> %s", script,rawoutfile)
|
||||
self.copy_file(script, rawoutfile)
|
||||
@@ -66,26 +70,47 @@ class build_scripts(ori_build_scripts):
|
||||
if adjust:
|
||||
log.info("copying and adjusting %s -> %s", script,
|
||||
self.build_dir)
|
||||
updated_files.append(outfile)
|
||||
if not self.dry_run:
|
||||
outf = open(outfile, "w")
|
||||
if not sysconfig.python_build:
|
||||
outf.write("#!%s%s\n" %
|
||||
(self.executable,
|
||||
post_interp))
|
||||
executable = self.executable
|
||||
else:
|
||||
outf.write("#!%s%s\n" %
|
||||
(os.path.join(
|
||||
executable = os.path.join(
|
||||
sysconfig.get_config_var("BINDIR"),
|
||||
"python%s%s" % (sysconfig.get_config_var("VERSION"),
|
||||
sysconfig.get_config_var("EXE"))),
|
||||
post_interp))
|
||||
outf.writelines(f.readlines())
|
||||
outf.close()
|
||||
sysconfig.get_config_var("EXE")))
|
||||
executable = os.fsencode(executable)
|
||||
shebang = b"#!" + executable + post_interp + b"\n"
|
||||
# Python parser starts to read a script using UTF-8 until
|
||||
# it gets a #coding:xxx cookie. The shebang has to be the
|
||||
# first line of a file, the #coding:xxx cookie cannot be
|
||||
# written before. So the shebang has to be decodable from
|
||||
# UTF-8.
|
||||
try:
|
||||
shebang.decode('utf-8')
|
||||
except UnicodeDecodeError:
|
||||
raise ValueError(
|
||||
"The shebang ({!r}) is not decodable "
|
||||
"from utf-8".format(shebang))
|
||||
# If the script is encoded to a custom encoding (use a
|
||||
# #coding:xxx cookie), the shebang has to be decodable from
|
||||
# the script encoding too.
|
||||
try:
|
||||
shebang.decode(encoding)
|
||||
except UnicodeDecodeError:
|
||||
raise ValueError(
|
||||
"The shebang ({!r}) is not decodable "
|
||||
"from the script encoding ({})"
|
||||
.format(shebang, encoding))
|
||||
with open(outfile, "wb") as outf:
|
||||
outf.write(shebang)
|
||||
outf.writelines(f.readlines())
|
||||
if f:
|
||||
f.close()
|
||||
else:
|
||||
if f:
|
||||
f.close()
|
||||
updated_files.append(outfile)
|
||||
self.copy_file(script, outfile)
|
||||
|
||||
if os.name == 'posix':
|
||||
@@ -93,10 +118,11 @@ class build_scripts(ori_build_scripts):
|
||||
if self.dry_run:
|
||||
log.info("changing mode of %s", F)
|
||||
else:
|
||||
oldmode = os.stat(F)[ST_MODE] & 07777
|
||||
newmode = (oldmode | 0555) & 07777
|
||||
oldmode = os.stat(F)[ST_MODE] & 0o7777
|
||||
newmode = (oldmode | 0o555) & 0o7777
|
||||
if newmode != oldmode:
|
||||
log.info("changing mode of %s from %o to %o",
|
||||
F, oldmode, newmode)
|
||||
os.chmod(F, newmode)
|
||||
|
||||
# XXX should we modify self.outfiles?
|
||||
return outfiles, updated_files
|
||||
|
||||
@@ -13,26 +13,29 @@ import sys
|
||||
|
||||
try:
|
||||
from sphinx.setup_command import BuildDoc as ori_build_sphinx
|
||||
|
||||
class build_sphinx(ori_build_sphinx):
|
||||
'''
|
||||
Build Sphinx documentation in html, epub and man formats
|
||||
'''
|
||||
|
||||
description = __doc__
|
||||
|
||||
def run(self):
|
||||
self.builder='html'
|
||||
self.finalize_options()
|
||||
ori_build_sphinx.run(self)
|
||||
self.builder='epub'
|
||||
self.finalize_options()
|
||||
ori_build_sphinx.run(self)
|
||||
self.builder='man'
|
||||
self.finalize_options()
|
||||
ori_build_sphinx.run(self)
|
||||
|
||||
except ImportError:
|
||||
if not is_serenity() and install_requirements():
|
||||
log.info("Restarting installation with all dependencies ok")
|
||||
rerun_with_anothe_python(os.path.realpath(sys.executable))
|
||||
|
||||
|
||||
class build_sphinx(ori_build_sphinx):
|
||||
'''
|
||||
Build Sphinx documentation in html, epub and man formats
|
||||
'''
|
||||
|
||||
description = __doc__
|
||||
|
||||
def run(self):
|
||||
self.builder='html'
|
||||
self.finalize_options()
|
||||
ori_build_sphinx.run(self)
|
||||
self.builder='epub'
|
||||
self.finalize_options()
|
||||
ori_build_sphinx.run(self)
|
||||
self.builder='man'
|
||||
self.finalize_options()
|
||||
ori_build_sphinx.run(self)
|
||||
|
||||
@@ -18,7 +18,7 @@ class install(install_ori):
|
||||
def __init__(self,dist):
|
||||
install_ori.__init__(self, dist)
|
||||
self.sub_commands.insert(0, ('build',lambda self: True))
|
||||
self.sub_commands.append(('install_sphinx',lambda self: self.distribution.serenity))
|
||||
# self.sub_commands.append(('install_sphinx',lambda self: self.distribution.serenity))
|
||||
|
||||
def run(self):
|
||||
log.info('\n\nRunning obidistutils install process\n\n')
|
||||
|
||||
@@ -4,13 +4,6 @@ Created on 20 oct. 2012
|
||||
@author: coissac
|
||||
'''
|
||||
|
||||
from os import path
|
||||
import os.path
|
||||
import glob
|
||||
import sys
|
||||
from obidistutils.command.sdist import sdist
|
||||
|
||||
|
||||
try:
|
||||
from setuptools import setup as ori_setup
|
||||
from setuptools.command.egg_info import egg_info
|
||||
@@ -19,6 +12,14 @@ except ImportError:
|
||||
from distutils.core import setup as ori_setup
|
||||
has_setuptools = False
|
||||
|
||||
from os import path
|
||||
import os.path
|
||||
import glob
|
||||
import sys
|
||||
from obidistutils.command.sdist import sdist
|
||||
from distutils import log
|
||||
|
||||
|
||||
from distutils.extension import Extension
|
||||
|
||||
from obidistutils.command.build import build
|
||||
@@ -67,7 +68,7 @@ def findCython(root,base=None,pyrexs=None):
|
||||
if y[0] !='@' else y.strip()
|
||||
for y in cfiles]
|
||||
|
||||
print "@@@@>",cfiles
|
||||
print("@@@@>",cfiles)
|
||||
incdir = set(os.path.dirname(x) for x in cfiles if x[-2:]==".h")
|
||||
cfiles = [x for x in cfiles if x[-2:]==".c"]
|
||||
pyrexs[-1].sources.extend(cfiles)
|
||||
@@ -77,10 +78,11 @@ def findCython(root,base=None,pyrexs=None):
|
||||
except IOError:
|
||||
pass
|
||||
pyrexs[-1].sources.extend(glob.glob(os.path.splitext(pyrex)[0]+'.ext.*.c'))
|
||||
print pyrexs[-1].sources
|
||||
print(pyrexs[-1].sources)
|
||||
# Main.compile([pyrex],timestamps=True)
|
||||
|
||||
pyrexs.extend(findCython(path.join(root,module),base+[module]))
|
||||
print(pyrexs)
|
||||
return pyrexs
|
||||
|
||||
def findC(root,base=None,pyrexs=None):
|
||||
@@ -109,7 +111,7 @@ def findC(root,base=None,pyrexs=None):
|
||||
except IOError:
|
||||
pass
|
||||
pyrexs[-1].sources.extend(glob.glob(os.path.splitext(pyrex)[0]+'.ext.*.c'))
|
||||
print pyrexs[-1].sources
|
||||
print(pyrexs[-1].sources)
|
||||
|
||||
pyrexs.extend(findC(path.join(root,module),base+[module]))
|
||||
return pyrexs
|
||||
@@ -173,6 +175,8 @@ def setup(**attrs):
|
||||
|
||||
if 'packages' not in attrs:
|
||||
attrs['packages'] = findPackage(SRC)
|
||||
|
||||
log.debug(attrs['packages'])
|
||||
|
||||
if 'cmdclass' not in attrs:
|
||||
attrs['cmdclass'] = COMMANDS
|
||||
@@ -201,7 +205,5 @@ def setup(**attrs):
|
||||
|
||||
if 'ext_modules' not in attrs:
|
||||
attrs['ext_modules'] = EXTENTION
|
||||
|
||||
print "$$$$$$$$$$$$$$$$$$$$$$$$$$$",COMMANDS
|
||||
|
||||
|
||||
ori_setup(**attrs)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/*.pyc
|
||||
@@ -9,7 +9,7 @@ import os
|
||||
import subprocess
|
||||
import re
|
||||
from distutils.errors import DistutilsError
|
||||
import urllib2
|
||||
import urllib.request, urllib.error, urllib.parse
|
||||
import tempfile
|
||||
|
||||
import importlib
|
||||
@@ -20,7 +20,7 @@ import argparse
|
||||
|
||||
import base64
|
||||
|
||||
from checkpython import is_mac_system_python, \
|
||||
from .checkpython import is_mac_system_python, \
|
||||
is_python27, \
|
||||
is_a_virtualenv_python, \
|
||||
which_virtualenv, \
|
||||
@@ -50,7 +50,7 @@ def serenity_snake(envname,package,version,minversion=PIP_MINVERSION):
|
||||
|
||||
log.info("Installing %s (%s) in serenity mode" % (package,version))
|
||||
|
||||
print >>sys.stderr,snake
|
||||
print(snake, file=sys.stderr)
|
||||
sys.stderr.flush()
|
||||
|
||||
enforce_good_python()
|
||||
|
||||
@@ -140,7 +140,7 @@ def parse_package_requirement(requirement):
|
||||
if requirement_relation is not None:
|
||||
requirement_relation=requirement_relation.group(0)
|
||||
except:
|
||||
raise DistutilsError,"Requirement : %s not correctly formated" % requirement
|
||||
raise DistutilsError("Requirement : %s not correctly formated" % requirement)
|
||||
|
||||
return requirement_project,requirement_relation,requirement_version
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ def get_a_cython_module(pip=None):
|
||||
log.debug('temp install dir : %s' % tmpdir)
|
||||
|
||||
if ok!=0:
|
||||
raise DistutilsError, "I cannot install a cython package"
|
||||
raise DistutilsError("I cannot install a cython package")
|
||||
|
||||
f, filename, description = imp.find_module('Cython', [tmpdir])
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/*.pyc
|
||||
@@ -91,7 +91,7 @@ def autocomplete():
|
||||
subcommands += [i.get_opt_string() for i in opts
|
||||
if i.help != optparse.SUPPRESS_HELP]
|
||||
|
||||
print(' '.join([x for x in subcommands if x.startswith(current)]))
|
||||
print((' '.join([x for x in subcommands if x.startswith(current)])))
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
/*.pyc
|
||||
@@ -5,4 +5,4 @@ depend on something external.
|
||||
Files inside of pip._vendor should be considered immutable and should only be
|
||||
updated to versions from upstream.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -513,7 +513,7 @@ def get_archive_formats():
|
||||
Each element of the returned sequence is a tuple (name, description)
|
||||
"""
|
||||
formats = [(name, registry[2]) for name, registry in
|
||||
_ARCHIVE_FORMATS.items()]
|
||||
list(_ARCHIVE_FORMATS.items())]
|
||||
formats.sort()
|
||||
return formats
|
||||
|
||||
@@ -603,7 +603,7 @@ def get_unpack_formats():
|
||||
(name, extensions, description)
|
||||
"""
|
||||
formats = [(name, info[0], info[3]) for name, info in
|
||||
_UNPACK_FORMATS.items()]
|
||||
list(_UNPACK_FORMATS.items())]
|
||||
formats.sort()
|
||||
return formats
|
||||
|
||||
@@ -611,7 +611,7 @@ def _check_unpack_options(extensions, function, extra_args):
|
||||
"""Checks what gets registered as an unpacker."""
|
||||
# first make sure no other unpacker is registered for this extension
|
||||
existing_extensions = {}
|
||||
for name, info in _UNPACK_FORMATS.items():
|
||||
for name, info in list(_UNPACK_FORMATS.items()):
|
||||
for ext in info[0]:
|
||||
existing_extensions[ext] = name
|
||||
|
||||
@@ -718,7 +718,7 @@ if _BZ2_SUPPORTED:
|
||||
"bzip2'ed tar-file")
|
||||
|
||||
def _find_unpack_format(filename):
|
||||
for name, info in _UNPACK_FORMATS.items():
|
||||
for name, info in list(_UNPACK_FORMATS.items()):
|
||||
for extension in info[0]:
|
||||
if filename.endswith(extension):
|
||||
return name
|
||||
|
||||
Binary file not shown.
@@ -13,7 +13,7 @@ from os.path import pardir, realpath
|
||||
try:
|
||||
import configparser
|
||||
except ImportError:
|
||||
import ConfigParser as configparser
|
||||
import configparser as configparser
|
||||
|
||||
|
||||
__all__ = [
|
||||
@@ -147,8 +147,8 @@ def _subst_vars(path, local_vars):
|
||||
|
||||
|
||||
def _extend_dict(target_dict, other_dict):
|
||||
target_keys = target_dict.keys()
|
||||
for key, value in other_dict.items():
|
||||
target_keys = list(target_dict.keys())
|
||||
for key, value in list(other_dict.items()):
|
||||
if key in target_keys:
|
||||
continue
|
||||
target_dict[key] = value
|
||||
@@ -321,7 +321,7 @@ def _parse_makefile(filename, vars=None):
|
||||
variables.remove(name)
|
||||
|
||||
# strip spurious spaces
|
||||
for k, v in done.items():
|
||||
for k, v in list(done.items()):
|
||||
if isinstance(v, str):
|
||||
done[k] = v.strip()
|
||||
|
||||
@@ -769,15 +769,15 @@ def get_python_version():
|
||||
def _print_dict(title, data):
|
||||
for index, (key, value) in enumerate(sorted(data.items())):
|
||||
if index == 0:
|
||||
print('%s: ' % (title))
|
||||
print('\t%s = "%s"' % (key, value))
|
||||
print(('%s: ' % (title)))
|
||||
print(('\t%s = "%s"' % (key, value)))
|
||||
|
||||
|
||||
def _main():
|
||||
"""Display all information sysconfig detains."""
|
||||
print('Platform: "%s"' % get_platform())
|
||||
print('Python version: "%s"' % get_python_version())
|
||||
print('Current installation scheme: "%s"' % _get_default_scheme())
|
||||
print(('Platform: "%s"' % get_platform()))
|
||||
print(('Python version: "%s"' % get_python_version()))
|
||||
print(('Current installation scheme: "%s"' % _get_default_scheme()))
|
||||
print()
|
||||
_print_dict('Paths', get_paths())
|
||||
print()
|
||||
|
||||
Binary file not shown.
@@ -25,7 +25,7 @@
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
from __future__ import print_function
|
||||
|
||||
|
||||
"""Read from and write to tar format archives.
|
||||
"""
|
||||
@@ -33,10 +33,10 @@ from __future__ import print_function
|
||||
__version__ = "$Revision$"
|
||||
|
||||
version = "0.9.0"
|
||||
__author__ = "Lars Gust\u00e4bel (lars@gustaebel.de)"
|
||||
__author__ = "Lars Gust\\u00e4bel (lars@gustaebel.de)"
|
||||
__date__ = "$Date: 2011-02-25 17:42:01 +0200 (Fri, 25 Feb 2011) $"
|
||||
__cvsid__ = "$Id: tarfile.py 88586 2011-02-25 15:42:01Z marc-andre.lemburg $"
|
||||
__credits__ = "Gustavo Niemeyer, Niels Gust\u00e4bel, Richard Townsend."
|
||||
__credits__ = "Gustavo Niemeyer, Niels Gust\\u00e4bel, Richard Townsend."
|
||||
|
||||
#---------
|
||||
# Imports
|
||||
@@ -68,7 +68,7 @@ except NameError:
|
||||
__all__ = ["TarFile", "TarInfo", "is_tarfile", "TarError"]
|
||||
|
||||
if sys.version_info[0] < 3:
|
||||
import __builtin__ as builtins
|
||||
import builtins as builtins
|
||||
else:
|
||||
import builtins
|
||||
|
||||
@@ -1174,7 +1174,7 @@ class TarInfo(object):
|
||||
# Check if one of the fields contains surrogate characters and thereby
|
||||
# forces hdrcharset=BINARY, see _proc_pax() for more information.
|
||||
binary = False
|
||||
for keyword, value in pax_headers.items():
|
||||
for keyword, value in list(pax_headers.items()):
|
||||
try:
|
||||
value.encode("utf8", "strict")
|
||||
except UnicodeEncodeError:
|
||||
@@ -1186,7 +1186,7 @@ class TarInfo(object):
|
||||
# Put the hdrcharset field at the beginning of the header.
|
||||
records += b"21 hdrcharset=BINARY\n"
|
||||
|
||||
for keyword, value in pax_headers.items():
|
||||
for keyword, value in list(pax_headers.items()):
|
||||
keyword = keyword.encode("utf8")
|
||||
if binary:
|
||||
# Try to restore the original byte representation of `value'.
|
||||
@@ -1519,7 +1519,7 @@ class TarInfo(object):
|
||||
"""Replace fields with supplemental information from a previous
|
||||
pax extended or global header.
|
||||
"""
|
||||
for keyword, value in pax_headers.items():
|
||||
for keyword, value in list(pax_headers.items()):
|
||||
if keyword == "GNU.sparse.name":
|
||||
setattr(self, "path", value)
|
||||
elif keyword == "GNU.sparse.size":
|
||||
@@ -1670,7 +1670,7 @@ class TarFile(object):
|
||||
try:
|
||||
if self.mode == "r":
|
||||
self.firstmember = None
|
||||
self.firstmember = self.next()
|
||||
self.firstmember = next(self)
|
||||
|
||||
if self.mode == "a":
|
||||
# Move to the end of the archive,
|
||||
@@ -2076,7 +2076,7 @@ class TarFile(object):
|
||||
|
||||
# Change or exclude the TarInfo object.
|
||||
if filter is not None:
|
||||
tarinfo = filter(tarinfo)
|
||||
tarinfo = list(filter(tarinfo))
|
||||
if tarinfo is None:
|
||||
self._dbg(2, "tarfile: Excluded %r" % name)
|
||||
return
|
||||
@@ -2411,7 +2411,7 @@ class TarFile(object):
|
||||
raise ExtractError("could not change modification time")
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
def next(self):
|
||||
def __next__(self):
|
||||
"""Return the next member of the archive as a TarInfo object, when
|
||||
TarFile is opened for reading. Return None if there is no more
|
||||
available.
|
||||
@@ -2488,7 +2488,7 @@ class TarFile(object):
|
||||
members.
|
||||
"""
|
||||
while True:
|
||||
tarinfo = self.next()
|
||||
tarinfo = next(self)
|
||||
if tarinfo is None:
|
||||
break
|
||||
self._loaded = True
|
||||
@@ -2575,7 +2575,7 @@ class TarIter(object):
|
||||
# happen that getmembers() is called during iteration,
|
||||
# which will cause TarIter to stop prematurely.
|
||||
if not self.tarfile._loaded:
|
||||
tarinfo = self.tarfile.next()
|
||||
tarinfo = next(self.tarfile)
|
||||
if not tarinfo:
|
||||
self.tarfile._loaded = True
|
||||
raise StopIteration
|
||||
|
||||
Binary file not shown.
@@ -4,42 +4,42 @@
|
||||
# Licensed to the Python Software Foundation under a contributor agreement.
|
||||
# See LICENSE.txt and CONTRIBUTORS.txt.
|
||||
#
|
||||
from __future__ import absolute_import
|
||||
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
if sys.version_info[0] < 3:
|
||||
from StringIO import StringIO
|
||||
string_types = basestring,
|
||||
text_type = unicode
|
||||
from io import StringIO
|
||||
string_types = str,
|
||||
text_type = str
|
||||
from types import FileType as file_type
|
||||
import __builtin__ as builtins
|
||||
import ConfigParser as configparser
|
||||
import builtins as builtins
|
||||
import configparser as configparser
|
||||
from ._backport import shutil
|
||||
from urlparse import urlparse, urlunparse, urljoin, urlsplit, urlunsplit
|
||||
from urllib.parse import urlparse, urlunparse, urljoin, urlsplit, urlunsplit
|
||||
from urllib import (urlretrieve, quote as _quote, unquote, url2pathname,
|
||||
pathname2url, ContentTooShortError, splittype)
|
||||
|
||||
def quote(s):
|
||||
if isinstance(s, unicode):
|
||||
if isinstance(s, str):
|
||||
s = s.encode('utf-8')
|
||||
return _quote(s)
|
||||
|
||||
import urllib2
|
||||
import urllib.request, urllib.error, urllib.parse
|
||||
from urllib2 import (Request, urlopen, URLError, HTTPError,
|
||||
HTTPBasicAuthHandler, HTTPPasswordMgr,
|
||||
HTTPSHandler, HTTPHandler, HTTPRedirectHandler,
|
||||
build_opener)
|
||||
import httplib
|
||||
import xmlrpclib
|
||||
import Queue as queue
|
||||
from HTMLParser import HTMLParser
|
||||
import htmlentitydefs
|
||||
import http.client
|
||||
import xmlrpc.client
|
||||
import queue as queue
|
||||
from html.parser import HTMLParser
|
||||
import html.entities
|
||||
raw_input = raw_input
|
||||
from itertools import ifilter as filter
|
||||
from itertools import ifilterfalse as filterfalse
|
||||
|
||||
from itertools import filterfalse as filterfalse
|
||||
|
||||
_userprog = None
|
||||
def splituser(host):
|
||||
@@ -580,9 +580,9 @@ except ImportError: # pragma: no cover
|
||||
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
|
||||
# Passes Python2.7's test suite and incorporates all the latest updates.
|
||||
try:
|
||||
from thread import get_ident as _get_ident
|
||||
from _thread import get_ident as _get_ident
|
||||
except ImportError:
|
||||
from dummy_thread import get_ident as _get_ident
|
||||
from _dummy_thread import get_ident as _get_ident
|
||||
|
||||
try:
|
||||
from _abcoll import KeysView, ValuesView, ItemsView
|
||||
@@ -656,7 +656,7 @@ except ImportError: # pragma: no cover
|
||||
def clear(self):
|
||||
'od.clear() -> None. Remove all items from od.'
|
||||
try:
|
||||
for node in self.__map.itervalues():
|
||||
for node in self.__map.values():
|
||||
del node[:]
|
||||
root = self.__root
|
||||
root[:] = [root, root, None]
|
||||
@@ -739,12 +739,12 @@ except ImportError: # pragma: no cover
|
||||
for key in other:
|
||||
self[key] = other[key]
|
||||
elif hasattr(other, 'keys'):
|
||||
for key in other.keys():
|
||||
for key in list(other.keys()):
|
||||
self[key] = other[key]
|
||||
else:
|
||||
for key, value in other:
|
||||
self[key] = value
|
||||
for key, value in kwds.items():
|
||||
for key, value in list(kwds.items()):
|
||||
self[key] = value
|
||||
|
||||
__update = update # let subclasses override update without breaking __init__
|
||||
@@ -781,7 +781,7 @@ except ImportError: # pragma: no cover
|
||||
try:
|
||||
if not self:
|
||||
return '%s()' % (self.__class__.__name__,)
|
||||
return '%s(%r)' % (self.__class__.__name__, self.items())
|
||||
return '%s(%r)' % (self.__class__.__name__, list(self.items()))
|
||||
finally:
|
||||
del _repr_running[call_key]
|
||||
|
||||
@@ -816,7 +816,7 @@ except ImportError: # pragma: no cover
|
||||
|
||||
'''
|
||||
if isinstance(other, OrderedDict):
|
||||
return len(self)==len(other) and self.items() == other.items()
|
||||
return len(self)==len(other) and list(self.items()) == list(other.items())
|
||||
return dict.__eq__(self, other)
|
||||
|
||||
def __ne__(self, other):
|
||||
@@ -1053,7 +1053,7 @@ except ImportError: # pragma: no cover
|
||||
kwargs = dict([(k, config[k]) for k in config if valid_ident(k)])
|
||||
result = c(**kwargs)
|
||||
if props:
|
||||
for name, value in props.items():
|
||||
for name, value in list(props.items()):
|
||||
setattr(result, name, value)
|
||||
return result
|
||||
|
||||
|
||||
Binary file not shown.
@@ -5,7 +5,7 @@
|
||||
#
|
||||
"""PEP 376 implementation."""
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
import base64
|
||||
import codecs
|
||||
@@ -205,11 +205,11 @@ class DistributionPath(object):
|
||||
else:
|
||||
self._generate_cache()
|
||||
|
||||
for dist in self._cache.path.values():
|
||||
for dist in list(self._cache.path.values()):
|
||||
yield dist
|
||||
|
||||
if self._include_egg:
|
||||
for dist in self._cache_egg.path.values():
|
||||
for dist in list(self._cache_egg.path.values()):
|
||||
yield dist
|
||||
|
||||
def get_distribution(self, name):
|
||||
@@ -298,7 +298,7 @@ class DistributionPath(object):
|
||||
if name in d:
|
||||
yield d[name]
|
||||
else:
|
||||
for v in d.values():
|
||||
for v in list(d.values()):
|
||||
yield v
|
||||
|
||||
|
||||
@@ -1125,7 +1125,7 @@ class DependencyGraph(object):
|
||||
disconnected = []
|
||||
|
||||
f.write("digraph dependencies {\n")
|
||||
for dist, adjs in self.adjacency_list.items():
|
||||
for dist, adjs in list(self.adjacency_list.items()):
|
||||
if len(adjs) == 0 and not skip_disconnected:
|
||||
disconnected.append(dist)
|
||||
for other, label in adjs:
|
||||
@@ -1156,7 +1156,7 @@ class DependencyGraph(object):
|
||||
result = []
|
||||
# Make a shallow copy of the adjacency list
|
||||
alist = {}
|
||||
for k, v in self.adjacency_list.items():
|
||||
for k, v in list(self.adjacency_list.items()):
|
||||
alist[k] = v[:]
|
||||
while True:
|
||||
# See what we can remove in this run
|
||||
@@ -1169,7 +1169,7 @@ class DependencyGraph(object):
|
||||
# What's left in alist (if anything) is a cycle.
|
||||
break
|
||||
# Remove from the adjacency list of others
|
||||
for k, v in alist.items():
|
||||
for k, v in list(alist.items()):
|
||||
alist[k] = [(d, r) for d, r in v if d not in to_remove]
|
||||
logger.debug('Moving to result: %s',
|
||||
['%s (%s)' % (d.name, d.version) for d in to_remove])
|
||||
@@ -1179,7 +1179,7 @@ class DependencyGraph(object):
|
||||
def __repr__(self):
|
||||
"""Representation of the graph"""
|
||||
output = []
|
||||
for dist, adjs in self.adjacency_list.items():
|
||||
for dist, adjs in list(self.adjacency_list.items()):
|
||||
output.append(self.repr_node(dist))
|
||||
return '\n'.join(output)
|
||||
|
||||
|
||||
Binary file not shown.
@@ -124,10 +124,10 @@ class PackageIndex(object):
|
||||
metadata.validate()
|
||||
d = metadata.todict()
|
||||
d[':action'] = 'verify'
|
||||
request = self.encode_request(d.items(), [])
|
||||
request = self.encode_request(list(d.items()), [])
|
||||
response = self.send_request(request)
|
||||
d[':action'] = 'submit'
|
||||
request = self.encode_request(d.items(), [])
|
||||
request = self.encode_request(list(d.items()), [])
|
||||
return self.send_request(request)
|
||||
|
||||
def _reader(self, name, stream, outbuf):
|
||||
@@ -275,7 +275,7 @@ class PackageIndex(object):
|
||||
files.append(('gpg_signature', os.path.basename(sig_file),
|
||||
sig_data))
|
||||
shutil.rmtree(os.path.dirname(sig_file))
|
||||
request = self.encode_request(d.items(), files)
|
||||
request = self.encode_request(list(d.items()), files)
|
||||
return self.send_request(request)
|
||||
|
||||
def upload_documentation(self, metadata, doc_dir):
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -7,7 +7,7 @@
|
||||
|
||||
Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental).
|
||||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
import codecs
|
||||
from email import message_from_file
|
||||
@@ -120,7 +120,7 @@ def _best_version(fields):
|
||||
return False
|
||||
|
||||
keys = []
|
||||
for key, value in fields.items():
|
||||
for key, value in list(fields.items()):
|
||||
if value in ([], 'UNKNOWN', None):
|
||||
continue
|
||||
keys.append(key)
|
||||
@@ -401,14 +401,14 @@ class LegacyMetadata(object):
|
||||
# other is None or empty container
|
||||
pass
|
||||
elif hasattr(other, 'keys'):
|
||||
for k in other.keys():
|
||||
for k in list(other.keys()):
|
||||
_set(k, other[k])
|
||||
else:
|
||||
for k, v in other:
|
||||
_set(k, v)
|
||||
|
||||
if kwargs:
|
||||
for k, v in kwargs.items():
|
||||
for k, v in list(kwargs.items()):
|
||||
_set(k, v)
|
||||
|
||||
def set(self, name, value):
|
||||
@@ -602,14 +602,14 @@ class LegacyMetadata(object):
|
||||
return list(_version2fieldlist(self['Metadata-Version']))
|
||||
|
||||
def __iter__(self):
|
||||
for key in self.keys():
|
||||
for key in list(self.keys()):
|
||||
yield key
|
||||
|
||||
def values(self):
|
||||
return [self[key] for key in self.keys()]
|
||||
return [self[key] for key in list(self.keys())]
|
||||
|
||||
def items(self):
|
||||
return [(key, self[key]) for key in self.keys()]
|
||||
return [(key, self[key]) for key in list(self.keys())]
|
||||
|
||||
def __repr__(self):
|
||||
return '<%s %s %s>' % (self.__class__.__name__, self.name,
|
||||
@@ -875,14 +875,14 @@ class Metadata(object):
|
||||
if mapping.get('metadata_version') != self.METADATA_VERSION:
|
||||
raise MetadataUnrecognizedVersionError()
|
||||
missing = []
|
||||
for key, exclusions in self.MANDATORY_KEYS.items():
|
||||
for key, exclusions in list(self.MANDATORY_KEYS.items()):
|
||||
if key not in mapping:
|
||||
if scheme not in exclusions:
|
||||
missing.append(key)
|
||||
if missing:
|
||||
msg = 'Missing metadata items: %s' % ', '.join(missing)
|
||||
raise MetadataMissingError(msg)
|
||||
for k, v in mapping.items():
|
||||
for k, v in list(mapping.items()):
|
||||
self._validate_value(k, v, scheme)
|
||||
|
||||
def validate(self):
|
||||
@@ -964,7 +964,7 @@ class Metadata(object):
|
||||
assert self._data and not self._legacy
|
||||
result = LegacyMetadata()
|
||||
nmd = self._data
|
||||
for nk, ok in self.LEGACY_MAPPING.items():
|
||||
for nk, ok in list(self.LEGACY_MAPPING.items()):
|
||||
if nk in nmd:
|
||||
result[ok] = nmd[nk]
|
||||
r1 = process_entries(self.run_requires + self.meta_requires)
|
||||
|
||||
Binary file not shown.
@@ -4,7 +4,7 @@
|
||||
# Licensed to the Python Software Foundation under a contributor agreement.
|
||||
# See LICENSE.txt and CONTRIBUTORS.txt.
|
||||
#
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
import bisect
|
||||
import io
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -165,7 +165,7 @@ def get_executable():
|
||||
def proceed(prompt, allowed_chars, error_prompt=None, default=None):
|
||||
p = prompt
|
||||
while True:
|
||||
s = raw_input(p)
|
||||
s = input(p)
|
||||
p = prompt
|
||||
if not s and default:
|
||||
s = default
|
||||
@@ -197,8 +197,8 @@ def read_exports(stream):
|
||||
try:
|
||||
data = json.load(stream)
|
||||
result = data['exports']
|
||||
for group, entries in result.items():
|
||||
for k, v in entries.items():
|
||||
for group, entries in list(result.items()):
|
||||
for k, v in list(entries.items()):
|
||||
s = '%s = %s' % (k, v)
|
||||
entry = get_export_entry(s)
|
||||
assert entry is not None
|
||||
@@ -228,10 +228,10 @@ def write_exports(exports, stream):
|
||||
# needs to be a text stream
|
||||
stream = codecs.getwriter('utf-8')(stream)
|
||||
cp = configparser.ConfigParser()
|
||||
for k, v in exports.items():
|
||||
for k, v in list(exports.items()):
|
||||
# TODO check k, v for valid values
|
||||
cp.add_section(k)
|
||||
for entry in v.values():
|
||||
for entry in list(v.values()):
|
||||
if entry.suffix is None:
|
||||
s = entry.prefix
|
||||
else:
|
||||
@@ -1445,7 +1445,7 @@ class CSVReader(CSVBase):
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def next(self):
|
||||
def __next__(self):
|
||||
result = next(self.reader)
|
||||
if sys.version_info[0] < 3:
|
||||
for i, item in enumerate(result):
|
||||
@@ -1510,7 +1510,7 @@ class Configurator(BaseConfigurator):
|
||||
kwargs = dict(items)
|
||||
result = c(*args, **kwargs)
|
||||
if props:
|
||||
for n, v in props.items():
|
||||
for n, v in list(props.items()):
|
||||
setattr(result, n, convert(v))
|
||||
return result
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -4,7 +4,7 @@
|
||||
# Licensed to the Python Software Foundation under a contributor agreement.
|
||||
# See LICENSE.txt and CONTRIBUTORS.txt.
|
||||
#
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
import base64
|
||||
import codecs
|
||||
@@ -313,7 +313,7 @@ class Wheel(object):
|
||||
if tags is None:
|
||||
tags = {}
|
||||
|
||||
libkey = list(filter(lambda o: o in paths, ('purelib', 'platlib')))[0]
|
||||
libkey = list([o for o in ('purelib', 'platlib') if o in paths])[0]
|
||||
if libkey == 'platlib':
|
||||
is_pure = 'false'
|
||||
default_pyver = [IMPVER]
|
||||
@@ -574,7 +574,7 @@ class Wheel(object):
|
||||
k = '%s_scripts' % key
|
||||
if k in epdata:
|
||||
commands['wrap_%s' % key] = d = {}
|
||||
for v in epdata[k].values():
|
||||
for v in list(epdata[k].values()):
|
||||
s = '%s:%s' % (v.prefix, v.suffix)
|
||||
if v.flags:
|
||||
s += ' %s' % v.flags
|
||||
@@ -600,14 +600,14 @@ class Wheel(object):
|
||||
raise ValueError('Valid script path not '
|
||||
'specified')
|
||||
maker.target_dir = script_dir
|
||||
for k, v in console_scripts.items():
|
||||
for k, v in list(console_scripts.items()):
|
||||
script = '%s = %s' % (k, v)
|
||||
filenames = maker.make(script)
|
||||
fileop.set_executable_mode(filenames)
|
||||
|
||||
if gui_scripts:
|
||||
options = {'gui': True }
|
||||
for k, v in gui_scripts.items():
|
||||
for k, v in list(gui_scripts.items()):
|
||||
script = '%s = %s' % (k, v)
|
||||
filenames = maker.make(script, options)
|
||||
fileop.set_executable_mode(filenames)
|
||||
@@ -661,7 +661,7 @@ class Wheel(object):
|
||||
cache_base = os.path.join(cache.base, prefix)
|
||||
if not os.path.isdir(cache_base):
|
||||
os.makedirs(cache_base)
|
||||
for name, relpath in extensions.items():
|
||||
for name, relpath in list(extensions.items()):
|
||||
dest = os.path.join(cache_base, convert_path(relpath))
|
||||
if not os.path.exists(dest):
|
||||
extract = True
|
||||
|
||||
Binary file not shown.
@@ -11,7 +11,7 @@ f = open("my_document.html")
|
||||
tree = html5lib.parse(f)
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
|
||||
from .html5parser import HTMLParser, parse, parseFragment
|
||||
from .treebuilders import getTreeBuilder
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
|
||||
import string
|
||||
import gettext
|
||||
@@ -449,7 +449,7 @@ adjustForeignAttributes = {
|
||||
}
|
||||
|
||||
unadjustForeignAttributes = dict([((ns, local), qname) for qname, (prefix, local, ns) in
|
||||
adjustForeignAttributes.items()])
|
||||
list(adjustForeignAttributes.items())])
|
||||
|
||||
spaceCharacters = frozenset((
|
||||
"\t",
|
||||
@@ -3092,7 +3092,7 @@ tagTokenTypes = frozenset((tokenTypes["StartTag"], tokenTypes["EndTag"],
|
||||
tokenTypes["EmptyTag"]))
|
||||
|
||||
|
||||
prefixes = dict([(v, k) for k, v in namespaces.items()])
|
||||
prefixes = dict([(v, k) for k, v in list(namespaces.items())])
|
||||
prefixes["http://www.w3.org/1998/Math/MathML"] = "math"
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
|
||||
|
||||
class Filter(object):
|
||||
|
||||
Binary file not shown.
+2
-2
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
|
||||
from . import _base
|
||||
|
||||
@@ -13,7 +13,7 @@ class Filter(_base.Filter):
|
||||
for token in _base.Filter.__iter__(self):
|
||||
if token["type"] in ("StartTag", "EmptyTag"):
|
||||
attrs = OrderedDict()
|
||||
for name, value in sorted(token["data"].items(),
|
||||
for name, value in sorted(list(token["data"].items()),
|
||||
key=lambda x: x[0]):
|
||||
attrs[name] = value
|
||||
token["data"] = attrs
|
||||
|
||||
BIN
Binary file not shown.
+2
-2
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
|
||||
from . import _base
|
||||
|
||||
@@ -23,7 +23,7 @@ class Filter(_base.Filter):
|
||||
if token["name"].lower() == "meta":
|
||||
# replace charset with actual encoding
|
||||
has_http_equiv_content_type = False
|
||||
for (namespace, name), value in token["data"].items():
|
||||
for (namespace, name), value in list(token["data"].items()):
|
||||
if namespace is not None:
|
||||
continue
|
||||
elif name.lower() == 'charset':
|
||||
|
||||
BIN
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
|
||||
from gettext import gettext
|
||||
_ = gettext
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
|
||||
from . import _base
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
|
||||
from . import _base
|
||||
from ..sanitizer import HTMLSanitizerMixin
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
|
||||
import re
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
from pip._vendor.six import with_metaclass
|
||||
|
||||
import types
|
||||
@@ -38,7 +38,7 @@ def parseFragment(doc, container="div", treebuilder="etree", encoding=None,
|
||||
def method_decorator_metaclass(function):
|
||||
class Decorated(type):
|
||||
def __new__(meta, classname, bases, classDict):
|
||||
for attributeName, attribute in classDict.items():
|
||||
for attributeName, attribute in list(classDict.items()):
|
||||
if isinstance(attribute, types.FunctionType):
|
||||
attribute = function(attribute)
|
||||
|
||||
@@ -75,7 +75,7 @@ class HTMLParser(object):
|
||||
self.errors = []
|
||||
|
||||
self.phases = dict([(name, cls(self, self.tree)) for name, cls in
|
||||
getPhases(debug).items()])
|
||||
list(getPhases(debug).items())])
|
||||
|
||||
def _parse(self, stream, innerHTML=False, container="div",
|
||||
encoding=None, parseMeta=True, useChardet=True, **kwargs):
|
||||
@@ -257,7 +257,7 @@ class HTMLParser(object):
|
||||
|
||||
def adjustMathMLAttributes(self, token):
|
||||
replacements = {"definitionurl": "definitionURL"}
|
||||
for k, v in replacements.items():
|
||||
for k, v in list(replacements.items()):
|
||||
if k in token["data"]:
|
||||
token["data"][v] = token["data"][k]
|
||||
del token["data"][k]
|
||||
@@ -336,7 +336,7 @@ class HTMLParser(object):
|
||||
def adjustForeignAttributes(self, token):
|
||||
replacements = adjustForeignAttributesMap
|
||||
|
||||
for originalName in token["data"].keys():
|
||||
for originalName in list(token["data"].keys()):
|
||||
if originalName in replacements:
|
||||
foreignName = replacements[originalName]
|
||||
token["data"][foreignName] = token["data"][originalName]
|
||||
@@ -411,7 +411,7 @@ def getPhases(debug):
|
||||
def log(function):
|
||||
"""Logger that records which phase processes each token"""
|
||||
type_names = dict((value, key) for key, value in
|
||||
constants.tokenTypes.items())
|
||||
list(constants.tokenTypes.items()))
|
||||
|
||||
def wrapped(self, *args, **kwargs):
|
||||
if function.__name__.startswith("process") and len(args) > 0:
|
||||
@@ -472,7 +472,7 @@ def getPhases(debug):
|
||||
self.parser.parseError("non-html-root")
|
||||
# XXX Need a check here to see if the first start tag token emitted is
|
||||
# this token... If it's not, invoke self.parser.parseError().
|
||||
for attr, value in token["data"].items():
|
||||
for attr, value in list(token["data"].items()):
|
||||
if attr not in self.tree.openElements[0].attributes:
|
||||
self.tree.openElements[0].attributes[attr] = value
|
||||
self.parser.firstStartTag = False
|
||||
@@ -1009,7 +1009,7 @@ def getPhases(debug):
|
||||
assert self.parser.innerHTML
|
||||
else:
|
||||
self.parser.framesetOK = False
|
||||
for attr, value in token["data"].items():
|
||||
for attr, value in list(token["data"].items()):
|
||||
if attr not in self.tree.openElements[1].attributes:
|
||||
self.tree.openElements[1].attributes[attr] = value
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
|
||||
import re
|
||||
import warnings
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
from pip._vendor.six import text_type
|
||||
|
||||
import codecs
|
||||
@@ -565,7 +565,7 @@ class EncodingBytes(bytes):
|
||||
raise TypeError
|
||||
return self[p:p + 1]
|
||||
|
||||
def next(self):
|
||||
def __next__(self):
|
||||
# Py2 compat
|
||||
return self.__next__()
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
|
||||
import re
|
||||
from xml.sax.saxutils import escape, unescape
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
|
||||
from .. import treewalkers
|
||||
|
||||
|
||||
Binary file not shown.
+2
-2
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
from pip._vendor.six import text_type
|
||||
|
||||
import gettext
|
||||
@@ -232,7 +232,7 @@ class HTMLSerializer(object):
|
||||
in_cdata = True
|
||||
elif in_cdata:
|
||||
self.serializeError(_("Unexpected child element of a CDATA element"))
|
||||
for (attr_namespace, attr_name), attr_value in token["data"].items():
|
||||
for (attr_namespace, attr_name), attr_value in list(token["data"].items()):
|
||||
# TODO: Add namespace support here
|
||||
k = attr_name
|
||||
v = attr_value
|
||||
|
||||
BIN
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
|
||||
try:
|
||||
chr = unichr # flake8: noqa
|
||||
chr = chr # flake8: noqa
|
||||
except NameError:
|
||||
pass
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,11 +1,11 @@
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
|
||||
from xml.sax.xmlreader import AttributesNSImpl
|
||||
|
||||
from ..constants import adjustForeignAttributes, unadjustForeignAttributes
|
||||
|
||||
prefix_mapping = {}
|
||||
for prefix, localName, namespace in adjustForeignAttributes.values():
|
||||
for prefix, localName, namespace in list(adjustForeignAttributes.values()):
|
||||
if prefix is not None:
|
||||
prefix_mapping[prefix] = namespace
|
||||
|
||||
@@ -13,7 +13,7 @@ for prefix, localName, namespace in adjustForeignAttributes.values():
|
||||
def to_sax(walker, handler):
|
||||
"""Call SAX-like content handler based on treewalker walker"""
|
||||
handler.startDocument()
|
||||
for prefix, namespace in prefix_mapping.items():
|
||||
for prefix, namespace in list(prefix_mapping.items()):
|
||||
handler.startPrefixMapping(prefix, namespace)
|
||||
|
||||
for token in walker:
|
||||
@@ -39,6 +39,6 @@ def to_sax(walker, handler):
|
||||
else:
|
||||
assert False, "Unknown token type"
|
||||
|
||||
for prefix, namespace in prefix_mapping.items():
|
||||
for prefix, namespace in list(prefix_mapping.items()):
|
||||
handler.endPrefixMapping(prefix)
|
||||
handler.endDocument()
|
||||
|
||||
Binary file not shown.
@@ -26,7 +26,7 @@ returns a string containing Node and its children serialized according
|
||||
to the format used in the unittests
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
|
||||
from ..utils import default_etree
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import, division, unicode_literals
|
||||
|
||||
from pip._vendor.six import text_type
|
||||
|
||||
from ..constants import scopingElements, tableInsertModeElements, namespaces
|
||||
@@ -42,7 +42,7 @@ class Node(object):
|
||||
def __str__(self):
|
||||
attributesStr = " ".join(["%s=\"%s\"" % (name, value)
|
||||
for name, value in
|
||||
self.attributes.items()])
|
||||
list(self.attributes.items())])
|
||||
if attributesStr:
|
||||
return "<%s %s>" % (self.name, attributesStr)
|
||||
else:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user