From 103e1739946bd88c7f7591bd3aaa241d6f99969d Mon Sep 17 00:00:00 2001 From: Krzysztof Szumny Date: Wed, 19 Aug 2015 16:11:35 +0200 Subject: [PATCH] almost final changes --- hooks/post_gen_project.py | 14 ++++++++++++++ ...eruser.xml => Docker__createsuperuser.xml} | 8 ++++---- ...ocker__migrate.xml => Docker__migrate.xml} | 6 +++--- ...r__runserver.xml => Docker__runserver.xml} | 6 +++--- ...er_plus.xml => Docker__runserver_plus.xml} | 6 +++--- ...ests___all.xml => Docker__tests___all.xml} | 6 +++--- ...___users.xml => Docker__tests___users.xml} | 10 +++++----- .../.idea/{{cookiecutter.repo_name}}.iml | 2 +- .../compose/pycharm/entrypoint | 7 ++----- .../compose/pycharm/jdk.table.xml | 19 +++++++++++++++++++ {{cookiecutter.repo_name}}/debug.yml | 7 ------- 11 files changed, 57 insertions(+), 34 deletions(-) rename {{cookiecutter.repo_name}}/.idea/runConfigurations/{_edit_to_activate__Docker__createsuperuser.xml => Docker__createsuperuser.xml} (77%) rename {{cookiecutter.repo_name}}/.idea/runConfigurations/{_edit_to_activate__Docker__migrate.xml => Docker__migrate.xml} (81%) rename {{cookiecutter.repo_name}}/.idea/runConfigurations/{_edit_to_activate__Docker__runserver.xml => Docker__runserver.xml} (81%) rename {{cookiecutter.repo_name}}/.idea/runConfigurations/{_edit_to_activate__Docker__runserver_plus.xml => Docker__runserver_plus.xml} (81%) rename {{cookiecutter.repo_name}}/.idea/runConfigurations/{_edit_to_activate__Docker__tests___all.xml => Docker__tests___all.xml} (79%) rename {{cookiecutter.repo_name}}/.idea/runConfigurations/{_edit_to_activate__Docker__tests___users.xml => Docker__tests___users.xml} (72%) create mode 100644 {{cookiecutter.repo_name}}/compose/pycharm/jdk.table.xml diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index f19f2d1d3..2f567092a 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -44,3 +44,17 @@ if not pycharm: shutil.rmtree(os.path.join(project_directory, path)) # ------------------------------------------------------------------------------ + + +import fileinput + +jdk_table_xml = os.path.join(project_directory, 'compose/pycharm/jdk.table.xml') +jdk_table_dst_dir = os.path.join(os.path.expanduser('~'), '.PyCharm40/config/options/') + +for line in fileinput.input(jdk_table_xml, inplace=True): + print line.replace('$PROJECT_DIR$', project_directory), + + +if not os.path.exists(jdk_table_dst_dir): + os.makedirs(jdk_table_dst_dir) + shutil.copy2(jdk_table_xml, jdk_table_dst_dir) diff --git a/{{cookiecutter.repo_name}}/.idea/runConfigurations/_edit_to_activate__Docker__createsuperuser.xml b/{{cookiecutter.repo_name}}/.idea/runConfigurations/Docker__createsuperuser.xml similarity index 77% rename from {{cookiecutter.repo_name}}/.idea/runConfigurations/_edit_to_activate__Docker__createsuperuser.xml rename to {{cookiecutter.repo_name}}/.idea/runConfigurations/Docker__createsuperuser.xml index 944e74ede..d7fbe4045 100644 --- a/{{cookiecutter.repo_name}}/.idea/runConfigurations/_edit_to_activate__Docker__createsuperuser.xml +++ b/{{cookiecutter.repo_name}}/.idea/runConfigurations/Docker__createsuperuser.xml @@ -1,17 +1,17 @@ - +