diff options
author | Sylvain <syt@logilab.fr> | 2008-01-22 15:49:24 +0100 |
---|---|---|
committer | Sylvain <syt@logilab.fr> | 2008-01-22 15:49:24 +0100 |
commit | 7310c56f9c834088c8af6cfbef4588da26de6599 (patch) | |
tree | ee09774f32f7f86cb24b9377ec65026768d685cf | |
parent | a62ff72dfae07ad1cf54bd7dda0bd1af570ca7e0 (diff) | |
download | logilab-common-7310c56f9c834088c8af6cfbef4588da26de6599.tar.gz |
cleanup
-rw-r--r-- | adbh.py | 8 | ||||
-rw-r--r-- | configuration.py | 3 | ||||
-rw-r--r-- | db.py | 1 | ||||
-rw-r--r-- | sqlgen.py | 13 | ||||
-rw-r--r-- | textutils.py | 2 |
5 files changed, 13 insertions, 14 deletions
@@ -1,6 +1,3 @@ -# Copyright (c) 2002-2007 LOGILAB S.A. (Paris, FRANCE). -# http://www.logilab.fr/ -- mailto:contact@logilab.fr -# # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later @@ -17,7 +14,12 @@ functionalities Helpers are provided for postgresql, mysql and sqlite. + +:author: Logilab +:copyright: 2003-2008 LOGILAB S.A. (Paris, FRANCE) +:contact: http://www.logilab.fr/ -- mailto:python-projects@logilab.org """ +__docformat__ = "restructuredtext en" from logilab.common.deprecation import obsolete diff --git a/configuration.py b/configuration.py index ecaf4d6..b555529 100644 --- a/configuration.py +++ b/configuration.py @@ -1,6 +1,3 @@ -# Copyright (c) 2003-2008 LOGILAB S.A. (Paris, FRANCE). -# http://www.logilab.fr/ -- mailto:contact@logilab.fr -# # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later @@ -347,6 +347,7 @@ class _PySqlite2Adapter(DBAPIAdapter): def adapt_mxdatetimedelta(mxd): return mxd.strftime('%H:%M:%S') sqlite.register_adapter(DateTimeDeltaType, adapt_mxdatetimedelta) + def convert_mxdate(ustr): return strptime(ustr, '%Y-%m-%d %H:%M:%S') sqlite.register_converter('date', convert_mxdate) @@ -10,14 +10,13 @@ # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -""" Copyright (c) 2002-2003 LOGILAB S.A. (Paris, FRANCE). - http://www.logilab.fr/ -- mailto:contact@logilab.fr +"""Help to generate SQL string usable by the Python DB-API - -Help to generate SQL string usable by the Python DB-API +:author: Logilab +:copyright: 2003-2008 LOGILAB S.A. (Paris, FRANCE) +:contact: http://www.logilab.fr/ -- mailto:python-projects@logilab.org """ - -__revision__ = "$Id: sqlgen.py,v 1.11 2005-11-22 13:13:02 syt Exp $" +__docformat__ = "restructuredtext en" # SQLGenerator ################################################################ @@ -135,7 +134,7 @@ class SQLGenerator : params : dictionnary that will be used as in cursor.execute(sql,params) >>> s = SQLGenerator() - >>> s.update('test',{'id':'001','nom':'dupont'},['id']) + >>> s.update('test', {'id':'001','nom':'dupont'}, ['id']) 'UPDATE test SET nom = %(nom)s WHERE id = %(id)s' >>> s.update('test',{'id':'001','nom':'dupont','prenom':'jean'},['id']) 'UPDATE test SET nom = %(nom)s, prenom = %(prenom)s WHERE id = %(id)s' diff --git a/textutils.py b/textutils.py index 88167a8..7114f68 100644 --- a/textutils.py +++ b/textutils.py @@ -131,7 +131,7 @@ def normalize_text(text, line_len=80, indent='', rest=False): result = [] for text in _BLANKLINES_RGX.split(text): result.append(normp(text, line_len, indent)) - return ('%s%s' % (linesep, linesep)).join(result) + return ('%s%s%s' % (linesep, indent, linesep)).join(result) def normalize_paragraph(text, line_len=80, indent=''): |