Пример #1
0
def main(argv=None):
    if argv is None:
        argv = sys.argv[1:]

    if not argv or argv[0] == "help":
        help()
    elif argv[0] == "check":
        return check_main(argv[1:])
    elif argv[0] == "list":
        return list_main(argv[1:])
    elif argv[0] == "write":
        return write_main(argv[1:])
    else:
        print("Don't understand {!r}".format(" ".join(argv)))
        help()
Пример #2
0
def main(argv=None):
    """The edx_lint command entry point."""
    if argv is None:
        argv = sys.argv[1:]

    if not argv or argv[0] == "help":
        show_help()
    elif argv[0] == "check":
        return check_main(argv[1:])
    elif argv[0] == "list":
        return list_main(argv[1:])
    elif argv[0] == "write":
        return write_main(argv[1:])
    else:
        print("Don't understand {!r}".format(" ".join(argv)))
        show_help()
extra_context["author_name"] = "{{cookiecutter.author_name}}"
extra_context["author_email"] = "{{cookiecutter.author_email}}"
extra_context["open_source_license"] = "{{cookiecutter.open_source_license}}"

extra_context["placeholder_repo_name"] = python_placeholder_repo_name

cookiecutter(
    EDX_COOKIECUTTER_ROOTDIR,
    extra_context=extra_context,
    no_input=True,
    directory='python-template',
)

project_root_dir = os.getcwd()
python_template_cookiecutter_output_loc = os.path.join(
    project_root_dir, python_placeholder_repo_name)
files = os.listdir(python_template_cookiecutter_output_loc)

for f in files:
    move(os.path.join(python_template_cookiecutter_output_loc, f),
         os.path.join(project_root_dir, f))

os.rmdir(python_template_cookiecutter_output_loc)

# Removing unecessary files from python and django templates:
remove("setup.py")
remove("tox.ini")
remove("MANIFEST.in")

write_main(['pylintrc'])