[Mpuls-commits] r1579 - in wasko/branches/2.0: . waskaweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Feb 15 21:03:02 CET 2010


Author: bh
Date: 2010-02-15 21:02:56 +0100 (Mon, 15 Feb 2010)
New Revision: 1579

Modified:
   wasko/branches/2.0/ChangeLog
   wasko/branches/2.0/waskaweb/lib/validators.py
Log:
* waskaweb/lib/validators.py: Fix formatting.


Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog	2010-02-15 19:08:24 UTC (rev 1578)
+++ wasko/branches/2.0/ChangeLog	2010-02-15 20:02:56 UTC (rev 1579)
@@ -1,5 +1,9 @@
 2010-02-15  Bernhard Herzog  <bh at intevation.de>
 
+	* waskaweb/lib/validators.py: Fix formatting.
+
+2010-02-15  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/lib/validators.py: Remove unused imports
 
 2010-02-15  Bernhard Herzog  <bh at intevation.de>

Modified: wasko/branches/2.0/waskaweb/lib/validators.py
===================================================================
--- wasko/branches/2.0/waskaweb/lib/validators.py	2010-02-15 19:08:24 UTC (rev 1578)
+++ wasko/branches/2.0/waskaweb/lib/validators.py	2010-02-15 20:02:56 UTC (rev 1579)
@@ -1,45 +1,50 @@
 # -*- coding: utf-8 -*-
 # Copyright 2007, 2008 Intevation GmbH, Germany, <info at intevation.de>
-# 
-# This file is part of mpuls WASKA (CoMPUter-based case fiLeS - 
+#
+# This file is part of mpuls WASKA (CoMPUter-based case fiLeS -
 # Web-Anwendungs-Server fuer Kompetenzagenturen).
-# 
+#
 # mpuls WASKA is free software: you can redistribute it and/or modify it under
 # the terms of the GNU Affero General Public License as published by the
 # Free Software Foundation, either version 3 of the License, or (at your
 # option) any later version.
-# 
+#
 # mpuls WASKA is distributed in the hope that it will be useful, but WITHOUT
 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
 # License for more details.
-# 
+#
 # You should have received a copy of the GNU Affero General Public
 # License along with mpuls WASKA. If not, see <http://www.gnu.org/licenses/>.
-# 
-# mpuls WASKA has been developed on behalf of the 
+#
+# mpuls WASKA has been developed on behalf of the
 # Projekttraeger im Deutschen Zentrum fuer Luft- und Raumfahrt e.V. (PT-DLR)
 # within the programme Kompetenzagenturen (Durchfuehrungsphase) funded by
-# the Bundesministerium fuer Familie, Senioren, Frauen und Jugend and 
+# the Bundesministerium fuer Familie, Senioren, Frauen und Jugend and
 # European Social Fund resources.
+
+import re
+import datetime
+import time
 import locale
+
+import formencode
+
 from pylons import session, g
 from pylons.i18n import _
+
 from mpulsweb.lib.db import db
-import re
-import formencode
-import datetime
-import time
-
 from mpulsweb.lib.validators import BaseFormValidator, NewPasswordForm, \
-ValidatorStateObject, EditUserGroupForm, NewUserGroupForm, EditSettingsForm, \
-NewUserForm, EditUserForm, DateCheck, TimeCheck, CreateAppointmentForm, \
-StringTooLong
+     ValidatorStateObject, EditUserGroupForm, NewUserGroupForm, \
+     EditSettingsForm, NewUserForm, EditUserForm, DateCheck, TimeCheck, \
+     CreateAppointmentForm, StringTooLong
 
+
 class MyDateConverter(formencode.validators.FancyValidator):
 
     messages = {
-        'wrong_format': _('Date is invalid')}
+        'wrong_format': _('Date is invalid')
+        }
 
     def _to_python(self, value, state):
         value.strip()
@@ -47,21 +52,24 @@
             try:
                 d = time.strptime(value, locale.nl_langinfo(locale.D_FMT))
             except:
-                d = time.strptime(value, locale.nl_langinfo(locale.D_FMT).lower())
+                d = time.strptime(value,
+                                  locale.nl_langinfo(locale.D_FMT).lower())
             return datetime.date(d[0], d[1], d[2])
         except:
