diff --git a/cookiecutter.json b/cookiecutter.json index 73f88a3e7..44f10185a 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -14,5 +14,6 @@ "use_maildump": "n", "use_sentry": "n", "use_docker": "n", + "use_pycharm": "n", "windows": "n" } diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 7b2f95e59..f19f2d1d3 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -4,6 +4,7 @@ import shutil project_directory = os.path.realpath(os.path.curdir) +# ------------------------------------------------------------------------------ docker = '{{cookiecutter.use_docker}}' == 'y' docker_files = [ @@ -23,3 +24,23 @@ if not docker: for path in docker_dirs: shutil.rmtree(os.path.join(project_directory, path)) + +# ------------------------------------------------------------------------------ +pycharm = '{{cookiecutter.use_pycharm}}' == 'y' + +pycharm_files = [ + +] + +pycharm_dirs = [ + '.idea/', +] + +if not pycharm: + for path in pycharm_files: + os.remove(os.path.join(project_directory, path)) + + for path in pycharm_dirs: + shutil.rmtree(os.path.join(project_directory, path)) + +# ------------------------------------------------------------------------------ diff --git a/{{cookiecutter.repo_name}}/.gitignore b/{{cookiecutter.repo_name}}/.gitignore index ff0e7b0cd..391631682 100644 --- a/{{cookiecutter.repo_name}}/.gitignore +++ b/{{cookiecutter.repo_name}}/.gitignore @@ -37,8 +37,14 @@ nosetests.xml *.mo *.pot +{% if cookiecutter.use_pycharm == 'y' %} # Pycharm .idea +!.idea/modules.xml +!.idea/{{cookiecutter.repo_name}}.iml +!.idea/runConfigurations/Docker.xml +{% endif %} + # Vim diff --git a/{{cookiecutter.repo_name}}/.idea/modules.xml b/{{cookiecutter.repo_name}}/.idea/modules.xml new file mode 100644 index 000000000..21b6ceb82 --- /dev/null +++ b/{{cookiecutter.repo_name}}/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/{{cookiecutter.repo_name}}/.idea/runConfigurations/Docker.xml b/{{cookiecutter.repo_name}}/.idea/runConfigurations/Docker.xml new file mode 100644 index 000000000..19d89d673 --- /dev/null +++ b/{{cookiecutter.repo_name}}/.idea/runConfigurations/Docker.xml @@ -0,0 +1,33 @@ + + + + diff --git a/{{cookiecutter.repo_name}}/.idea/webResources.xml b/{{cookiecutter.repo_name}}/.idea/webResources.xml new file mode 100644 index 000000000..e0fc860f5 --- /dev/null +++ b/{{cookiecutter.repo_name}}/.idea/webResources.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/{{cookiecutter.repo_name}}/.idea/{{cookiecutter.repo_name}}.iml b/{{cookiecutter.repo_name}}/.idea/{{cookiecutter.repo_name}}.iml new file mode 100644 index 000000000..2f2a9192b --- /dev/null +++ b/{{cookiecutter.repo_name}}/.idea/{{cookiecutter.repo_name}}.iml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + +