[copr] master: Small layout change and add .gitignore and requirements.txt files - Small layout change (more pep8 style) on forms.py - Add a first (small) .gitignore file - Add a requirements.txt file, handy to keep track of the dependencies of the project and while working in virtualenv (d914b0c)
bkabrda at fedoraproject.org
bkabrda at fedoraproject.org
Tue Jan 8 07:47:11 UTC 2013
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit d914b0cde2dbe94d91ab930a54d2118179cefc4a
Author: Pierre-Yves Chibon <pingou at pingoured.fr>
Date: Tue Jan 8 08:00:39 2013 +0100
Small layout change and add .gitignore and requirements.txt files
- Small layout change (more pep8 style) on forms.py
- Add a first (small) .gitignore file
- Add a requirements.txt file, handy to keep track of the dependencies
of the project and while working in virtualenv
>---------------------------------------------------------------
.gitignore | 1 +
coprs_frontend/coprs/forms.py | 6 ++++++
requirements.txt | 7 +++++++
3 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0d20b64
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.pyc
diff --git a/coprs_frontend/coprs/forms.py b/coprs_frontend/coprs/forms.py
index 69e6f69..0010d72 100644
--- a/coprs_frontend/coprs/forms.py
+++ b/coprs_frontend/coprs/forms.py
@@ -33,6 +33,7 @@ class UrlListValidator(object):
return is_url
+
class AllowedArchesValidator(object):
def __init__(self, message = None):
if not message:
@@ -45,6 +46,7 @@ class AllowedArchesValidator(object):
if a not in constants.CHROOTS[form.release.data]:
raise wtf.ValidationError(self.message.format(a))
+
class CoprUniqueNameValidator(object):
def __init__(self, message = None):
if not message:
@@ -69,6 +71,7 @@ class StringListFilter(object):
regex = re.compile(r'\s+')
return regex.sub(lambda x: '\n', result)
+
class CoprForm(wtf.Form):
# also use id here, to be able to find out whether user is updating a copr
# if so, we don't want to shout that name already exists
@@ -94,6 +97,7 @@ class CoprForm(wtf.Form):
def chroots(self):
return ['{0}-{1}'.format(self.release.data, arch) for arch in self.arches.data ]
+
class BuildForm(wtf.Form):
pkgs = wtf.TextAreaField('Pkgs',
validators = [wtf.Required(), UrlListValidator()],
@@ -105,6 +109,7 @@ class BuildForm(wtf.Form):
validators = [wtf.NumberRange(min = constants.MIN_BUILD_TIMEOUT, max = constants.MAX_BUILD_TIMEOUT)],
default = constants.DEFAULT_BUILD_TIMEOUT)
+
class PermissionsApplierFormFactory(object):
@staticmethod
def create_form_cls(permission = None):
@@ -133,6 +138,7 @@ class PermissionsApplierFormFactory(object):
return F
+
class DynamicPermissionsFormFactory(object):
"""Creates a dynamic form for given set of copr permissions"""
@staticmethod
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..3b7b12b
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,7 @@
+# Used for when working from a virtualenv.
+# Use this file by running "$ pip install -r requirements.txt"
+argparse
+flask-sqlalchemy
+flask-openid
+flask-wtf
+alembic
More information about the copr-devel
mailing list