-            raise formencode.Invalid(self.message("wrong_format", state), value, state)
+            raise formencode.Invalid(self.message("wrong_format", state),
+                                     value, state)
 
+
 class CasePartSelectionForm(BaseFormValidator):
-    documents    = formencode.validators.Int(if_missing=0)
+
+    documents = formencode.validators.Int(if_missing=0)
     appointments = formencode.validators.Int(if_missing=1)
-    logbook      = formencode.validators.Int(if_missing=0)
+    logbook = formencode.validators.Int(if_missing=0)
 
+
 for i in xrange(1, 33):
-    setattr(
-        CasePartSelectionForm, 
-        'form_section_%02d' % i,
-        formencode.validators.Int(if_missing=0))
+    setattr(CasePartSelectionForm, 'form_section_%02d' % i,
+            formencode.validators.Int(if_missing=0))
 
 #    form_section_0 = formencode.validators.Int(if_missing=0)
 #    form_section_1 = formencode.validators.Int(if_missing=0)
@@ -82,59 +90,83 @@
 #    form_section_16 = formencode.validators.Int(if_missing=0)
 #    form_section_17 = formencode.validators.Int(if_missing=0)
 
+
 class NewCaseForm(BaseFormValidator):
-    name               = formencode.validators.String()
-    vorname            = formencode.validators.String()
-    addresse_strasse   = formencode.validators.String()
+
+    name = formencode.validators.String()
+    vorname = formencode.validators.String()
+    addresse_strasse = formencode.validators.String()
     addresse_strassenr = formencode.validators.String()
-    addresse_ort       = formencode.validators.String()
-    statement_signed   = formencode.validators.Bool(if_missing=False)
-    aufnahme_typ       = formencode.validators.Int(if_missing=0)
+    addresse_ort = formencode.validators.String()
+    statement_signed = formencode.validators.Bool(if_missing=False)
+    aufnahme_typ = formencode.validators.Int(if_missing=0)
 
+
 class SearchCaseForm(BaseFormValidator):
-    gender   = formencode.validators.Int(if_missing='-2')
+
+    gender = formencode.validators.Int(if_missing='-2')
     cm_state = formencode.validators.Int(if_missing=None)
 
+
 class SearchAgencyForm(SearchCaseForm):
+
     pass
 
+
 class BundleActionForm(BaseFormValidator):
-    filter_extra_fields = True 
-    all_cases  = formencode.validators.Int(if_missing=0)
-    action  = formencode.validators.String(not_empty=True)
+
+    filter_extra_fields = True
+
+    all_cases = formencode.validators.Int(if_missing=0)
+    action = formencode.validators.String(not_empty=True)
     case_id = formencode.ForEach(formencode.validators.Int())
 
+
 class AgencyBundleActionForm(BaseFormValidator):
-    filter_extra_fields = True 
-    all_cases  = formencode.validators.Int(if_missing=0)
-    action  = formencode.validators.String(not_empty=True)
+
+    filter_extra_fields = True
+
+    all_cases = formencode.validators.Int(if_missing=0)
+    action = formencode.validators.String(not_empty=True)
     agency_id = formencode.ForEach(formencode.validators.String())
 
+
 class DeleteUserHelperForm(BaseFormValidator):
-    filter_extra_fields = True 
-    editor  = formencode.validators.Int()
+
+    filter_extra_fields = True
+
+    editor = formencode.validators.Int()
     user_id = formencode.validators.Int()
     case_id = formencode.ForEach(formencode.validators.Int())
 
 
 class SetEditorForm(BaseFormValidator):
+
     pass
 
+
 class SetBundleEditorForm(BaseFormValidator):
+
     pass
 
+
 class SetBundleStandinForm(BaseFormValidator):
+
     pass
 
+
 class SetStandinForm(BaseFormValidator):
-    filter_extra_fields = True 
+
+    filter_extra_fields = True
+
     case_id = formencode.validators.Int()
     standin = formencode.ForEach(formencode.validators.Int())
 
+
 class KeineAngabe(formencode.validators.FancyValidator):
 
     messages = {
-        'invalid':   u'"Keine Angabe" ist keine gültige Angabe.'
+        'invalid': u'"Keine Angabe" ist keine gültige Angabe.'
         }
 
     def _to_python(self, value, state):
