[Mpuls-commits] r839 - in wasko/branches/2.0: . waskaweb/model
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Jan 25 17:07:55 CET 2010
Author: bh
Date: 2010-01-25 17:07:52 +0100 (Mon, 25 Jan 2010)
New Revision: 839
Modified:
wasko/branches/2.0/ChangeLog
wasko/branches/2.0/waskaweb/model/case.py
Log:
* waskaweb/model/case.py (_createDependencies)
(_createTablesForImport, _fetchKundennummerFromPDF, _caseExists):
Removed. Unused.
Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog 2010-01-25 15:55:12 UTC (rev 838)
+++ wasko/branches/2.0/ChangeLog 2010-01-25 16:07:52 UTC (rev 839)
@@ -1,5 +1,11 @@
2010-01-25 Bernhard Herzog <bh at intevation.de>
+ * waskaweb/model/case.py (_createDependencies)
+ (_createTablesForImport, _fetchKundennummerFromPDF, _caseExists):
+ Removed. Unused.
+
+2010-01-25 Bernhard Herzog <bh at intevation.de>
+
* waskaweb/controllers/case.py (CaseController.printAll):
get_rendered_page always returns unicode so don't convert the its
returnvalue to unicode again
Modified: wasko/branches/2.0/waskaweb/model/case.py
===================================================================
--- wasko/branches/2.0/waskaweb/model/case.py 2010-01-25 15:55:12 UTC (rev 838)
+++ wasko/branches/2.0/waskaweb/model/case.py 2010-01-25 16:07:52 UTC (rev 839)
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright 2007, 2008 Intevation GmbH, Germany, <info at intevation.de>
+# Copyright 2007, 2008, 2010 Intevation GmbH, Germany, <info at intevation.de>
#
# This file is part of mpuls WASKA (CoMPUter-based case fiLeS -
# Web-Anwendungs-Server fuer Kompetenzagenturen).
@@ -469,8 +469,6 @@
conn.commit()
finally:
db.recycleConnection(conn, cur)
- # XXX: This a workaround the RGs
- # self._createDependencies(id, uuid)
except:
print "Fehler"
traceback.print_exc(file=sys.stderr)
@@ -549,129 +547,7 @@
db.recycleConnection(conn, cur)
print "4"
- def _createDependencies(self, id, uuid=None):
- con, cur = None, None
- try:
- con = db.getConnection()
- # create one Kompetenzfestellung
- cur = con.cursor()
- cur.execute(CREATE_RG_KOMPETENZ_DS, { 'id': id, 'uuid': uuid})
- komp_id = cur.fetchone()[0]
- cur.close()
- cur = None
- # TODO: Uncomment the following as soon as the SP exist.
- # create three Maßnahmen per master data set
- #for i in range(3):
- # cur = con.cursor()
- # cur.execute(CREATE_RG_MASSNAHME_DS, { 'id': komp_id })
- # cur.close(); cur = None
-
- # create three Beherrschungsprache per Kompetenzfestellung
- #for i in range(3):
- # cur = con.cursor()
- # cur.execute(CREATE_RG_SPRACHE_DS, { 'id': komp_id })
- # cur.close(); cur = None
-
- # TODO: Uncomment the following as soon as the SP exist.
- # create three Maßnahmen per master data set
- #for i in range(3):
- # cur = con.cursor()
- # cur.execute(CREATE_RG_MASSNAHME_DS, { 'id': komp_id })
- # cur.close(); cur = None
-
- con.commit()
- finally:
- db.recycleConnection(con, cur)
-
- def _createTablesForImport(self, relations, uuid=None):
- masterId, kompetenzId = None, None
-
- con, cur = None, None
- createdTables = {}
- try:
- con = db.getConnection()
- # a master dataset has to be created each time
- cur = con.cursor()
-
- # TODO: It seems that the following lines of code are doing already
- # implemented functionality. Think about cleaning up here but i do
- # not fully understand what is happening exctly here. Maybe the
- # next two outcommented lines could do the trick.
- #case = self.creatNew()
- #masterId = case.id
-
- cur.execute(CREATE_CASE_SQL, {'uuid': uuid})
- masterId = cur.fetchone()[0]
- cur.close()
- cur = None
- createdTables['master_tbl'] = masterId
-
- # kompetenz rg has to be created each time
- cur = con.cursor()
- cur.execute(CREATE_RG_KOMPETENZ_DS,
- {'id': masterId, 'uuid': uuid})
- rid = cur.fetchone()[0]
- cur.close()
- cur = None
- con.commit()
-
- createdTables['rg_kompetenzfestellung_tbl'] = rid
-
- for name, rels, separate in relations:
- id = None
- if not separate:
- id = createdTables.get(name)
-
- if id is None:
- try:
- stmnt = CREATE_SQL[name]
- except KeyError:
- print >> sys.stderr, ("Kann Statement zur Erzeugung"
- " von '%s' nicht finden." % name)
- continue
- cur = con.cursor()
- cur.execute(stmnt, {'id': masterId, 'uuid': uuid})
- id = cur.fetchone()[0]
- cur.close()
- cur = None
-
- # write the relations
- for rel in rels:
- rel.sqlUpdate(con, id)
-
- if not separate:
- createdTables[name] = id
- finally:
- db.recycleConnection(con, cur)
-
- return masterId
-
- def _fetchKundennummerFromPDF(self, tbls):
- for n, rels, sep in tbls:
- for rel in rels:
- try:
- return rel.getColumn(u"kundennummer")
- except KeyError:
- pass
-
- return None
-
-
- def _caseExists(self, knummer):
- con, cur = None, None
- try:
- con = db.getConnection()
- cur = con.cursor()
- cur.execute(CASE_EXISTS, { 'knummer': knummer })
- row = cur.fetchone()
- if row is None:
- return False
- return row[0]
- finally:
- db.recycleConnection(con, cur)
-
-
class CaseStandin:
"""This class represents the standin for a case"""
More information about the Mpuls-commits
mailing list