def create_napp(cls, meta_package=False):
        """Bootstrap a basic NApp structure for you to develop your NApp.

        This will create, on the current folder, a clean structure of a NAPP,
        filling some contents on this structure.
        """
        templates_path = SKEL_PATH / 'napp-structure/username/napp'

        ui_templates_path = os.path.join(templates_path, 'ui')

        username = None
        napp_name = None

        print('--------------------------------------------------------------')
        print('Welcome to the bootstrap process of your NApp.')
        print('--------------------------------------------------------------')
        print('In order to answer both the username and the napp name,')
        print('You must follow this naming rules:')
        print(' - name starts with a letter')
        print(' - name contains only letters, numbers or underscores')
        print(' - at least three characters')
        print('--------------------------------------------------------------')
        print('')
        while not cls.valid_name(username):
            username = input('Please, insert your NApps Server username: ')

        while not cls.valid_name(napp_name):
            napp_name = input('Please, insert your NApp name: ')

        description = input('Please, insert a brief description for your'
                            'NApp [optional]: ')
        if not description:
            # pylint: disable=fixme
            description = '# TODO: <<<< Insert your NApp description here >>>>'
            # pylint: enable=fixme

        context = {'username': username, 'napp': napp_name,
                   'description': description}

        #: Creating the directory structure (username/napp_name)
        os.makedirs(username, exist_ok=True)

        #: Creating ``__init__.py`` files
        with open(os.path.join(username, '__init__.py'), 'w') as init_file:
            init_file.write(f'"""Napps for the user {username}.""""')

        os.makedirs(os.path.join(username, napp_name))

        #: Creating the other files based on the templates
        templates = os.listdir(templates_path)
        templates.remove('ui')
        templates.remove('openapi.yml.template')

        if meta_package:
            templates.remove('main.py.template')
            templates.remove('settings.py.template')

        for tmp in templates:
            fname = os.path.join(username, napp_name,
                                 tmp.rsplit('.template')[0])
            with open(fname, 'w') as file:
                content = cls.render_template(templates_path, tmp, context)
                file.write(content)

        if not meta_package:
            NAppsManager.create_ui_structure(username, napp_name,
                                             ui_templates_path, context)

        print()
        print(f'Congratulations! Your NApp has been bootstrapped!\nNow you '
              'can go to the directory {username}/{napp_name} and begin to '
              'code your NApp.')
        print('Have fun!')
def create_napp ( cls , meta_package = False ) : templates_path = SKEL_PATH / 'napp-structure/username/napp' ui_templates_path = os . path . join ( templates_path , 'ui' ) username = None napp_name = None print ( '--------------------------------------------------------------' ) print ( 'Welcome to the bootstrap process of your NApp.' ) print ( '--------------------------------------------------------------' ) print ( 'In order to answer both the username and the napp name,' ) print ( 'You must follow this naming rules:' ) print ( ' - name starts with a letter' ) print ( ' - name contains only letters, numbers or underscores' ) print ( ' - at least three characters' ) print ( '--------------------------------------------------------------' ) print ( '' ) while not cls . valid_name ( username ) : username = input ( 'Please, insert your NApps Server username: ' ) while not cls . valid_name ( napp_name ) : napp_name = input ( 'Please, insert your NApp name: ' ) description = input ( 'Please, insert a brief description for your' 'NApp [optional]: ' ) if not description : description = '# TODO: <<<< Insert your NApp description here >>>>' context = { 'username' : username , 'napp' : napp_name , 'description' : description } os . makedirs ( username , exist_ok = True ) with open ( os . path . join ( username , '__init__.py' ) , 'w' ) as init_file : init_file . write ( f'"""Napps for the user {username}.""""' ) os . makedirs ( os . path . join ( username , napp_name ) ) templates = os . listdir ( templates_path ) templates . remove ( 'ui' ) templates . remove ( 'openapi.yml.template' ) if meta_package : templates . remove ( 'main.py.template' ) templates . remove ( 'settings.py.template' ) for tmp in templates : fname = os . path . join ( username , napp_name , tmp . rsplit ( '.template' ) [ 0 ] ) with open ( fname , 'w' ) as file : content = cls . render_template ( templates_path , tmp , context ) file . write ( content ) if not meta_package : NAppsManager . create_ui_structure ( username , napp_name , ui_templates_path , context ) print ( ) print ( f'Congratulations! Your NApp has been bootstrapped!\nNow you ' 'can go to the directory {username}/{napp_name} and begin to ' 'code your NApp.' ) print ( 'Have fun!' )
Bootstrap a basic NApp structure for you to develop your NApp.

        This will create, on the current folder, a clean structure of a NAPP,
        filling some contents on this structure.