From 945884b97396f58f03f224ca71dd465baadad5db Mon Sep 17 00:00:00 2001 From: Johannes Gehrs Date: Mon, 24 Jun 2013 23:28:32 +0200 Subject: [PATCH] changed structure to package --- .gitignore | 3 ++- .gitmodules | 3 --- Procfile | 1 + run.py | 4 ++++ sample/static/scripts/parsleyjs | 1 - wtformsparsleyjs/.gitmodules | 0 LICENSE => wtformsparsleyjs/LICENSE | 0 wtformsparsleyjs/__init__.py | 1 + wtforms_parsleyjs.py => wtformsparsleyjs/core.py | 0 wtformsparsleyjs/samples/__init__.py | 1 + {sample => wtformsparsleyjs/samples}/sample.py | 10 ++++------ .../samples}/templates/_formhelpers.html | 2 +- .../samples}/templates/base.html | 5 +++-- .../samples}/templates/wtforms_parsley_sample.html | 0 14 files changed, 17 insertions(+), 14 deletions(-) delete mode 100644 .gitmodules create mode 100644 Procfile create mode 100644 run.py delete mode 160000 sample/static/scripts/parsleyjs create mode 100644 wtformsparsleyjs/.gitmodules rename LICENSE => wtformsparsleyjs/LICENSE (100%) create mode 100644 wtformsparsleyjs/__init__.py rename wtforms_parsleyjs.py => wtformsparsleyjs/core.py (100%) create mode 100644 wtformsparsleyjs/samples/__init__.py rename {sample => wtformsparsleyjs/samples}/sample.py (94%) rename {sample => wtformsparsleyjs/samples}/templates/_formhelpers.html (94%) rename {sample => wtformsparsleyjs/samples}/templates/base.html (95%) rename {sample => wtformsparsleyjs/samples}/templates/wtforms_parsley_sample.html (100%) diff --git a/.gitignore b/.gitignore index 18789ed..9874c6e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ dist *.egg-info _mailinglist .tox -.idea \ No newline at end of file +.idea +build \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 0b7ee1f..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "sample/static/scripts/parsleyjs"] - path = sample/static/scripts/parsleyjs - url = https://github.com/guillaumepotier/Parsley.js.git diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..80a980e --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: gunicorn run:app \ No newline at end of file diff --git a/run.py b/run.py new file mode 100644 index 0000000..c7cdba3 --- /dev/null +++ b/run.py @@ -0,0 +1,4 @@ +from wtformsparsleyjs.samples.sample import app + +if __name__ == '__main__': + app.run(debug=True) \ No newline at end of file diff --git a/sample/static/scripts/parsleyjs b/sample/static/scripts/parsleyjs deleted file mode 160000 index 4dfaaab..0000000 --- a/sample/static/scripts/parsleyjs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4dfaaabfd0cfebabba51b1280457b5ecfe764286 diff --git a/wtformsparsleyjs/.gitmodules b/wtformsparsleyjs/.gitmodules new file mode 100644 index 0000000..e69de29 diff --git a/LICENSE b/wtformsparsleyjs/LICENSE similarity index 100% rename from LICENSE rename to wtformsparsleyjs/LICENSE diff --git a/wtformsparsleyjs/__init__.py b/wtformsparsleyjs/__init__.py new file mode 100644 index 0000000..74dca93 --- /dev/null +++ b/wtformsparsleyjs/__init__.py @@ -0,0 +1 @@ +__author__ = 'johannes' diff --git a/wtforms_parsleyjs.py b/wtformsparsleyjs/core.py similarity index 100% rename from wtforms_parsleyjs.py rename to wtformsparsleyjs/core.py diff --git a/wtformsparsleyjs/samples/__init__.py b/wtformsparsleyjs/samples/__init__.py new file mode 100644 index 0000000..74dca93 --- /dev/null +++ b/wtformsparsleyjs/samples/__init__.py @@ -0,0 +1 @@ +__author__ = 'johannes' diff --git a/sample/sample.py b/wtformsparsleyjs/samples/sample.py similarity index 94% rename from sample/sample.py rename to wtformsparsleyjs/samples/sample.py index 71950d5..15cb6e5 100644 --- a/sample/sample.py +++ b/wtformsparsleyjs/samples/sample.py @@ -1,6 +1,8 @@ +__author__ = 'Johannes Gehrs (jgehrs@gmail.com)' + from flask import Flask, render_template, redirect, url_for, request, flash from wtforms import Form, validators -from wtforms_parsleyjs import IntegerField, BooleanField, SelectField, TextField +from wtformsparsleyjs.core import IntegerField, BooleanField, SelectField, TextField app = Flask(__name__) @@ -55,8 +57,4 @@ class ParsleyTestForm(Form): anyof = TextField('Car, Bike or Plane?', [ validators.AnyOf(message='Sorry, you can only choose from car, bike and plane', values=['car', 'bike', 'plane']) - ], default='car') - - -if __name__ == '__main__': - app.run(debug=True) \ No newline at end of file + ], default='car') \ No newline at end of file diff --git a/sample/templates/_formhelpers.html b/wtformsparsleyjs/samples/templates/_formhelpers.html similarity index 94% rename from sample/templates/_formhelpers.html rename to wtformsparsleyjs/samples/templates/_formhelpers.html index 3ca13bc..4f46d40 100644 --- a/sample/templates/_formhelpers.html +++ b/wtformsparsleyjs/samples/templates/_formhelpers.html @@ -11,7 +11,7 @@ {% macro render_errors(field) %} {% if field.errors %} -