[Mpuls-commits] r1824 - wasko/branches/2.0/mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Feb 26 08:21:28 CET 2010


Author: torsten
Date: 2010-02-26 08:21:27 +0100 (Fri, 26 Feb 2010)
New Revision: 1824

Modified:
   wasko/branches/2.0/mpulsweb/lib/anonymize.py
Log:
* mpulsweb/lib/anonymize.py: Deleted functions which has been moved
  into mpulsbase model.case


Modified: wasko/branches/2.0/mpulsweb/lib/anonymize.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/anonymize.py	2010-02-26 07:17:54 UTC (rev 1823)
+++ wasko/branches/2.0/mpulsweb/lib/anonymize.py	2010-02-26 07:21:27 UTC (rev 1824)
@@ -5,67 +5,6 @@
 
 log = logging.getLogger(__name__)
 
-class AnonymizeCheckException(Exception):
-    def __init__(self, value):
-        self.value = value
-
-def check_state(case):
-    pass
-    #raise AnonymizeCheckException('Anonymisierung ist derzeit noch nicht implementiert')
-
-    # The following lines document which test where made in WASKO to check if a
-    # case can be anonymized.
-
-    #    if ((not case.getState().phasesAreConsistent()
-    #         or not case.getState().phasesAreCompleted()
-    #         or not case.getState().getPhase() in (CM_ENDE, NB_ENDE))
-    #        and case.isYoungerThan(INCONSISTENCY_CHECK_AFTER)):
-    #        c.failed_for = MARKANONYMIZE_INCOMPLETE_PHASE_FAILED
-    #        if case.getState().getPhase() in (CLEAR_START, CLEAR_ENDE):
-    #            c.failed_text = \
-    #                        MARKANONYMIZE_CLEARING_PHASE_FAILED_TEXT
-    #        else:
-    #            c.failed_text = \
-    #                        MARKANONYMIZE_INCOMPLETE_PHASE_FAILED_TEXT
-    #        c.url_ok = "/case/digest/%s" % id
-    #        return render('/casemanagement/dialogs/failed_anonymize.mako')
-
-def anonymize(case):
-    '''Fill all missing fields with "unknown" before mark for anonymization.
-
-       case: Case object
-    '''
-    # The follwing lines document which step are done in WASKO to complete a
-    # case.
-
-    #required_fields = RequiredFields(g.formedTree)
-    ## Special code to set "unbekannt" for missing fields.
-    #end_phase = _determineAnonymizedCaseEndPhase(case)
-    #fields = {}
-    #missing = required_fields.missingFields(phase_symbol(end_phase))
-    #for field in missing:
-    #    fieldname = field.getName()
-    #    if isinstance(field, DateLeaf):
-    #        fields[fieldname] = '01.01.0001'
-    #    elif isinstance(field, IntLeaf):
-    #        fields[fieldname] = '-9999999'
-    #    elif isinstance(field, TextLeaf):
-    #        fields[fieldname] = 'unbekannt'
-    #    elif isinstance(field, RadioNode) or isinstance(field, ChoiceNode):
-    #        if fieldname in ('hilfm_1','hilfm_2','hilfm_3'):
-    #            if g.formedTree.getData(fieldname, case.getId()) == -1:
-    #                fields[fieldname] = '0'
-    #        elif fieldname == 'cm_end_art':
-    #            # Due to a bug in rules/missing fields this is added to
-    #            # the list
-    #            pass
-    #        else:
-    #            fields[fieldname] = '-3'
-    ## Store
-    #g.formedTree.setData(fields, case.getId())
-    ## Set the phase
-    #case.getState().setPhase(end_phase)
-
 def determineAnonymizedCaseEndPhase(case):
     '''Determine the phase to be set for the anonymized case'''
     current_phase = case.getState().getPhase()



More information about the Mpuls-commits mailing list