From 04387deeab820e75c6d37d2ddd5b514cb7bcfd9e Mon Sep 17 00:00:00 2001 From: Pavel Aharoni Date: Sun, 11 Jun 2017 14:33:57 +0300 Subject: [SDC-32] separate Tosca Parser from DC Change-Id: I7e7f31ff2bd92fec22031f75b7051d129a21d01b Signed-off-by: Pavel Aharoni --- .../pbr-1.8.0-py2.7.egg/pbr/hooks/__init__.py | 28 ------ .../pbr-1.8.0-py2.7.egg/pbr/hooks/backwards.py | 33 ------- .../pbr-1.8.0-py2.7.egg/pbr/hooks/base.py | 34 ------- .../pbr-1.8.0-py2.7.egg/pbr/hooks/commands.py | 66 ------------- .../pbr-1.8.0-py2.7.egg/pbr/hooks/files.py | 103 --------------------- .../pbr-1.8.0-py2.7.egg/pbr/hooks/metadata.py | 32 ------- 6 files changed, 296 deletions(-) delete mode 100644 jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/__init__.py delete mode 100644 jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/backwards.py delete mode 100644 jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/base.py delete mode 100644 jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/commands.py delete mode 100644 jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/files.py delete mode 100644 jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/metadata.py (limited to 'jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks') diff --git a/jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/__init__.py b/jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/__init__.py deleted file mode 100644 index f0056c0..0000000 --- a/jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# All Rights Reserved. -# -# 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. - -from pbr.hooks import backwards -from pbr.hooks import commands -from pbr.hooks import files -from pbr.hooks import metadata - - -def setup_hook(config): - """Filter config parsed from a setup.cfg to inject our defaults.""" - metadata_config = metadata.MetadataConfig(config) - metadata_config.run() - backwards.BackwardsCompatConfig(config).run() - commands.CommandsConfig(config).run() - files.FilesConfig(config, metadata_config.get_name()).run() diff --git a/jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/backwards.py b/jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/backwards.py deleted file mode 100644 index 01f07ab..0000000 --- a/jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/backwards.py +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# All Rights Reserved. -# -# 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. - -from pbr.hooks import base -from pbr import packaging - - -class BackwardsCompatConfig(base.BaseConfig): - - section = 'backwards_compat' - - def hook(self): - self.config['include_package_data'] = 'True' - packaging.append_text_list( - self.config, 'dependency_links', - packaging.parse_dependency_links()) - packaging.append_text_list( - self.config, 'tests_require', - packaging.parse_requirements( - packaging.TEST_REQUIREMENTS_FILES, - strip_markers=True)) diff --git a/jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/base.py b/jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/base.py deleted file mode 100644 index 6672a36..0000000 --- a/jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/base.py +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# All Rights Reserved. -# -# 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. - - -class BaseConfig(object): - - section = None - - def __init__(self, config): - self._global_config = config - self.config = self._global_config.get(self.section, dict()) - self.pbr_config = config.get('pbr', dict()) - - def run(self): - self.hook() - self.save() - - def hook(self): - pass - - def save(self): - self._global_config[self.section] = self.config diff --git a/jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/commands.py b/jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/commands.py deleted file mode 100644 index fd757e4..0000000 --- a/jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/commands.py +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# All Rights Reserved. -# -# 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. - -import os - -from setuptools.command import easy_install - -from pbr.hooks import base -from pbr import options -from pbr import packaging - - -class CommandsConfig(base.BaseConfig): - - section = 'global' - - def __init__(self, config): - super(CommandsConfig, self).__init__(config) - self.commands = self.config.get('commands', "") - - def save(self): - self.config['commands'] = self.commands - super(CommandsConfig, self).save() - - def add_command(self, command): - self.commands = "%s\n%s" % (self.commands, command) - - def hook(self): - self.add_command('pbr.packaging.LocalEggInfo') - self.add_command('pbr.packaging.LocalSDist') - self.add_command('pbr.packaging.LocalInstallScripts') - self.add_command('pbr.packaging.LocalDevelop') - self.add_command('pbr.packaging.LocalRPMVersion') - if os.name != 'nt': - easy_install.get_script_args = packaging.override_get_script_args - - if packaging.have_sphinx(): - self.add_command('pbr.builddoc.LocalBuildDoc') - self.add_command('pbr.builddoc.LocalBuildLatex') - - if os.path.exists('.testr.conf') and packaging.have_testr(): - # There is a .testr.conf file. We want to use it. - self.add_command('pbr.packaging.TestrTest') - elif self.config.get('nosetests', False) and packaging.have_nose(): - # We seem to still have nose configured - self.add_command('pbr.packaging.NoseTest') - - use_egg = options.get_boolean_option( - self.pbr_config, 'use-egg', 'PBR_USE_EGG') - # We always want non-egg install unless explicitly requested - if 'manpages' in self.pbr_config or not use_egg: - self.add_command('pbr.packaging.LocalInstall') - else: - self.add_command('pbr.packaging.InstallWithGit') diff --git a/jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/files.py b/jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/files.py deleted file mode 100644 index 48bf9e3..0000000 --- a/jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/files.py +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# All Rights Reserved. -# -# 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. - -import os -import sys - -from pbr import find_package -from pbr.hooks import base - - -def get_manpath(): - manpath = 'share/man' - if os.path.exists(os.path.join(sys.prefix, 'man')): - # This works around a bug with install where it expects every node - # in the relative data directory to be an actual directory, since at - # least Debian derivatives (and probably other platforms as well) - # like to symlink Unixish /usr/local/man to /usr/local/share/man. - manpath = 'man' - return manpath - - -def get_man_section(section): - return os.path.join(get_manpath(), 'man%s' % section) - - -class FilesConfig(base.BaseConfig): - - section = 'files' - - def __init__(self, config, name): - super(FilesConfig, self).__init__(config) - self.name = name - self.data_files = self.config.get('data_files', '') - - def save(self): - self.config['data_files'] = self.data_files - super(FilesConfig, self).save() - - def expand_globs(self): - finished = [] - for line in self.data_files.split("\n"): - if line.rstrip().endswith('*') and '=' in line: - (target, source_glob) = line.split('=') - source_prefix = source_glob.strip()[:-1] - target = target.strip() - if not target.endswith(os.path.sep): - target += os.path.sep - for (dirpath, dirnames, fnames) in os.walk(source_prefix): - finished.append( - "%s = " % dirpath.replace(source_prefix, target)) - finished.extend( - [" %s" % os.path.join(dirpath, f) for f in fnames]) - else: - finished.append(line) - - self.data_files = "\n".join(finished) - - def add_man_path(self, man_path): - self.data_files = "%s\n%s =" % (self.data_files, man_path) - - def add_man_page(self, man_page): - self.data_files = "%s\n %s" % (self.data_files, man_page) - - def get_man_sections(self): - man_sections = dict() - manpages = self.pbr_config['manpages'] - for manpage in manpages.split(): - section_number = manpage.strip()[-1] - section = man_sections.get(section_number, list()) - section.append(manpage.strip()) - man_sections[section_number] = section - return man_sections - - def hook(self): - packages = self.config.get('packages', self.name).strip() - expanded = [] - for pkg in packages.split("\n"): - if os.path.isdir(pkg.strip()): - expanded.append(find_package.smart_find_packages(pkg.strip())) - - self.config['packages'] = "\n".join(expanded) - - self.expand_globs() - - if 'manpages' in self.pbr_config: - man_sections = self.get_man_sections() - for (section, pages) in man_sections.items(): - manpath = get_man_section(section) - self.add_man_path(manpath) - for page in pages: - self.add_man_page(page) diff --git a/jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/metadata.py b/jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/metadata.py deleted file mode 100644 index 3f65b6d..0000000 --- a/jython-tosca-parser/src/main/resources/Lib/site-packages/pbr-1.8.0-py2.7.egg/pbr/hooks/metadata.py +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# All Rights Reserved. -# -# 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. - -from pbr.hooks import base -from pbr import packaging - - -class MetadataConfig(base.BaseConfig): - - section = 'metadata' - - def hook(self): - self.config['version'] = packaging.get_version( - self.config['name'], self.config.get('version', None)) - packaging.append_text_list( - self.config, 'requires_dist', - packaging.parse_requirements()) - - def get_name(self): - return self.config['name'] -- cgit 1.2.3-korg