From 5d19ef6146ff926cd4fe94078ceb5bbfd771fa46 Mon Sep 17 00:00:00 2001 From: geekerzp Date: Fri, 12 Jun 2015 18:22:24 +0800 Subject: [PATCH] Generate the python into `python/` folder directly --- .../codegen/languages/PythonClientCodegen.java | 7 +++---- .../python/{swagger_client_python => }/Makefile | 0 .../python/{swagger_client_python => }/README.md | 0 .../dev-requirements.txt | 0 .../python/{swagger_client_python => }/pom.xml | 0 .../python/{swagger_client_python => }/setup.cfg | 0 .../python/{swagger_client_python => }/setup.py | 0 .../swagger_client/__init__.py | 0 .../swagger_client/api_client.py | 0 .../swagger_client/apis/__init__.py | 0 .../swagger_client/apis/pet_api.py | 0 .../swagger_client/apis/store_api.py | 0 .../swagger_client/apis/user_api.py | 0 .../swagger_client/configuration.py | 0 .../swagger_client/models/__init__.py | 0 .../swagger_client/models/category.py | 0 .../swagger_client/models/order.py | 0 .../swagger_client/models/pet.py | 0 .../swagger_client/models/tag.py | 0 .../swagger_client/models/user.py | 0 .../swagger_client/rest.py | 0 .../{swagger_client_python => }/testfiles/foo.png | Bin .../{swagger_client_python => }/tests/__init__.py | 0 .../tests/test_api_client.py | 0 .../tests/test_api_exception.py | 0 .../tests/test_pet_api.py | 0 .../python/{swagger_client_python => }/tox.ini | 0 27 files changed, 3 insertions(+), 4 deletions(-) rename samples/client/petstore/python/{swagger_client_python => }/Makefile (100%) rename samples/client/petstore/python/{swagger_client_python => }/README.md (100%) rename samples/client/petstore/python/{swagger_client_python => }/dev-requirements.txt (100%) rename samples/client/petstore/python/{swagger_client_python => }/pom.xml (100%) rename samples/client/petstore/python/{swagger_client_python => }/setup.cfg (100%) rename samples/client/petstore/python/{swagger_client_python => }/setup.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/swagger_client/__init__.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/swagger_client/api_client.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/swagger_client/apis/__init__.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/swagger_client/apis/pet_api.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/swagger_client/apis/store_api.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/swagger_client/apis/user_api.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/swagger_client/configuration.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/swagger_client/models/__init__.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/swagger_client/models/category.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/swagger_client/models/order.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/swagger_client/models/pet.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/swagger_client/models/tag.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/swagger_client/models/user.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/swagger_client/rest.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/testfiles/foo.png (100%) rename samples/client/petstore/python/{swagger_client_python => }/tests/__init__.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/tests/test_api_client.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/tests/test_api_exception.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/tests/test_pet_api.py (100%) rename samples/client/petstore/python/{swagger_client_python => }/tox.ini (100%) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java index e5a3b0810b2..030e19c1a31 100755 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java @@ -82,14 +82,13 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig additionalProperties.put("packageName", packageName); additionalProperties.put("packageVersion", packageVersion); - String baseFolder = packageName + "_python"; - String swaggerFoler = baseFolder + File.separatorChar + packageName; + String swaggerFoler = packageName; modelPackage = swaggerFoler + File.separatorChar + "models"; apiPackage = swaggerFoler + File.separatorChar + "apis"; - supportingFiles.add(new SupportingFile("README.mustache", baseFolder, "README.md")); - supportingFiles.add(new SupportingFile("setup.mustache", baseFolder, "setup.py")); + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + supportingFiles.add(new SupportingFile("setup.mustache", "", "setup.py")); supportingFiles.add(new SupportingFile("api_client.mustache", swaggerFoler, "api_client.py")); supportingFiles.add(new SupportingFile("rest.mustache", swaggerFoler, "rest.py")); supportingFiles.add(new SupportingFile("configuration.mustache", swaggerFoler, "configuration.py")); diff --git a/samples/client/petstore/python/swagger_client_python/Makefile b/samples/client/petstore/python/Makefile similarity index 100% rename from samples/client/petstore/python/swagger_client_python/Makefile rename to samples/client/petstore/python/Makefile diff --git a/samples/client/petstore/python/swagger_client_python/README.md b/samples/client/petstore/python/README.md similarity index 100% rename from samples/client/petstore/python/swagger_client_python/README.md rename to samples/client/petstore/python/README.md diff --git a/samples/client/petstore/python/swagger_client_python/dev-requirements.txt b/samples/client/petstore/python/dev-requirements.txt similarity index 100% rename from samples/client/petstore/python/swagger_client_python/dev-requirements.txt rename to samples/client/petstore/python/dev-requirements.txt diff --git a/samples/client/petstore/python/swagger_client_python/pom.xml b/samples/client/petstore/python/pom.xml similarity index 100% rename from samples/client/petstore/python/swagger_client_python/pom.xml rename to samples/client/petstore/python/pom.xml diff --git a/samples/client/petstore/python/swagger_client_python/setup.cfg b/samples/client/petstore/python/setup.cfg similarity index 100% rename from samples/client/petstore/python/swagger_client_python/setup.cfg rename to samples/client/petstore/python/setup.cfg diff --git a/samples/client/petstore/python/swagger_client_python/setup.py b/samples/client/petstore/python/setup.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/setup.py rename to samples/client/petstore/python/setup.py diff --git a/samples/client/petstore/python/swagger_client_python/swagger_client/__init__.py b/samples/client/petstore/python/swagger_client/__init__.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/swagger_client/__init__.py rename to samples/client/petstore/python/swagger_client/__init__.py diff --git a/samples/client/petstore/python/swagger_client_python/swagger_client/api_client.py b/samples/client/petstore/python/swagger_client/api_client.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/swagger_client/api_client.py rename to samples/client/petstore/python/swagger_client/api_client.py diff --git a/samples/client/petstore/python/swagger_client_python/swagger_client/apis/__init__.py b/samples/client/petstore/python/swagger_client/apis/__init__.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/swagger_client/apis/__init__.py rename to samples/client/petstore/python/swagger_client/apis/__init__.py diff --git a/samples/client/petstore/python/swagger_client_python/swagger_client/apis/pet_api.py b/samples/client/petstore/python/swagger_client/apis/pet_api.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/swagger_client/apis/pet_api.py rename to samples/client/petstore/python/swagger_client/apis/pet_api.py diff --git a/samples/client/petstore/python/swagger_client_python/swagger_client/apis/store_api.py b/samples/client/petstore/python/swagger_client/apis/store_api.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/swagger_client/apis/store_api.py rename to samples/client/petstore/python/swagger_client/apis/store_api.py diff --git a/samples/client/petstore/python/swagger_client_python/swagger_client/apis/user_api.py b/samples/client/petstore/python/swagger_client/apis/user_api.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/swagger_client/apis/user_api.py rename to samples/client/petstore/python/swagger_client/apis/user_api.py diff --git a/samples/client/petstore/python/swagger_client_python/swagger_client/configuration.py b/samples/client/petstore/python/swagger_client/configuration.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/swagger_client/configuration.py rename to samples/client/petstore/python/swagger_client/configuration.py diff --git a/samples/client/petstore/python/swagger_client_python/swagger_client/models/__init__.py b/samples/client/petstore/python/swagger_client/models/__init__.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/swagger_client/models/__init__.py rename to samples/client/petstore/python/swagger_client/models/__init__.py diff --git a/samples/client/petstore/python/swagger_client_python/swagger_client/models/category.py b/samples/client/petstore/python/swagger_client/models/category.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/swagger_client/models/category.py rename to samples/client/petstore/python/swagger_client/models/category.py diff --git a/samples/client/petstore/python/swagger_client_python/swagger_client/models/order.py b/samples/client/petstore/python/swagger_client/models/order.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/swagger_client/models/order.py rename to samples/client/petstore/python/swagger_client/models/order.py diff --git a/samples/client/petstore/python/swagger_client_python/swagger_client/models/pet.py b/samples/client/petstore/python/swagger_client/models/pet.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/swagger_client/models/pet.py rename to samples/client/petstore/python/swagger_client/models/pet.py diff --git a/samples/client/petstore/python/swagger_client_python/swagger_client/models/tag.py b/samples/client/petstore/python/swagger_client/models/tag.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/swagger_client/models/tag.py rename to samples/client/petstore/python/swagger_client/models/tag.py diff --git a/samples/client/petstore/python/swagger_client_python/swagger_client/models/user.py b/samples/client/petstore/python/swagger_client/models/user.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/swagger_client/models/user.py rename to samples/client/petstore/python/swagger_client/models/user.py diff --git a/samples/client/petstore/python/swagger_client_python/swagger_client/rest.py b/samples/client/petstore/python/swagger_client/rest.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/swagger_client/rest.py rename to samples/client/petstore/python/swagger_client/rest.py diff --git a/samples/client/petstore/python/swagger_client_python/testfiles/foo.png b/samples/client/petstore/python/testfiles/foo.png similarity index 100% rename from samples/client/petstore/python/swagger_client_python/testfiles/foo.png rename to samples/client/petstore/python/testfiles/foo.png diff --git a/samples/client/petstore/python/swagger_client_python/tests/__init__.py b/samples/client/petstore/python/tests/__init__.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/tests/__init__.py rename to samples/client/petstore/python/tests/__init__.py diff --git a/samples/client/petstore/python/swagger_client_python/tests/test_api_client.py b/samples/client/petstore/python/tests/test_api_client.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/tests/test_api_client.py rename to samples/client/petstore/python/tests/test_api_client.py diff --git a/samples/client/petstore/python/swagger_client_python/tests/test_api_exception.py b/samples/client/petstore/python/tests/test_api_exception.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/tests/test_api_exception.py rename to samples/client/petstore/python/tests/test_api_exception.py diff --git a/samples/client/petstore/python/swagger_client_python/tests/test_pet_api.py b/samples/client/petstore/python/tests/test_pet_api.py similarity index 100% rename from samples/client/petstore/python/swagger_client_python/tests/test_pet_api.py rename to samples/client/petstore/python/tests/test_pet_api.py diff --git a/samples/client/petstore/python/swagger_client_python/tox.ini b/samples/client/petstore/python/tox.ini similarity index 100% rename from samples/client/petstore/python/swagger_client_python/tox.ini rename to samples/client/petstore/python/tox.ini