summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3')
-rw-r--r--chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/__init__.py27
-rw-r--r--chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/commands.py266
-rw-r--r--chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/data.py165
-rw-r--r--chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/dist.py51
-rw-r--r--chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/ext.py253
-rw-r--r--chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/setup.py420
-rw-r--r--chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/shell.py351
-rw-r--r--chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/term/__init__.py28
-rw-r--r--chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/term/_term.py116
-rw-r--r--chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/util.py63
10 files changed, 0 insertions, 1740 deletions
diff --git a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/__init__.py b/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/__init__.py
deleted file mode 100644
index 6139d510a10..00000000000
--- a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/__init__.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# -*- coding: ascii -*-
-#
-# Copyright 2007, 2008, 2009, 2010, 2011
-# Andr\xe9 Malo or his licensors, as applicable
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""
-================
- Package _setup
-================
-
-This package provides tools for main package setup.
-"""
-__author__ = "Andr\xe9 Malo"
-__docformat__ = "restructuredtext en"
-
-from _setup.setup import run # pylint: disable = W0611
diff --git a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/commands.py b/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/commands.py
deleted file mode 100644
index 7bfacbc86ef..00000000000
--- a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/commands.py
+++ /dev/null
@@ -1,266 +0,0 @@
-# -*- coding: ascii -*-
-#
-# Copyright 2007, 2008, 2009, 2010, 2011
-# Andr\xe9 Malo or his licensors, as applicable
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""
-===================
- Command extenders
-===================
-
-Command extenders.
-"""
-__author__ = "Andr\xe9 Malo"
-__docformat__ = "restructuredtext en"
-__test__ = False
-
-from distutils import fancy_getopt as _fancy_getopt
-from distutils import log
-from distutils.command import build as _build
-from distutils.command import build_ext as _build_ext
-from distutils.command import install as _install
-from distutils.command import install_data as _install_data
-from distutils.command import install_lib as _install_lib
-import os as _os
-
-_option_defaults = {}
-_option_inherits = {}
-_option_finalizers = {}
-_command_mapping = {
- 'install': 'Install',
- 'install_data': 'InstallData',
- 'install_lib': 'InstallLib',
- 'build': 'Build',
- 'build_ext': 'BuildExt',
-}
-
-
-def add_option(command, long_name, help_text, short_name=None, default=None,
- inherit=None):
- """ Add an option """
- try:
- command_class = globals()[_command_mapping[command]]
- except KeyError:
- raise ValueError("Unknown command %r" % (command,))
- for opt in command_class.user_options:
- if opt[0] == long_name:
- break
- else:
- opt = (long_name, short_name, help_text)
- command_class.user_options.append(opt)
- if not long_name.endswith('='):
- command_class.boolean_options.append(long_name)
- attr_name = _fancy_getopt.translate_longopt(long_name)
- else:
- attr_name = _fancy_getopt.translate_longopt(long_name[:-1])
- if command not in _option_defaults:
- _option_defaults[command] = []
- if inherit is not None:
- if isinstance(inherit, str):
- inherit = [inherit]
- for i_inherit in inherit:
- add_option(
- i_inherit, long_name, help_text, short_name, default
- )
- default = None
- if command not in _option_inherits:
- _option_inherits[command] = []
- for i_inherit in inherit:
- for i_command, opt_name in _option_inherits[command]:
- if i_command == i_inherit and opt_name == attr_name:
- break
- else:
- _option_inherits[command].append((i_inherit, attr_name))
- _option_defaults[command].append((attr_name, default))
-
-
-def add_finalizer(command, key, func):
- """ Add finalizer """
- if command not in _option_finalizers:
- _option_finalizers[command] = {}
- if key not in _option_finalizers[command]:
- _option_finalizers[command][key] = func
-
-
-class Install(_install.install):
- """ Extended installer to reflect the additional data options """
- user_options = _install.install.user_options + [
- ('single-version-externally-managed', None,
- "Compat option. Does not a thing."),
- ]
- boolean_options = _install.install.boolean_options + [
- 'single-version-externally-managed'
- ]
-
- def initialize_options(self):
- """ Prepare for new options """
- _install.install.initialize_options(self)
- self.single_version_externally_managed = None
- if 'install' in _option_defaults:
- for opt_name, default in _option_defaults['install']:
- setattr(self, opt_name, default)
-
- def finalize_options(self):
- """ Finalize options """
- _install.install.finalize_options(self)
- if 'install' in _option_inherits:
- for parent, opt_name in _option_inherits['install']:
- self.set_undefined_options(parent, (opt_name, opt_name))
- if 'install' in _option_finalizers:
- for func in list(_option_finalizers['install'].values()):
- func(self)
-
-
-class InstallData(_install_data.install_data):
- """ Extended data installer """
- user_options = _install_data.install_data.user_options + []
- boolean_options = _install_data.install_data.boolean_options + []
-
- def initialize_options(self):
- """ Prepare for new options """
- _install_data.install_data.initialize_options(self)
- if 'install_data' in _option_defaults:
- for opt_name, default in _option_defaults['install_data']:
- setattr(self, opt_name, default)
-
- def finalize_options(self):
- """ Finalize options """
- _install_data.install_data.finalize_options(self)
- if 'install_data' in _option_inherits:
- for parent, opt_name in _option_inherits['install_data']:
- self.set_undefined_options(parent, (opt_name, opt_name))
- if 'install_data' in _option_finalizers:
- for func in list(_option_finalizers['install_data'].values()):
- func(self)
-
-
-class InstallLib(_install_lib.install_lib):
- """ Extended lib installer """
- user_options = _install_lib.install_lib.user_options + []
- boolean_options = _install_lib.install_lib.boolean_options + []
-
- def initialize_options(self):
- """ Prepare for new options """
- _install_lib.install_lib.initialize_options(self)
- if 'install_lib' in _option_defaults:
- for opt_name, default in _option_defaults['install_lib']:
- setattr(self, opt_name, default)
-
- def finalize_options(self):
- """ Finalize options """
- _install_lib.install_lib.finalize_options(self)
- if 'install_lib' in _option_inherits:
- for parent, opt_name in _option_inherits['install_lib']:
- self.set_undefined_options(parent, (opt_name, opt_name))
- if 'install_lib' in _option_finalizers:
- for func in list(_option_finalizers['install_lib'].values()):
- func(self)
-
-
-class BuildExt(_build_ext.build_ext):
- """
- Extended extension builder class
-
- This class allows extensions to provide a ``check_prerequisites`` method
- which is called before actually building it. The method takes the
- `BuildExt` instance and returns whether the extension should be skipped or
- not.
- """
-
- def initialize_options(self):
- """ Prepare for new options """
- _build_ext.build_ext.initialize_options(self)
- if 'build_ext' in _option_defaults:
- for opt_name, default in _option_defaults['build_ext']:
- setattr(self, opt_name, default)
-
- def finalize_options(self):
- """ Finalize options """
- _build_ext.build_ext.finalize_options(self)
- if 'build_ext' in _option_inherits:
- for parent, opt_name in _option_inherits['build_ext']:
- self.set_undefined_options(parent, (opt_name, opt_name))
- if 'build_ext' in _option_finalizers:
- for func in list(_option_finalizers['build_ext'].values()):
- func(self)
-
- def build_extension(self, ext):
- """
- Build C extension - with extended functionality
-
- The following features are added here:
-
- - ``ext.check_prerequisites`` is called before the extension is being
- built. See `Extension` for details. If the method does not exist,
- simply no check will be run.
- - The macros ``EXT_PACKAGE`` and ``EXT_MODULE`` will be filled (or
- unset) depending on the extensions name, but only if they are not
- already defined.
-
- :Parameters:
- `ext` : `Extension`
- The extension to build. If it's a pure
- ``distutils.core.Extension``, simply no prequisites check is
- applied.
-
- :Return: whatever ``distutils.command.build_ext.build_ext`` returns
- :Rtype: any
- """
- # handle name macros
- macros = dict(ext.define_macros or ())
- tup = ext.name.split('.')
- if len(tup) == 1:
- pkg, mod = None, tup[0]
- else:
- pkg, mod = '.'.join(tup[:-1]), tup[-1]
- if pkg is not None and 'EXT_PACKAGE' not in macros:
- ext.define_macros.append(('EXT_PACKAGE', pkg))
- if 'EXT_MODULE' not in macros:
- ext.define_macros.append(('EXT_MODULE', mod))
- if pkg is None:
- macros = dict(ext.undef_macros or ())
- if 'EXT_PACKAGE' not in macros:
- ext.undef_macros.append('EXT_PACKAGE')
-
- # handle prereq checks
- try:
- checker = ext.check_prerequisites
- except AttributeError:
- pass
- else:
- if checker(self):
- log.info("Skipping %s extension" % ext.name)
- return
-
- return _build_ext.build_ext.build_extension(self, ext)
-
-
-class Build(_build.build):
-
- def initialize_options(self):
- """ Prepare for new options """
- _build.build.initialize_options(self)
- if 'build' in _option_defaults:
- for opt_name, default in _option_defaults['build']:
- setattr(self, opt_name, default)
-
- def finalize_options(self):
- """ Finalize options """
- _build.build.finalize_options(self)
- if 'build' in _option_inherits:
- for parent, opt_name in _option_inherits['build']:
- self.set_undefined_options(parent, (opt_name, opt_name))
- if 'build' in _option_finalizers:
- for func in list(_option_finalizers['build'].values()):
- func(self)
diff --git a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/data.py b/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/data.py
deleted file mode 100644
index d4221735768..00000000000
--- a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/data.py
+++ /dev/null
@@ -1,165 +0,0 @@
-# -*- coding: ascii -*-
-#
-# Copyright 2007, 2008, 2009, 2010, 2011
-# Andr\xe9 Malo or his licensors, as applicable
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""
-===================
- Data distribution
-===================
-
-This module provides tools to simplify data distribution.
-"""
-__author__ = "Andr\xe9 Malo"
-__docformat__ = "restructuredtext en"
-
-from distutils import filelist as _filelist
-import os as _os
-import posixpath as _posixpath
-import sys as _sys
-
-from _setup import commands as _commands
-
-
-def splitpath(path):
- """ Split a path """
- drive, path = '', _os.path.normpath(path)
- try:
- splitunc = _os.path.splitunc
- except AttributeError:
- pass
- else:
- drive, path = splitunc(path)
- if not drive:
- drive, path = _os.path.splitdrive(path)
- elems = []
- try:
- sep = _os.path.sep
- except AttributeError:
- sep = _os.path.join('1', '2')[1:-1]
- while 1:
- prefix, path = _os.path.split(path)
- elems.append(path)
- if prefix in ('', sep):
- drive = _os.path.join(drive, prefix)
- break
- path = prefix
- elems.reverse()
- return drive, elems
-
-
-def finalizer(installer):
- """ Finalize install_data """
- data_files = []
- for item in installer.data_files:
- if not isinstance(item, Data):
- data_files.append(item)
- continue
- data_files.extend(item.flatten(installer))
- installer.data_files = data_files
-
-
-class Data(object):
- """ File list container """
-
- def __init__(self, files, target=None, preserve=0, strip=0,
- prefix=None):
- """ Initialization """
- self._files = files
- self._target = target
- self._preserve = preserve
- self._strip = strip
- self._prefix = prefix
- self.fixup_commands()
-
- def fixup_commands(self):
- pass
-
- def from_templates(cls, *templates, **kwargs):
- """ Initialize from template """
- files = _filelist.FileList()
- for tpl in templates:
- for line in tpl.split(';'):
- files.process_template_line(line.strip())
- files.sort()
- files.remove_duplicates()
- result = []
- for filename in files.files:
- _, elems = splitpath(filename)
- if '.svn' in elems or '.git' in elems:
- continue
- result.append(filename)
- return cls(result, **kwargs)
- from_templates = classmethod(from_templates)
-
- def flatten(self, installer):
- """ Flatten the file list to (target, file) tuples """
- # pylint: disable = W0613
- if self._prefix:
- _, prefix = splitpath(self._prefix)
- telems = prefix
- else:
- telems = []
-
- tmap = {}
- for fname in self._files:
- (_, name), target = splitpath(fname), telems
- if self._preserve:
- if self._strip:
- name = name[max(0, min(self._strip, len(name) - 1)):]
- if len(name) > 1:
- target = telems + name[:-1]
- tmap.setdefault(_posixpath.join(*target), []).append(fname)
- return list(tmap.items())
-
-
-class Documentation(Data):
- """ Documentation container """
-
- def fixup_commands(self):
- _commands.add_option('install_data', 'without-docs',
- help_text='Do not install documentation files',
- inherit='install',
- )
- _commands.add_finalizer('install_data', 'documentation', finalizer)
-
- def flatten(self, installer):
- """ Check if docs should be installed at all """
- if installer.without_docs:
- return []
- return Data.flatten(self, installer)
-
-
-class Manpages(Documentation):
- """ Manpages container """
-
- def dispatch(cls, files):
- """ Automatically dispatch manpages to their target directories """
- mpmap = {}
- for manpage in files:
- normalized = _os.path.normpath(manpage)
- _, ext = _os.path.splitext(normalized)
- if ext.startswith(_os.path.extsep):
- ext = ext[len(_os.path.extsep):]
- mpmap.setdefault(ext, []).append(manpage)
- return [cls(manpages, prefix=_posixpath.join(
- 'share', 'man', 'man%s' % section,
- )) for section, manpages in list(mpmap.items())]
- dispatch = classmethod(dispatch)
-
- def flatten(self, installer):
- """ Check if manpages are suitable """
- if _sys.platform == 'win32':
- return []
- return Documentation.flatten(self, installer)
diff --git a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/dist.py b/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/dist.py
deleted file mode 100644
index cce21e57a63..00000000000
--- a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/dist.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# -*- coding: ascii -*-
-#
-# Copyright 2007, 2008, 2009, 2010, 2011
-# Andr\xe9 Malo or his licensors, as applicable
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""
-================
- dist utilities
-================
-
-dist utilities.
-"""
-__author__ = "Andr\xe9 Malo"
-__docformat__ = "restructuredtext en"
-
-import sys as _sys
-
-from _setup import shell as _shell
-
-
-def run_setup(*args, **kwargs):
- """ Run setup """
- if 'setup' in kwargs:
- script = kwargs.get('setup') or 'setup.py'
- del kwargs['setup']
- else:
- script = 'setup.py'
- if 'fakeroot' in kwargs:
- fakeroot = kwargs['fakeroot']
- del kwargs['fakeroot']
- else:
- fakeroot = None
- if kwargs:
- raise TypeError("Unrecognized keyword parameters")
-
- script = _shell.native(script)
- argv = [_sys.executable, script] + list(args)
- if fakeroot:
- argv.insert(0, fakeroot)
- return not _shell.spawn(*argv)
diff --git a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/ext.py b/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/ext.py
deleted file mode 100644
index 852c466547e..00000000000
--- a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/ext.py
+++ /dev/null
@@ -1,253 +0,0 @@
-# -*- coding: ascii -*-
-#
-# Copyright 2007, 2008, 2009, 2010, 2011
-# Andr\xe9 Malo or his licensors, as applicable
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""
-===================
- C extension tools
-===================
-
-C extension tools.
-"""
-__author__ = "Andr\xe9 Malo"
-__docformat__ = "restructuredtext en"
-__test__ = False
-
-from distutils import core as _core
-from distutils import errors as _distutils_errors
-from distutils import log
-import os as _os
-import posixpath as _posixpath
-import shutil as _shutil
-import tempfile as _tempfile
-
-from _setup import commands as _commands
-
-def _install_finalizer(installer):
- if installer.without_c_extensions:
- installer.distribution.ext_modules = []
-
-def _build_finalizer(builder):
- if builder.without_c_extensions:
- builder.extensions = []
-
-
-class Extension(_core.Extension):
- """
- Extension with prerequisite check interface
-
- If your check is cacheable (during the setup run), override
- `cached_check_prerequisites`, `check_prerequisites` otherwise.
-
- :IVariables:
- `cached_check` : ``bool``
- The cached check result
- """
- cached_check = None
-
- def __init__(self, *args, **kwargs):
- """ Initialization """
- if 'depends' in kwargs:
- self.depends = kwargs['depends'] or []
- else:
- self.depends = []
- _core.Extension.__init__(self, *args, **kwargs)
-
- # add include path
- included = _posixpath.join('_setup', 'include')
- if included not in self.include_dirs:
- self.include_dirs.append(included)
-
- # add cext.h to the dependencies
- cext_h = _posixpath.join(included, 'cext.h')
- if cext_h not in self.depends:
- self.depends.append(cext_h)
-
- _commands.add_option('install_lib', 'without-c-extensions',
- help_text='Don\'t install C extensions',
- inherit='install',
- )
- _commands.add_finalizer('install_lib', 'c-extensions',
- _install_finalizer
- )
- _commands.add_option('build_ext', 'without-c-extensions',
- help_text='Don\'t build C extensions',
- inherit=('build', 'install_lib'),
- )
- _commands.add_finalizer('build_ext', 'c-extensions', _build_finalizer)
-
- def check_prerequisites(self, build):
- """
- Check prerequisites
-
- The check should cover all dependencies needed for the extension to
- be built and run. The method can do the following:
-
- - return a false value: the extension will be built
- - return a true value: the extension will be skipped. This is useful
- for optional extensions
- - raise an exception. This is useful for mandatory extensions
-
- If the check result is cacheable (during the setup run), override
- `cached_check_prerequisites` instead.
-
- :Parameters:
- `build` : `BuildExt`
- The extension builder
-
- :Return: Skip the extension?
- :Rtype: ``bool``
- """
- if self.cached_check is None:
- log.debug("PREREQ check for %s" % self.name)
- self.cached_check = self.cached_check_prerequisites(build)
- else:
- log.debug("PREREQ check for %s (cached)" % self.name)
- return self.cached_check
-
- def cached_check_prerequisites(self, build):
- """
- Check prerequisites
-
- The check should cover all dependencies needed for the extension to
- be built and run. The method can do the following:
-
- - return a false value: the extension will be built
- - return a true value: the extension will be skipped. This is useful
- for optional extensions
- - raise an exception. This is useful for mandatory extensions
-
- If the check result is *not* cacheable (during the setup run),
- override `check_prerequisites` instead.
-
- :Parameters:
- `build` : `BuildExt`
- The extension builder
-
- :Return: Skip the extension?
- :Rtype: ``bool``
- """
- # pylint: disable = W0613
- log.debug("Nothing to check for %s!" % self.name)
- return False
-
-
-class ConfTest(object):
- """
- Single conftest abstraction
-
- :IVariables:
- `_tempdir` : ``str``
- The tempdir created for this test
-
- `src` : ``str``
- Name of the source file
-
- `target` : ``str``
- Target filename
-
- `compiler` : ``CCompiler``
- compiler instance
-
- `obj` : ``list``
- List of object filenames (``[str, ...]``)
- """
- _tempdir = None
-
- def __init__(self, build, source):
- """
- Initialization
-
- :Parameters:
- `build` : ``distuils.command.build_ext.build_ext``
- builder instance
-
- `source` : ``str``
- Source of the file to compile
- """
- self._tempdir = tempdir = _tempfile.mkdtemp()
- src = _os.path.join(tempdir, 'conftest.c')
- fp = open(src, 'w', encoding='utf-8')
- try:
- fp.write(source)
- finally:
- fp.close()
- self.src = src
- self.compiler = compiler = build.compiler
- self.target = _os.path.join(tempdir, 'conftest')
- self.obj = compiler.object_filenames([src], output_dir=tempdir)
-
- def __del__(self):
- """ Destruction """
- self.destroy()
-
- def destroy(self):
- """ Destroy the conftest leftovers on disk """
- tempdir, self._tempdir = self._tempdir, None
- if tempdir is not None:
- _shutil.rmtree(tempdir)
-
- def compile(self, **kwargs):
- """
- Compile the conftest
-
- :Parameters:
- `kwargs` : ``dict``
- Optional keyword parameters for the compiler call
-
- :Return: Was the compilation successful?
- :Rtype: ``bool``
- """
- kwargs['output_dir'] = self._tempdir
- try:
- self.compiler.compile([self.src], **kwargs)
- except _distutils_errors.CompileError:
- return False
- return True
-
- def link(self, **kwargs):
- r"""
- Link the conftest
-
- Before you can link the conftest objects they need to be `compile`\d.
-
- :Parameters:
- `kwargs` : ``dict``
- Optional keyword parameters for the linker call
-
- :Return: Was the linking successful?
- :Rtype: ``bool``
- """
- try:
- self.compiler.link_executable(self.obj, self.target, **kwargs)
- except _distutils_errors.LinkError:
- return False
- return True
-
- def pipe(self, mode="r"):
- r"""
- Execute the conftest binary and connect to it using a pipe
-
- Before you can pipe to or from the conftest binary it needs to
- be `link`\ed.
-
- :Parameters:
- `mode` : ``str``
- Pipe mode - r/w
-
- :Return: The open pipe
- :Rtype: ``file``
- """
- return _os.popen(self.compiler.executable_filename(self.target), mode)
diff --git a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/setup.py b/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/setup.py
deleted file mode 100644
index 83f1c21d544..00000000000
--- a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/setup.py
+++ /dev/null
@@ -1,420 +0,0 @@
-# -*- coding: ascii -*-
-#
-# Copyright 2007 - 2013
-# Andr\xe9 Malo or his licensors, as applicable
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""
-===================
- Main setup runner
-===================
-
-This module provides a wrapper around the distutils core setup.
-"""
-__author__ = "Andr\xe9 Malo"
-__docformat__ = "restructuredtext en"
-
-import configparser as _config_parser
-from distutils import core as _core
-import os as _os
-import posixpath as _posixpath
-import sys as _sys
-
-from _setup import commands as _commands
-from _setup import data as _data
-from _setup import ext as _ext
-from _setup import util as _util
-from _setup import shell as _shell
-
-
-def check_python_version(impl, version_min, version_max):
- """ Check python version """
- if impl == 'python':
- version_info = _sys.version_info
- elif impl == 'pypy':
- version_info = getattr(_sys, 'pypy_version_info', None)
- if not version_info:
- return
- elif impl == 'jython':
- if not 'java' in _sys.platform.lower():
- return
- version_info = _sys.version_info
- else:
- raise AssertionError("impl not in ('python', 'pypy', 'jython')")
-
- pyversion = list(map(int, version_info[:3]))
- if version_min:
- min_required = list(
- map(int, '.'.join((version_min, '0.0.0')).split('.')[:3])
- )
- if pyversion < min_required:
- raise EnvironmentError("Need at least %s %s (vs. %s)" % (
- impl, version_min, '.'.join(map(str, pyversion))
- ))
- if version_max:
- max_required = list(map(int, version_max.split('.')))
- max_required[-1] += 1
- if pyversion >= max_required:
- raise EnvironmentError("Need at max %s %s (vs. %s)" % (
- impl,
- version_max,
- '.'.join(map(str, pyversion))
- ))
-
-
-def find_description(docs):
- """
- Determine the package description from DESCRIPTION
-
- :Parameters:
- `docs` : ``dict``
- Docs config section
-
- :Return: Tuple of summary, description and license
- (``('summary', 'description', 'license')``)
- (all may be ``None``)
- :Rtype: ``tuple``
- """
- summary = None
- filename = docs.get('meta.summary', 'SUMMARY').strip()
- if filename and _os.path.isfile(filename):
- fp = open(filename, encoding='utf-8')
- try:
- try:
- summary = fp.read().strip().splitlines()[0].rstrip()
- except IndexError:
- summary = ''
- finally:
- fp.close()
-
- description = None
- filename = docs.get('meta.description', 'DESCRIPTION').strip()
- if filename and _os.path.isfile(filename):
- fp = open(filename, encoding='utf-8')
- try:
- description = fp.read().rstrip()
- finally:
- fp.close()
-
- if summary is None and description:
- from docutils import core
- summary = core.publish_parts(
- source=description,
- source_path=filename,
- writer_name='html',
- )['title'].encode('utf-8')
-
- return summary, description
-
-
-def find_classifiers(docs):
- """
- Determine classifiers from CLASSIFIERS
-
- :return: List of classifiers (``['classifier', ...]``)
- :rtype: ``list``
- """
- filename = docs.get('meta.classifiers', 'CLASSIFIERS').strip()
- if filename and _os.path.isfile(filename):
- fp = open(filename, encoding='utf-8')
- try:
- content = fp.read()
- finally:
- fp.close()
- content = [item.strip() for item in content.splitlines()]
- return [item for item in content if item and not item.startswith('#')]
- return []
-
-
-def find_provides(docs):
- """
- Determine provides from PROVIDES
-
- :return: List of provides (``['provides', ...]``)
- :rtype: ``list``
- """
- filename = docs.get('meta.provides', 'PROVIDES').strip()
- if filename and _os.path.isfile(filename):
- fp = open(filename, encoding='utf-8')
- try:
- content = fp.read()
- finally:
- fp.close()
- content = [item.strip() for item in content.splitlines()]
- return [item for item in content if item and not item.startswith('#')]
- return []
-
-
-def find_license(docs):
- """
- Determine license from LICENSE
-
- :return: License text
- :rtype: ``str``
- """
- filename = docs.get('meta.license', 'LICENSE').strip()
- if filename and _os.path.isfile(filename):
- fp = open(filename, encoding='utf-8')
- try:
- return fp.read().rstrip()
- finally:
- fp.close()
- return None
-
-
-def find_packages(manifest):
- """ Determine packages and subpackages """
- packages = {}
- collect = manifest.get('packages.collect', '').split()
- lib = manifest.get('packages.lib', '.')
- try:
- sep = _os.path.sep
- except AttributeError:
- sep = _os.path.join('1', '2')[1:-1]
- for root in collect:
- for dirpath, _, filenames in _shell.walk(_os.path.join(lib, root)):
- if dirpath.find('.svn') >= 0 or dirpath.find('.git') >= 0:
- continue
- if '__init__.py' in filenames:
- packages[
- _os.path.normpath(dirpath).replace(sep, '.')
- ] = None
- packages = list(packages.keys())
- packages.sort()
- return packages
-
-
-def find_data(name, docs):
- """ Determine data files """
- result = []
- if docs.get('extra', '').strip():
- result.append(_data.Documentation(docs['extra'].split(),
- prefix='share/doc/%s' % name,
- ))
- if docs.get('examples.dir', '').strip():
- tpl = ['recursive-include %s *' % docs['examples.dir']]
- if docs.get('examples.ignore', '').strip():
- tpl.extend(["global-exclude %s" % item
- for item in docs['examples.ignore'].split()
- ])
- strip = int(docs.get('examples.strip', '') or 0)
- result.append(_data.Documentation.from_templates(*tpl, **{
- 'strip': strip,
- 'prefix': 'share/doc/%s' % name,
- 'preserve': 1,
- }))
- if docs.get('userdoc.dir', '').strip():
- tpl = ['recursive-include %s *' % docs['userdoc.dir']]
- if docs.get('userdoc.ignore', '').strip():
- tpl.extend(["global-exclude %s" % item
- for item in docs['userdoc.ignore'].split()
- ])
- strip = int(docs.get('userdoc.strip', '') or 0)
- result.append(_data.Documentation.from_templates(*tpl, **{
- 'strip': strip,
- 'prefix': 'share/doc/%s' % name,
- 'preserve': 1,
- }))
- if docs.get('apidoc.dir', '').strip():
- tpl = ['recursive-include %s *' % docs['apidoc.dir']]
- if docs.get('apidoc.ignore', '').strip():
- tpl.extend(["global-exclude %s" % item
- for item in docs['apidoc.ignore'].split()
- ])
- strip = int(docs.get('apidoc.strip', '') or 0)
- result.append(_data.Documentation.from_templates(*tpl, **{
- 'strip': strip,
- 'prefix': 'share/doc/%s' % name,
- 'preserve': 1,
- }))
- if docs.get('man', '').strip():
- result.extend(_data.Manpages.dispatch(docs['man'].split()))
- return result
-
-
-def make_manifest(manifest, config, docs, kwargs):
- """ Create file list to pack up """
- # pylint: disable = R0912
- kwargs = kwargs.copy()
- kwargs['script_args'] = ['install']
- kwargs['packages'] = list(kwargs.get('packages') or ()) + [
- '_setup', '_setup.py2', '_setup.py3',
- ] + list(manifest.get('packages.extra', '').split() or ())
- _core._setup_stop_after = "commandline"
- try:
- dist = _core.setup(**kwargs)
- finally:
- _core._setup_stop_after = None
-
- result = ['MANIFEST', 'PKG-INFO', 'setup.py'] + list(config)
- # TODO: work with default values:
- for key in ('classifiers', 'description', 'summary', 'provides',
- 'license'):
- filename = docs.get('meta.' + key, '').strip()
- if filename and _os.path.isfile(filename):
- result.append(filename)
-
- cmd = dist.get_command_obj("build_py")
- cmd.ensure_finalized()
- #from pprint import pprint; pprint(("build_py", cmd.get_source_files()))
- for item in cmd.get_source_files():
- result.append(_posixpath.sep.join(
- _os.path.normpath(item).split(_os.path.sep)
- ))
-
- cmd = dist.get_command_obj("build_ext")
- cmd.ensure_finalized()
- #from pprint import pprint; pprint(("build_ext", cmd.get_source_files()))
- for item in cmd.get_source_files():
- result.append(_posixpath.sep.join(
- _os.path.normpath(item).split(_os.path.sep)
- ))
- for ext in cmd.extensions:
- if ext.depends:
- result.extend([_posixpath.sep.join(
- _os.path.normpath(item).split(_os.path.sep)
- ) for item in ext.depends])
-
- cmd = dist.get_command_obj("build_clib")
- cmd.ensure_finalized()
- if cmd.libraries:
- #import pprint; pprint.pprint(("build_clib", cmd.get_source_files()))
- for item in cmd.get_source_files():
- result.append(_posixpath.sep.join(
- _os.path.normpath(item).split(_os.path.sep)
- ))
- for lib in cmd.libraries:
- if lib[1].get('depends'):
- result.extend([_posixpath.sep.join(
- _os.path.normpath(item).split(_os.path.sep)
- ) for item in lib[1]['depends']])
-
- cmd = dist.get_command_obj("build_scripts")
- cmd.ensure_finalized()
- #import pprint; pprint.pprint(("build_scripts", cmd.get_source_files()))
- if cmd.get_source_files():
- for item in cmd.get_source_files():
- result.append(_posixpath.sep.join(
- _os.path.normpath(item).split(_os.path.sep)
- ))
-
- cmd = dist.get_command_obj("install_data")
- cmd.ensure_finalized()
- #from pprint import pprint; pprint(("install_data", cmd.get_inputs()))
- try:
- strings = str
- except NameError:
- strings = (str, str)
-
- for item in cmd.get_inputs():
- if isinstance(item, strings):
- result.append(item)
- else:
- result.extend(item[1])
-
- for item in manifest.get('dist', '').split():
- result.append(item)
- if _os.path.isdir(item):
- for filename in _shell.files(item):
- result.append(filename)
-
- result = list(dict([(item, None) for item in result]).keys())
- result.sort()
- return result
-
-
-def run(config=('package.cfg',), ext=None, script_args=None, manifest_only=0):
- """ Main runner """
- if ext is None:
- ext = []
-
- cfg = _util.SafeConfigParser()
- cfg.read(config, encoding='utf-8')
- pkg = dict(cfg.items('package'))
- python_min = pkg.get('python.min') or None
- python_max = pkg.get('python.max') or None
- check_python_version('python', python_min, python_max)
- pypy_min = pkg.get('pypy.min') or None
- pypy_max = pkg.get('pypy.max') or None
- check_python_version('pypy', pypy_min, pypy_max)
- jython_min = pkg.get('jython.min') or None
- jython_max = pkg.get('jython.max') or None
- check_python_version('jython', jython_min, jython_max)
-
- manifest = dict(cfg.items('manifest'))
- try:
- docs = dict(cfg.items('docs'))
- except _config_parser.NoSectionError:
- docs = {}
-
- summary, description = find_description(docs)
- scripts = manifest.get('scripts', '').strip() or None
- if scripts:
- scripts = scripts.split()
- modules = manifest.get('modules', '').strip() or None
- if modules:
- modules = modules.split()
- keywords = docs.get('meta.keywords', '').strip() or None
- if keywords:
- keywords = keywords.split()
- revision = pkg.get('version.revision', '').strip()
- if revision:
- revision = "-r%s" % (revision,)
-
- kwargs = {
- 'name': pkg['name'],
- 'version': "%s%s" % (
- pkg['version.number'],
- ["", "-dev%s" % (revision,)][_util.humanbool(
- 'version.dev', pkg.get('version.dev', 'false')
- )],
- ),
- 'provides': find_provides(docs),
- 'description': summary,
- 'long_description': description,
- 'classifiers': find_classifiers(docs),
- 'keywords': keywords,
- 'author': pkg['author.name'],
- 'author_email': pkg['author.email'],
- 'maintainer': pkg.get('maintainer.name'),
- 'maintainer_email': pkg.get('maintainer.email'),
- 'url': pkg.get('url.homepage'),
- 'download_url': pkg.get('url.download'),
- 'license': find_license(docs),
- 'package_dir': {'': manifest.get('packages.lib', '.')},
- 'packages': find_packages(manifest),
- 'py_modules': modules,
- 'ext_modules': ext,
- 'scripts': scripts,
- 'script_args': script_args,
- 'data_files': find_data(pkg['name'], docs),
- 'cmdclass': {
- 'build' : _commands.Build,
- 'build_ext' : _commands.BuildExt,
- 'install' : _commands.Install,
- 'install_data': _commands.InstallData,
- 'install_lib' : _commands.InstallLib,
- }
- }
- for key in ('provides',):
- if key not in _core.setup_keywords:
- del kwargs[key]
-
- if manifest_only:
- return make_manifest(manifest, config, docs, kwargs)
-
- # monkey-patch crappy manifest writer away.
- from distutils.command import sdist
- sdist.sdist.get_file_list = sdist.sdist.read_manifest
-
- return _core.setup(**kwargs)
diff --git a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/shell.py b/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/shell.py
deleted file mode 100644
index 91f2ebc5b40..00000000000
--- a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/shell.py
+++ /dev/null
@@ -1,351 +0,0 @@
-# -*- coding: ascii -*-
-#
-# Copyright 2007 - 2013
-# Andr\xe9 Malo or his licensors, as applicable
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""
-=================
- Shell utilities
-=================
-
-Shell utilities.
-"""
-__author__ = "Andr\xe9 Malo"
-__docformat__ = "restructuredtext en"
-
-import errno as _errno
-import fnmatch as _fnmatch
-import os as _os
-import shutil as _shutil
-import subprocess as _subprocess
-import sys as _sys
-import tempfile as _tempfile
-
-cwd = _os.path.dirname(_os.path.abspath(_sys.argv[0]))
-
-class ExitError(RuntimeError):
- """ Exit error """
- def __init__(self, code):
- RuntimeError.__init__(self, code)
- self.code = code
- self.signal = None
-
-
-class SignalError(ExitError):
- """ Signal error """
- def __init__(self, code, signal):
- ExitError.__init__(self, code)
- import signal as _signal
- self.signal = signal
- for key, val in vars(_signal).items():
- if key.startswith('SIG') and not key.startswith('SIG_'):
- if val == signal:
- self.signalstr = key[3:]
- break
- else:
- self.signalstr = '%04d' % signal
-
-
-def native(path):
- """ Convert slash path to native """
- path = _os.path.sep.join(path.split('/'))
- return _os.path.normpath(_os.path.join(cwd, path))
-
-
-def cp(src, dest):
- """ Copy src to dest """
- _shutil.copy2(native(src), native(dest))
-
-
-def cp_r(src, dest):
- """ Copy -r src to dest """
- _shutil.copytree(native(src), native(dest))
-
-
-def rm(dest):
- """ Remove a file """
- try:
- _os.unlink(native(dest))
- except OSError as e:
- if _errno.ENOENT != e.errno:
- raise
-
-def rm_rf(dest):
- """ Remove a tree """
- dest = native(dest)
- if _os.path.exists(dest):
- for path in files(dest, '*'):
- _os.chmod(native(path), 0o644)
- _shutil.rmtree(dest)
-
-
-mkstemp = _tempfile.mkstemp
-
-
-def _pipespawn(argv, env):
- """ Pipe spawn """
- # pylint: disable = R0912
- import pickle as _pickle
- fd, name = mkstemp('.py')
- try:
- _os.write(fd, ((r"""
-import os
-import pickle
-import subprocess
-import sys
-
-argv = pickle.loads(%(argv)s)
-env = pickle.loads(%(env)s)
-if 'X_JYTHON_WA_PATH' in env:
- env['PATH'] = env['X_JYTHON_WA_PATH']
-
-p = subprocess.Popen(argv, env=env)
-result = p.wait()
-if result < 0:
- print("\n%%d 1" %% (-result))
- sys.exit(2)
-if result == 0:
- sys.exit(0)
-print("\n%%d" %% (result & 7,))
-sys.exit(3)
- """.strip() + "\n") % {
- 'argv': repr(_pickle.dumps(argv)),
- 'env': repr(_pickle.dumps(dict(env))),
- }).encode('utf-8'))
- fd, _ = None, _os.close(fd)
- if _sys.platform == 'win32':
- argv = []
- for arg in [_sys.executable, name]:
- if ' ' in arg or arg.startswith('"'):
- arg = '"%s"' % arg.replace('"', '\\"')
- argv.append(arg)
- argv = ' '.join(argv)
- shell = True
- close_fds = False
- else:
- argv = [_sys.executable, name]
- shell = False
- close_fds = True
-
- res = 0
- if 'X_JYTHON_WA_PATH' in env:
- env['PATH'] = env['X_JYTHON_WA_PATH']
-
- proc = _subprocess.Popen(argv,
- shell=shell,
- stdin=_subprocess.PIPE,
- stdout=_subprocess.PIPE,
- close_fds=close_fds,
- env=env,
- )
- try:
- proc.stdin.close()
- result = proc.stdout.read()
- finally:
- res = proc.wait()
- if res != 0:
- if res == 2:
- signal, code = list(map(int, result.splitlines()[-1].split()))
- raise SignalError(code, signal)
- elif res == 3:
- code = int(result.splitlines()[-1].strip())
- raise ExitError(code)
- raise ExitError(res)
-
- return result.decode('latin-1')
- finally:
- try:
- if fd is not None:
- _os.close(fd)
- finally:
- _os.unlink(name)
-
-
-def _filepipespawn(infile, outfile, argv, env):
- """ File Pipe spawn """
- import pickle as _pickle
- fd, name = mkstemp('.py')
- try:
- _os.write(fd, (("""
-import os
-import pickle
-import sys
-
-infile = pickle.loads(%(infile)s)
-outfile = pickle.loads(%(outfile)s)
-argv = pickle.loads(%(argv)s)
-env = pickle.loads(%(env)s)
-
-if infile is not None:
- infile = open(infile, 'rb')
- os.dup2(infile.fileno(), 0)
- infile.close()
-if outfile is not None:
- outfile = open(outfile, 'wb')
- os.dup2(outfile.fileno(), 1)
- outfile.close()
-
-pid = os.spawnve(os.P_NOWAIT, argv[0], argv, env)
-result = os.waitpid(pid, 0)[1]
-sys.exit(result & 7)
- """.strip() + "\n") % {
- 'infile': repr(_pickle.dumps(_os.path.abspath(infile))),
- 'outfile': repr(_pickle.dumps(_os.path.abspath(outfile))),
- 'argv': repr(_pickle.dumps(argv)),
- 'env': repr(_pickle.dumps(env)),
- }).encode('utf-8'))
- fd, _ = None, _os.close(fd)
- if _sys.platform == 'win32':
- argv = []
- for arg in [_sys.executable, name]:
- if ' ' in arg or arg.startswith('"'):
- arg = '"%s"' % arg.replace('"', '\\"')
- argv.append(arg)
- argv = ' '.join(argv)
- close_fds = False
- shell = True
- else:
- argv = [_sys.executable, name]
- close_fds = True
- shell = False
-
- p = _subprocess.Popen(
- argv, env=env, shell=shell, close_fds=close_fds
- )
- return p.wait()
- finally:
- try:
- if fd is not None:
- _os.close(fd)
- finally:
- _os.unlink(name)
-
-
-def spawn(*argv, **kwargs):
- """ Spawn a process """
- if _sys.platform == 'win32':
- newargv = []
- for arg in argv:
- if not arg or ' ' in arg or arg.startswith('"'):
- arg = '"%s"' % arg.replace('"', '\\"')
- newargv.append(arg)
- argv = newargv
- close_fds = False
- shell = True
- else:
- close_fds = True
- shell = False
-
- env = kwargs.get('env')
- if env is None:
- env = dict(_os.environ)
- if 'X_JYTHON_WA_PATH' in env:
- env['PATH'] = env['X_JYTHON_WA_PATH']
-
- echo = kwargs.get('echo')
- if echo:
- print(' '.join(argv))
- filepipe = kwargs.get('filepipe')
- if filepipe:
- return _filepipespawn(
- kwargs.get('stdin'), kwargs.get('stdout'), argv, env
- )
- pipe = kwargs.get('stdout')
- if pipe:
- return _pipespawn(argv, env)
-
- p = _subprocess.Popen(argv, env=env, shell=shell, close_fds=close_fds)
- return p.wait()
-
-
-walk = _os.walk
-
-
-def files(base, wildcard='[!.]*', recursive=1, prune=('.git', '.svn', 'CVS')):
- """ Determine a filelist """
- for dirpath, dirnames, filenames in walk(native(base)):
- for item in prune:
- if item in dirnames:
- dirnames.remove(item)
-
- filenames.sort()
- for name in _fnmatch.filter(filenames, wildcard):
- dest = _os.path.join(dirpath, name)
- if dest.startswith(cwd):
- dest = dest.replace(cwd, '', 1)
- aslist = []
- head, tail = _os.path.split(dest)
- while tail:
- aslist.append(tail)
- head, tail = _os.path.split(head)
- aslist.reverse()
- dest = '/'.join(aslist)
- yield dest
-
- if not recursive:
- break
- dirnames.sort()
-
-
-def dirs(base, wildcard='[!.]*', recursive=1, prune=('.git', '.svn', 'CVS')):
- """ Determine a filelist """
- for dirpath, dirnames, filenames in walk(native(base)):
- for item in prune:
- if item in dirnames:
- dirnames.remove(item)
-
- dirnames.sort()
- for name in _fnmatch.filter(dirnames, wildcard):
- dest = _os.path.join(dirpath, name)
- if dest.startswith(cwd):
- dest = dest.replace(cwd, '', 1)
- aslist = []
- head, tail = _os.path.split(dest)
- while tail:
- aslist.append(tail)
- head, tail = _os.path.split(head)
- aslist.reverse()
- dest = '/'.join(aslist)
- yield dest
-
- if not recursive:
- break
-
-
-def frompath(executable):
- """ Find executable in PATH """
- # Based on distutils.spawn.find_executable.
- path = _os.environ.get('PATH', '')
- paths = [
- _os.path.expanduser(item)
- for item in path.split(_os.pathsep)
- ]
- ext = _os.path.splitext(executable)[1]
- exts = ['']
- if _sys.platform == 'win32' or _os.name == 'os2':
- eext = ['.exe', '.bat', '.py']
- if ext not in eext:
- exts.extend(eext)
-
- for ext in exts:
- if not _os.path.isfile(executable + ext):
- for path in paths:
- fname = _os.path.join(path, executable + ext)
- if _os.path.isfile(fname):
- # the file exists, we have a shot at spawn working
- return fname
- else:
- return executable + ext
-
- return None
diff --git a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/term/__init__.py b/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/term/__init__.py
deleted file mode 100644
index 5459454514b..00000000000
--- a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/term/__init__.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# -*- coding: ascii -*-
-#
-# Copyright 2010, 2011
-# Andr\xe9 Malo or his licensors, as applicable
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""
-=====================
- Package _setup.term
-=====================
-
-Terminal tools, not distributed.
-"""
-__author__ = "Andr\xe9 Malo"
-__docformat__ = "restructuredtext en"
-
-# pylint: disable = W0611
-from _setup.term._term import terminfo, write, green, red, yellow, announce
diff --git a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/term/_term.py b/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/term/_term.py
deleted file mode 100644
index b94f58e27f1..00000000000
--- a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/term/_term.py
+++ /dev/null
@@ -1,116 +0,0 @@
-# -*- coding: ascii -*-
-#
-# Copyright 2007, 2008, 2009, 2010, 2011
-# Andr\xe9 Malo or his licensors, as applicable
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""
-=================
- Terminal writer
-=================
-"""
-__author__ = "Andr\xe9 Malo"
-__docformat__ = "restructuredtext en"
-
-import sys as _sys
-
-
-class _INFO(dict):
- """ Terminal info dict """
-
- def __init__(self):
- """ Initialization """
- dict.__init__(self, {
- 'NORMAL': '',
- 'BOLD': '',
- 'ERASE': '\n',
- 'RED': '',
- 'YELLOW': '',
- 'GREEN': '',
- })
- try:
- import curses as _curses
- except ImportError:
- # fixup if a submodule of curses failed.
- if 'curses' in _sys.modules:
- del _sys.modules['curses']
- else:
- try:
- _curses.setupterm()
- except (TypeError, _curses.error):
- pass
- else:
- def make_color(color):
- """ Make color control string """
- seq = _curses.tigetstr('setaf').decode('ascii')
- if seq is not None:
- # XXX may fail - need better logic
- seq = seq.replace("%p1", "") % color
- return seq
-
- self['NORMAL'] = _curses.tigetstr('sgr0').decode('ascii')
- self['BOLD'] = _curses.tigetstr('bold').decode('ascii')
-
- erase = _curses.tigetstr('el1').decode('ascii')
- if erase is not None:
- self['ERASE'] = erase + \
- _curses.tigetstr('cr').decode('ascii')
-
- self['RED'] = make_color(_curses.COLOR_RED)
- self['YELLOW'] = make_color(_curses.COLOR_YELLOW)
- self['GREEN'] = make_color(_curses.COLOR_GREEN)
-
- def __getitem__(self, key):
- """ Deliver always """
- dict.get(self, key) or ""
-
-
-def terminfo():
- """ Get info singleton """
- # pylint: disable = E1101, W0612
- if terminfo.info is None:
- terminfo.info = _INFO()
- return terminfo.info
-terminfo.info = None
-
-
-def write(fmt, **kwargs):
- """ Write stuff on the terminal """
- parm = dict(terminfo())
- parm.update(kwargs)
- _sys.stdout.write(fmt % parm)
- _sys.stdout.flush()
-
-
-def green(bmt, **kwargs):
- """ Write something in green on screen """
- announce("%%(GREEN)s%s%%(NORMAL)s" % bmt, **kwargs)
-
-
-def red(bmt, **kwargs):
- """ Write something in red on the screen """
- announce("%%(BOLD)s%%(RED)s%s%%(NORMAL)s" % bmt, **kwargs)
-
-
-def yellow(fmt, **kwargs):
- """ Write something in yellow on the screen """
- announce("%%(BOLD)s%%(YELLOW)s%s%%(NORMAL)s" % fmt, **kwargs)
-
-
-def announce(fmt, **kwargs):
- """ Announce something """
- write(fmt, **kwargs)
- _sys.stdout.write("\n")
- _sys.stdout.flush()
-
-
diff --git a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/util.py b/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/util.py
deleted file mode 100644
index a07daa812fe..00000000000
--- a/chromium/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py3/util.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# -*- coding: ascii -*-
-#
-# Copyright 2007, 2008, 2009, 2010, 2011
-# Andr\xe9 Malo or his licensors, as applicable
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""
-=================
- Setup utilities
-=================
-
-Setup utilities.
-"""
-__author__ = "Andr\xe9 Malo"
-__docformat__ = "restructuredtext en"
-
-from distutils import util as _util
-try:
- from configparser import SafeConfigParser
-except ImportError:
- import configparser as _config_parser
- class SafeConfigParser(_config_parser.ConfigParser):
- """ Safe config parser """
- def _interpolate(self, section, option, rawval, vars):
- return rawval
-
- def items(self, section):
- return [(key, self.get(section, key))
- for key in self.options(section)
- ]
-
-
-def humanbool(name, value):
- """
- Determine human boolean value
-
- :Parameters:
- `name` : ``str``
- The config key (used for error message)
-
- `value` : ``str``
- The config value
-
- :Return: The boolean value
- :Rtype: ``bool``
-
- :Exceptions:
- - `ValueError` : The value could not be recognized
- """
- try:
- return _util.strtobool(str(value).strip().lower() or 'no')
- except ValueError:
- raise ValueError("Unrecognized config value: %s = %s" % (name, value))