[Mpuls-commits] r751 - in wasko/branches/2.0/waskaweb: lib templates

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Jan 13 12:06:39 CET 2010


Author: torsten
Date: 2010-01-13 12:06:39 +0100 (Wed, 13 Jan 2010)
New Revision: 751

Modified:
   wasko/branches/2.0/waskaweb/lib/config.py
   wasko/branches/2.0/waskaweb/templates/main.mako
Log:
Removed some confgurations options. Changed footer, to read info from
configuration


Modified: wasko/branches/2.0/waskaweb/lib/config.py
===================================================================
--- wasko/branches/2.0/waskaweb/lib/config.py	2010-01-13 10:20:25 UTC (rev 750)
+++ wasko/branches/2.0/waskaweb/lib/config.py	2010-01-13 11:06:39 UTC (rev 751)
@@ -20,7 +20,7 @@
 log = logging.getLogger(__name__)
 
 def get_revision():
-    return "0.8"
+    return "2.0-alpha"
 
 def get_path(dir, file):
     try:
@@ -76,12 +76,9 @@
                 sections[section_key] = section
             section[item_key] = item
 
-        set('common', 'name', 'mpuls - Evaluationserver')
-        set('common', 'shortname', 'evalmpuls')
+        set('common', 'name', 'mpuls')
         set('common', 'version', 'rev. %s' % get_revision())
-        set('common', 'releasedate', '21.09.2009')
-        set('common', 'lang', 'en')
-        set('common', 'agencyname', 'Evaluationserver')
+        set('common', 'releasedate', '13.10.2010')
 
         # Formed
         set('formed', 'treefile', 'formedtree.xml')
@@ -93,154 +90,6 @@
         set('paths', 'addons', '')
         set('paths', 'templates', '')
 
