Module licenseware.cli.app_root_files_creator.app_root_files_creator

Expand source code
from licenseware.cli.base_creator import BaseCreator
from . import templates


root_files = [
    'gitignore',
    'main.py',
    'README.md',
    'requirements.txt',
    'tox.ini',
    'version.txt',
    'CHANGELOG.md',
    'setup.py',
    'requirements-dev.txt',
    'requirements-tests.txt'
]


class AppRootFilesCreator(BaseCreator):

    def __init__(self, app_id: str):
        super().__init__(app_id)


    def create(self):

        for file in root_files:    

            filename = file if file not in ['gitignore'] else '.' + file

            self.create_file(
                filename=filename,
                filepath='./',
                template_filename=file + '.jinja',
                template_resource=templates
            )

Classes

class AppRootFilesCreator (app_id: str)

This class uses the given entity_id which can be: uploader_id, report_id, app_id etc The entity_id will have multiple derivate shapes (see bellow transformations in the init method) which will be passed to jinja templates as template variables

Each file creation class should inherit (if possible) from this class.

As an example you can see licenseware/cli/uploader_creator package.

Expand source code
class AppRootFilesCreator(BaseCreator):

    def __init__(self, app_id: str):
        super().__init__(app_id)


    def create(self):

        for file in root_files:    

            filename = file if file not in ['gitignore'] else '.' + file

            self.create_file(
                filename=filename,
                filepath='./',
                template_filename=file + '.jinja',
                template_resource=templates
            )

Ancestors

Methods

def create(self)
Expand source code
def create(self):

    for file in root_files:    

        filename = file if file not in ['gitignore'] else '.' + file

        self.create_file(
            filename=filename,
            filepath='./',
            template_filename=file + '.jinja',
            template_resource=templates
        )

Inherited members