summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain <syt@logilab.fr>2008-01-22 15:49:24 +0100
committerSylvain <syt@logilab.fr>2008-01-22 15:49:24 +0100
commit7310c56f9c834088c8af6cfbef4588da26de6599 (patch)
treeee09774f32f7f86cb24b9377ec65026768d685cf
parenta62ff72dfae07ad1cf54bd7dda0bd1af570ca7e0 (diff)
downloadlogilab-common-7310c56f9c834088c8af6cfbef4588da26de6599.tar.gz
cleanup
-rw-r--r--adbh.py8
-rw-r--r--configuration.py3
-rw-r--r--db.py1
-rw-r--r--sqlgen.py13
-rw-r--r--textutils.py2
5 files changed, 13 insertions, 14 deletions
diff --git a/adbh.py b/adbh.py
index 1502756..f18ba8b 100644
--- a/adbh.py
+++ b/adbh.py
@@ -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
diff --git a/db.py b/db.py
index d44fc1c..0c21d1a 100644
--- a/db.py
+++ b/db.py
@@ -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)
diff --git a/sqlgen.py b/sqlgen.py
index 88e5e65..1484511 100644
--- a/sqlgen.py
+++ b/sqlgen.py
@@ -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=''):