コード例 #1
0
def plugin_php(working_path, file, environment):
    """
	Works With Traditional Plugin
	"""
    """
	Used to create style.css
	"""
    try:
        license_int = int(environment['license'])
    except ValueError:
        license_int = 0
    license = license_arr[license_int]
    content = Wp_Plugin_Header.format(theme_name=environment['plugin_name'],
                                      theme_uri=environment['plugin_uri'],
                                      author=environment['author'],
                                      author_uri=environment['github_link'],
                                      description=environment['desc'],
                                      version=environment['version'],
                                      license=license,
                                      text_domain=environment['text_domain'])
    lic_content = license_dct[license].format(year=environment['year'],
                                              author=environment['author'])

    lic_content = Wp_license.format(lic_content)
    content = content + lic_content
    write_to_file(working_path, file, environment, content)
コード例 #2
0
def readme(working_path, file, environment, storage=''):
    """
	This is used to create simple readme file
	"""
    _storage = ''
    prev_content = storage
    header = Readme_Header.format(readme_header=environment['project_name'],
                                  readme_text=environment['readme_text'])
    Contrib = Contributing.format(github_link=environment['github_link'])
    _storage = _storage + header + prev_content + Contrib
    write_to_file(working_path, file, environment, _storage)
コード例 #3
0
def license(working_path, file, environment):
    """
	Hook for license
	"""
    try:
        license_int = int(environment['license'])
    except ValueError:
        license_int = 0

    content = license_dct[license_arr[license_int]].format(
        year=environment['year'], author=environment['author'])
    write_to_file(working_path, file, environment, content)
コード例 #4
0
def _style_css(working_path, file, environment):
    """
	Used to create style.css
	"""
    try:
        license_int = int(environment['license'])
    except ValueError:
        license_int = 0
    license = license_arr[license_int]
    content = Wp_Theme_Header.format(theme_name=environment['theme_name'],
                                     theme_uri=environment['github_link'],
                                     author=environment['author'],
                                     author_uri=environment['github_link'],
                                     description=environment['desc'],
                                     version=environment['version'],
                                     license=license,
                                     text_domain=environment['text_domain'],
                                     tags=environment['tags'])
    write_to_file(working_path, file, environment, content)
コード例 #5
0
def setup_py(working_path, file, environment):
    """
	Creating Custom Triggers For Setup.py file python
	"""
    try:
        license_int = int(environment['license'])
    except ValueError:
        license_int = 0

    content = SETUP_PY.format(project_name=environment['project_name'],
                              version=environment['version'],
                              package_name=environment['project_name'],
                              project_url=environment['github_link'],
                              license=license_arr[license_int],
                              author=environment['author'],
                              author_email='',
                              description=environment['desc'])

    write_to_file(working_path, file, environment, content)
コード例 #6
0
def _index_html(working_path, file, environment):
    """
	Index.html
	"""
    write_to_file(working_path, file, environment, INDEX_HTML)
コード例 #7
0
def gitignore_py(working_path, file, environment):
    """
	Hook for gitignore File
	"""
    write_to_file(working_path, file, environment, GITIGNORE_PY)
コード例 #8
0
def editor_config(working_path, file, environment):
    """
	For Editor Config Hook
	"""
    write_to_file(working_path, file, environment, EditorConfig)
コード例 #9
0
def authors(working_path, file, environment):
    """
	Hook For authors
	"""
    write_to_file(working_path, file, environment, environment['author'])