-        set('database', 'url', 'gruenkern.pult.intevation.de')
-        set('database', 'port', '5432')
-        set('database', 'name', 'waskoauswertung')
-        set('database', 'login', 'auswertung')
-        set('database', 'pass', 'wae1Foo1')
-
-        #set('database', 'url', 'localhost')
-        #set('database', 'port', '9999')
-        #set('database', 'name', 'auswertung')
-        #set('database', 'login', 'intevation')
-
-        set('database', 'nameschema', 'ka_%s_db')
-        set('database', 'userschema', 'ka_%s_%s')
-        set('database', 'namefromssl', '0')
-        set('database', 'mappingfile', get_path('mappings', 'waska-fkz-mapping.csv'))
-
-        # AEGENCYDATA
-        # --------
-        # 1. Elementary fields.
-        # Every case consists of various fields. Some of the fields are
-        # elementary fields, which are essential for the workflow and should
-        # not be changed! Changing them would result in further changes in
-        # application logic. In other words the application rely on the fact
-        # that the following fields are present.
-        elementary_list = ['id' 'name', 'count', 'federalstate']
-        set('agency-fields', 'elementary', elementary_list)
-
-        # 2. Individual fields.
-        # Beside the elemtary fields there are some indiviual fields which can
-        # be defined here, and depends on the concrete usecase of mpuls. In
-        # most cases these fields will hold the name, the address and some other
-        # general information on the case.
-        individual_list = []
-        set('agency-fields', 'individual', individual_list)
-        tostr_list = ['fkz', 'count']
-        set('agency-fields', 'tostr', tostr_list)
-
-        # 3. Overview 
-
-        # Search options
-        # Phase
-        p1 = {'Unbekannt': -1}
-        phases = [p1] 
-        set('search', 'phases', phases)
-
-        te1 = {'Keine Angabe': -1}
-        types_ending = [te1] 
-        set('search', 'types_ending', types_ending)
-        set('search', 'default-start-date', datetime.date(2008,9,1))
-        #set('search', 'default-end-date', datetime.date.today())
-        set('search', 'default-end-date', datetime.date(2009,8,31))
-
-        # Define which fields of the case will be available in the overviewpage
-        overview_list = ['id', 'count',  'federalstate', 'name']
-        set('case-fields', 'overview', overview_list)
-
-        agency_bw = ['abc']
-        agency_by = []
-        agency_be = []
-        agency_bb = []
-        agency_hb = []
-        agency_hh = []
-        agency_he = []
-        agency_mv = []
-        agency_ni = []
-        agency_nw = []
-        agency_rp = []
-        agency_sl = []
-        agency_sn = []
-        agency_st = []
-        agency_sh = []
-        agency_th = []
-
-        agency_mapping = {
-            'BW':agency_bw,
-            'BY':agency_by,
-            'BE':agency_be,
-            'BB':agency_bb,
-            'HB':agency_hb,
-            'HH':agency_hh,
-            'HE':agency_he,
-            'MV':agency_mv,
-            'NI':agency_ni,
-            'NW':agency_nw,
-            'RP':agency_rp,
-            'SL':agency_sl,
-            'SN':agency_sn,
-            'ST':agency_st,
-            'SH':agency_sh,
-            'TH':agency_th 
-        }
-        country_mapping = {
-            'BW': 'Baden-Württemberg',
-            'BY': 'Bayern',
-            'BE': 'Berlin',
-            'BB': 'Brandenburg',
-            'HB': 'Bremen',
-            'HH': 'Hamburg',
-            'HE': 'Hessen',
-            'MV': 'Mecklenburg-Vorpommern',
-            'NI': 'Niedersachsen',
-            'NW': 'Nordrhein-Westfalen',
-            'RP': 'Rheinland-Pfalz',
-            'SL': 'Saarland',
-            'SN': 'Sachsen',
-            'ST': 'Sachsen-Anhalt',
-            'SH': 'Schleswig-Holstein',
-            'TH': 'Thüringen'
-            }
-
-        set('agency', 'agency-mapping', agency_mapping)
-        set('agency', 'country-mapping', country_mapping)
-        set('agency', 'name-mappingfile', get_path('mappings', 'waska-fkz-name-mapping.csv'))
-        set('agency', 'fkz-mappingfile', get_path('mappings',  'waska-fkz-mapping.csv'))
-
-
-        # 4. Field Mapping 
-        # Mpuls uses fixed names for common used fields in the application
-        # which may vary from the actual names in the database. This is the
-        # right place to define the mapping between the mpuls-intern names and
-        # the db-names. Please note, that these mapping will also be used for
-        # saving data! This may cause problems.
-
-        # Elementary fields.
-        set('agency-fields-mapping', 'id', 'a.fkz')
-        set('agency-fields-mapping', 'count', 'count(m.id)')
-        set('agency-fields-mapping', 'federalstate', 'b.kurz')
-        set('agency-fields-mapping', 'name', 'a.name')
-        set('agency-fields-mapping', 'typeending', 'm.cm_end_art')
-        set('agency-fields-mapping', 'date_phase0_start', 'm.erstgespraech')
-        set('agency-fields-mapping', 'date_phase0_end', 'coalesce(m.datum_cm_start, now())')
-        set('agency-fields-mapping', 'date_phase1_start', 'm.erstgespraech')
-        set('agency-fields-mapping', 'date_phase1_end', 'coalesce(m.datum_cm_start, now())')
-        set('agency-fields-mapping', 'date_phase2_start', 'm.datum_cm_start')
-        set('agency-fields-mapping', 'date_phase2_end', 'coalesce(m.datum_cm_ende, now())')
-        set('agency-fields-mapping', 'date_phase3_start', 'm.datum_cm_start')
-        set('agency-fields-mapping', 'date_phase3_end', 'coalesce(m.datum_cm_ende, now())')
-        set('agency-fields-mapping', 'date_phase4_start', 'm.nbetr_start')
-        set('agency-fields-mapping', 'date_phase4_end', 'coalesce(m.nbetr_ende, now())')
-        set('agency-fields-mapping', 'date_phase5_start', 'm.nbetr_start')
-        set('agency-fields-mapping', 'date_phase5_end', 'coalesce(m.nbetr_ende, now())')
-        set('agency-fields-mapping', 'date_phase6_start', 'm.nbetr_start')
-        set('agency-fields-mapping', 'date_phase6_end', 'coalesce(m.nbetr_ende, now())')
-        set('agency-fields-mapping', 'date_phase7_start', 'm.nbetr_start')
-        set('agency-fields-mapping', 'date_phase7_end', 'coalesce(m.nbetr_ende, now())')
-
-        # Individual fields 
-
         # PHASES
         # --------
         # Available Phases:
@@ -290,9 +139,6 @@
     def get_app_name(self):
         return self.get('common', 'name')
 
-    def get_app_shortname(self):
-        return self.get('common', 'shortname')
-
     def get_app_version(self):
         return self.get('common', 'version')
 

Modified: wasko/branches/2.0/waskaweb/templates/main.mako
===================================================================
--- wasko/branches/2.0/waskaweb/templates/main.mako	2010-01-13 10:20:25 UTC (rev 750)
+++ wasko/branches/2.0/waskaweb/templates/main.mako	2010-01-13 11:06:39 UTC (rev 751)
@@ -130,7 +130,7 @@
 <%def name="buildFooter()">
 <div id="footer">
   <div id="version_str">
-    ${_('footer_title')} | ${_('footer_version')}
+    ${g.mpuls_config.get_app_name()} | ${g.mpuls_config.get_releasedate()} | ${g.mpuls_config.get_app_version()}
   </div>
 </div>
 </%def>



More information about the Mpuls-commits mailing list