summaryrefslogtreecommitdiffstats
path: root/opnfv-theme/setup.py
blob: 55f55bc92c9f82111e466c821cf732185d6b94be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from setuptools import setup, find_packages

from sphinx_opnfv_theme import __version__


setup(
    name='sphinx_opnfv_theme',
    description="OPNFV Theme for Sphinx",
    long_description=open('README.rst').read(),
    url='https://docs.opnfv.org/',
    author='Trevor Bramwell',
    author_email='tbramwell@linuxfoundation.org',
    version=__version__,
    entry_points={
        'sphinx.html_themes': [
            'opnfv = sphinx_opnfv_theme',
        ]
    },
    packages=find_packages(),
    install_requires=[
        'sphinx_bootstrap_theme',
        'sphinxcontrib-httpdomain',
    ],
    include_package_data=True,
    package_data={'sphinx_opnfv_theme': [
        'theme.conf',
        'static/*',
        '*.html',
    ]},
)
ss="n">file_list: datas = yaml.load(open(file)) for key, value in datas.items(): if key == "pip_packages": continue if not key.endswith("packages") and not key.endswith("packages_noarch"): continue if not value: continue if not isinstance(value, list): value = [value] for i in value: if i in special_packages: continue if i not in package_name_list: package_name_list.append(i) return package_name_list def generate_download_script(root="", arch="", tmpl="", docker_tmpl="", default_packages="", special_packages="", special_packages_script_dir="", special_packages_dir=""): package_name_list = get_packages_name_list(get_file_list(root, arch), special_packages) if root else [] tmpl = Template(file=tmpl, searchList={'packages':package_name_list, 'default_packages':default_packages}) with open('work/repo/install_packages.sh', 'w') as f: f.write(tmpl.respond()) make_script = [] for i in special_packages: name = 'make_' + i + '.sh' if os.path.exists(os.path.join(special_packages_script_dir, name)): make_script.append(name) searchList = {'scripts':make_script} if os.path.exists(special_packages_dir): special_packages_names=[] for parent, dirname, filenames in os.walk(special_packages_dir): for filename in filenames: if os.path.isfile(os.path.join(parent, filename)): special_packages_names.append(filename) searchList.update({'spcial_packages':special_packages_names}) Dockerfile=os.path.basename(docker_tmpl).split('.')[0] tmpl = Template(file=docker_tmpl, searchList=searchList) with open(os.path.join('work/repo', Dockerfile), 'w') as f: f.write(tmpl.respond()) if __name__=='__main__': # generate_download_script('ansible', 'Debian', 'Debian.tmpl') generate_download_script(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5].split(' '), sys.argv[6].split(' '), sys.argv[7], sys.argv[8])