else: chart_variables = ctx.obj if output_path is None: output_path = pathlib.Path(input_path).parent / pathlib.Path( "dist") return pdk8s.synth.synth(chart_variables, output_format, output_path) if with_input: option_input(synth) @main.command() def init(): import pkg_resources import cookiecutter.main path = pkg_resources.resource_filename("pdk8s", "cookiecutter") cookiecutter.main.cookiecutter(path) @main.command() def watch(): print("not yet implemented") return 99 add_subcommands(main, with_input=True) if __name__ == "__main__": sys.exit(main()) # pragma: no cover
def build_app(info): template = template_to_url(info.template) proj_dir = cookiecutter.main.cookiecutter( template, no_input=True, output_dir=info.working_dir, extra_context={ 'project_name': info.project_name, 'repo_name': to_project_style(info.project_name), 'template_language': info.template_language, "project_slug": to_project_style(info.project_name), "contact_name": "Company Name", "domain_name": "yourcompany.com", "contact_email": "*****@*****.**", "description": "", "integrations": "", "mailchimp_api": "", "mailchimp_list_id": "", "outbound_smtp_username": "", "outbound_smtp_password": "", "outbound_smtp_server": "", "outbound_smtp_port": "587", "rollbar_access_token": "" }) return proj_dir if __name__ == '__main__': sys.exit(main())
'full_name': info.full_name, 'game_type': info.game_type } ) return proj_dir def to_package_style(text): if not text: return text text = text.strip() url_txt = '' for ch in text: url_txt += ch if ch.isalnum() or ch == '.' else ' ' count = -1 while count != len(url_txt): count = len(url_txt) url_txt = url_txt.strip() url_txt = url_txt.replace(' ', ' ') url_txt = url_txt.replace(' ', '-') url_txt = url_txt.replace('--', '-') return url_txt.lower() if __name__ == '__main__': main()