[Mpuls-commits] r1559 - wasko/branches/2.0/waskaweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Feb 15 15:16:58 CET 2010


Author: torsten
Date: 2010-02-15 15:16:58 +0100 (Mon, 15 Feb 2010)
New Revision: 1559

Removed:
   wasko/branches/2.0/waskaweb/lib/sql_helper.py
Log:
Deleted. Not imported from anywhere now.


Deleted: wasko/branches/2.0/waskaweb/lib/sql_helper.py
===================================================================
--- wasko/branches/2.0/waskaweb/lib/sql_helper.py	2010-02-15 14:14:03 UTC (rev 1558)
+++ wasko/branches/2.0/waskaweb/lib/sql_helper.py	2010-02-15 14:16:58 UTC (rev 1559)
@@ -1,71 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# Copyright 2007, 2008 Intevation GmbH, Germany, <info at intevation.de>
-# 
-# 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 
-# 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 
-# European Social Fund resources.
-#
-# Authors:
-# Sascha L. Teichmann <teichmann at intevation.de>
-#
-
-from types import TupleType
-
-def range_compress(ids):
-    out = []
-    begin, last = None, None
-    for x in ids:
-        if begin is None:
-            begin, last = x, x
-        else:
-            if x != last + 1:
-                if last == begin: out.append(last)
-                else:             out.append((begin, last))
-                begin = x
-            last = x
-
-    if not begin is None:
-        if begin == last: out.append(last)
-        else:             out.append((begin, last))
-
-    return out
-
-def where_ids(compressed, idname="id"):
-    if not compressed:
-        return "FALSE"
-    between = "%s BETWEEN %%d AND %%d" % idname
-    single  = "%s = %%d" % idname
-    return " OR ".join([(type(x) is TupleType and between or single) % x 
-        for x in compressed])
-
-def main():
-    import sys
-    ids = [int(x) for x in sys.argv[1:]]
-    compressed = range_compress(ids)
-    print compressed
-    print where_ids(compressed)
-
-if __name__ == '__main__':
-    main()
-    
-
-# vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:



More information about the Mpuls-commits mailing list