@@ -142,93 +174,130 @@
 
     def validate_python(self, value, state):
         if value == '-1':
-            raise formencode.Invalid(self.message("invalid", state), value, state)
+            raise formencode.Invalid(self.message("invalid", state),
+                                     value, state)
 
+
 class CreateLogbookForm(BaseFormValidator):
-    date         = DateCheck(not_empty=True)
-    time         = TimeCheck(not_empty=True)
-    duration     = formencode.validators.Int()
+
+    date = DateCheck(not_empty=True)
+    time = TimeCheck(not_empty=True)
+    duration = formencode.validators.Int()
     short_notice = StringTooLong()
 
+
 class EditLogbookForm(CreateLogbookForm):
+
     pass
 
+
 class SetPhaseForm(BaseFormValidator):
+
     pass
 
+
 class EvaluationFormValidator(BaseFormValidator):
-    id                  = formencode.validators.String(if_missing='0')
-    agencyid            = formencode.validators.String(if_missing=g.mpuls_config.get('common', 'agencyname'))
-    start_date          = MyDateConverter(not_empty=True, if_missing='')
-    end_date            = MyDateConverter(not_empty=True, if_missing='')
-    start_date_field    = formencode.validators.String(if_missing=g.mpuls_config.get('evaloptions', 'default-start-date-field'))
-    end_date_field      = formencode.validators.String(if_missing=g.mpuls_config.get('evaloptions', 'default-end-date-field'))
-    typelist            = formencode.ForEach(formencode.validators.String(), convert_to_list=True)
-    type_ending         = formencode.ForEach(formencode.validators.String(), convert_to_list=True)
-    phase               = formencode.ForEach(formencode.validators.String(), convert_to_list=True)
-    show_percent        = formencode.validators.Bool(if_missing=False)
 
+    id = formencode.validators.String(if_missing='0')
+    agencyid = formencode.validators.String(if_missing=g.mpuls_config.get('common', 'agencyname'))
+    start_date = MyDateConverter(not_empty=True, if_missing='')
+    end_date = MyDateConverter(not_empty=True, if_missing='')
+    start_date_field = formencode.validators.String(if_missing=g.mpuls_config.get('evaloptions', 'default-start-date-field'))
+    end_date_field = formencode.validators.String(if_missing=g.mpuls_config.get('evaloptions', 'default-end-date-field'))
+    typelist = formencode.ForEach(formencode.validators.String(),
+                                  convert_to_list=True)
+    type_ending = formencode.ForEach(formencode.validators.String(),
+                                     convert_to_list=True)
+    phase = formencode.ForEach(formencode.validators.String(),
+                               convert_to_list=True)
+    show_percent = formencode.validators.Bool(if_missing=False)
+
+
 class ExtraTimeFormValidator1(BaseFormValidator):
-    allow_extra_fields         = True
-    filter_extra_fields        = True 
-    cm_datum_verlaengerung_1   = DateCheck(not_empty=True)
+
+    allow_extra_fields = True
+    filter_extra_fields = True
+
+    cm_datum_verlaengerung_1 = DateCheck(not_empty=True)
     cm_bestaet_verlaengerung_1 = formencode.validators.String(if_missing='')
-    cm_anmerk_verlaengerung_1  = formencode.validators.String()
+    cm_anmerk_verlaengerung_1 = formencode.validators.String()
 
+
 class ExtraTimeFormValidator2(BaseFormValidator):
-    allow_extra_fields         = True
-    filter_extra_fields        = True 
-    cm_datum_verlaengerung_2   = DateCheck(not_empty=True)
+
+    allow_extra_fields = True
+    filter_extra_fields = True
+
+    cm_datum_verlaengerung_2 = DateCheck(not_empty=True)
     cm_bestaet_verlaengerung_2 = formencode.validators.String(if_missing='')
-    cm_anmerk_verlaengerung_2  = formencode.validators.String()
+    cm_anmerk_verlaengerung_2 = formencode.validators.String()
 
+
 class RenewFormValidator(BaseFormValidator):
-    allow_extra_fields          = True
-    filter_extra_fields         = True 
-    cm_neuauf_genehm            = formencode.validators.String()
-    anmerkungen                 = formencode.validators.String()
 
