diff --git a/bin/python-petstore.sh b/bin/python-petstore.sh index eb34415fe92..c31ccdbd06d 100755 --- a/bin/python-petstore.sh +++ b/bin/python-petstore.sh @@ -3,4 +3,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*" export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -scala $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS -cp $CLASSPATH "$@" samples/petstore/python/PythonPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/resources.json special-key +scala $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS -cp $CLASSPATH "$@" samples/client/petstore/python/PythonPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/resources.json special-key diff --git a/samples/client/petstore/python/PythonPetstoreCodegen.scala b/samples/client/petstore/python/PythonPetstoreCodegen.scala new file mode 100644 index 00000000000..f5d14174bf0 --- /dev/null +++ b/samples/client/petstore/python/PythonPetstoreCodegen.scala @@ -0,0 +1,16 @@ +import com.wordnik.swagger.codegen.BasicPythonGenerator + +import com.wordnik.swagger.core._ + +import java.io.File + +object PythonPetstoreCodegen extends BasicPythonGenerator { + def main(args: Array[String]) = generateClient(args) + + override def destinationDir = "samples/petstore/python" + + override def supportingFiles = List( + ("__init__.mustache", destinationDir, "__init__.py"), + ("swagger.mustache", destinationDir + File.separator + apiPackage.get, "swagger.py"), + ("__init__.mustache", destinationDir + File.separator + modelPackage.get, "__init__.py")) +}