def process(self): """I process the project generation """ if self.noask is False: print( 'Welcome to the mamba application generator v{}\n' 'You are going to genearate a new Mamba application on {} ' 'with the following options:\n'.format( version.short(), filepath.abspath(filepath.os.getcwd()) ) ) for key, value in self.__dict__.iteritems(): if not key.startswith('_'): print('{key}: {value}'.format( key=blue(key.ljust(12)), value='{}{}'.format(reset(), str(value)), )) if Interaction.userquery( 'Would you like to generate this application?') == 'No': print('\nQuitting.') sys.exit(0) return self.generate_application()
def write(options): """ Write options to the configuration file :param options: the options from the mamba-admin commands tool :type options: dict """ config_file = filepath.FilePath('{}/config/database.json'.format( filepath.abspath('.'))) config_file.open('w').write(json.dumps(options, indent=4))
def write(options): """ Write options to the configuration file :param options: the options from the mamba-admin commands tool :type options: dict """ config_file = filepath.FilePath( '{}/config/database.json'.format(filepath.abspath('.')) ) config_file.open('w').write(json.dumps(options, indent=4))