+    allow_extra_fields = True
+    filter_extra_fields = True
+
+    cm_neuauf_genehm = formencode.validators.String()
+    anmerkungen = formencode.validators.String()
+
+
 class ReopenFormValidator1(BaseFormValidator):
-    allow_extra_fields          = True
-    filter_extra_fields         = True 
-    cm_wiederauf_genehm_1       = formencode.validators.String()
+
+    allow_extra_fields = True
+    filter_extra_fields = True
+
+    cm_wiederauf_genehm_1 = formencode.validators.String()
     cm_wiederauf_genehm_datum_1 = DateCheck(not_empty=True)
-    cm_wiederauf_datum_bis_1    = DateCheck(not_empty=True)
-    anmerkungen                 = formencode.validators.String(not_empty=True)
+    cm_wiederauf_datum_bis_1 = DateCheck(not_empty=True)
+    anmerkungen = formencode.validators.String(not_empty=True)
 
+
 class ReopenFormValidator1abgel(BaseFormValidator):
-    allow_extra_fields          = True
-    filter_extra_fields         = True 
-    cm_wiederauf_genehm_1       = formencode.validators.String()
+
+    allow_extra_fields = True
+    filter_extra_fields = True
+
+    cm_wiederauf_genehm_1 = formencode.validators.String()
     cm_wiederauf_genehm_datum_1 = formencode.validators.String()
-    cm_wiederauf_datum_bis_1    = formencode.validators.String()
-    anmerkungen                 = formencode.validators.String()
+    cm_wiederauf_datum_bis_1 = formencode.validators.String()
+    anmerkungen = formencode.validators.String()
 
+
 class ReopenFormValidator2(BaseFormValidator):
-    allow_extra_fields          = True
-    filter_extra_fields         = True 
-    cm_wiederauf_genehm_2       = formencode.validators.String()
-    cm_wiederauf_datum_bis_2    = DateCheck(not_empty=True)
-    anmerkungen                 = formencode.validators.String(not_empty=True)
 
+    allow_extra_fields = True
+    filter_extra_fields = True
+
+    cm_wiederauf_genehm_2 = formencode.validators.String()
+    cm_wiederauf_datum_bis_2 = DateCheck(not_empty=True)
+    anmerkungen = formencode.validators.String(not_empty=True)
+
+
 class ReopenFormValidator2abgel(BaseFormValidator):
-    allow_extra_fields          = True
-    filter_extra_fields         = True 
-    cm_wiederauf_genehm_2       = formencode.validators.String()
-    cm_wiederauf_datum_bis_2    = formencode.validators.String()
-    anmerkungen                 = formencode.validators.String()
 
+    allow_extra_fields = True
+    filter_extra_fields = True
+
+    cm_wiederauf_genehm_2 = formencode.validators.String()
+    cm_wiederauf_datum_bis_2 = formencode.validators.String()
+    anmerkungen = formencode.validators.String()
+
+
 class WiederaufnahmeCaseForm(BaseFormValidator):
-    cm_dok_datum_beendigung     = DateCheck(not_empty=True)
-    cm_dok_end_verm             = formencode.validators.String()
+
+    cm_dok_datum_beendigung = DateCheck(not_empty=True)
+    cm_dok_end_verm = formencode.validators.String()
     cm_wiederauf_genehm_datum_1 = DateCheck(not_empty=True)
-    cm_wiederauf_datum_bis_1    = DateCheck(not_empty=True)
-    cm2c_t                      = formencode.validators.String(not_empty=True)
-    cm_dok_end_verm             = KeineAngabe()
+    cm_wiederauf_datum_bis_1 = DateCheck(not_empty=True)
+    cm2c_t = formencode.validators.String(not_empty=True)
+    cm_dok_end_verm = KeineAngabe()
 
+
 class NeuaufnahmeCaseForm(BaseFormValidator):
-    cm_dok_datum_beendigung     = DateCheck(not_empty=True)
-    cm_dok_end_sonst            = KeineAngabe()
-    cm2c_t                      = formencode.validators.String()
 
+    cm_dok_datum_beendigung = DateCheck(not_empty=True)
+    cm_dok_end_sonst = KeineAngabe()
+    cm2c_t = formencode.validators.String()
+
 # vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8



More information about the Mpuls-commits mailing list