mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-08-04 04:10:09 +03:00
Merge 693dedf4da
into 8746b0c6b7
This commit is contained in:
commit
b59d751091
|
@ -3,15 +3,15 @@
|
||||||
# Copyright (C) 2002 Tom Jenkins <tjenkins@devis.com>
|
# Copyright (C) 2002 Tom Jenkins <tjenkins@devis.com>
|
||||||
# Copyright (C) 2005 Federico Di Gregorio <fog@initd.org>
|
# Copyright (C) 2005 Federico Di Gregorio <fog@initd.org>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# psycopg2 is free software: you can redistribute it and/or modify it
|
||||||
# it under the terms of the GNU General Public License as published by the
|
# under the terms of the GNU Lesser General Public License as published
|
||||||
# Free Software Foundation; either version 2, or (at your option) any later
|
# by the Free Software Foundation, either version 3 of the License, or
|
||||||
# version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but
|
# psycopg2 is distributed in the hope that it will be useful, but WITHOUT
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||||
# for more details.
|
# License for more details.
|
||||||
|
|
||||||
## put in DSN your DSN string
|
## put in DSN your DSN string
|
||||||
|
|
||||||
|
|
|
@ -3,15 +3,15 @@
|
||||||
# Copyright (C) 2002 Tom Jenkins <tjenkins@devis.com>
|
# Copyright (C) 2002 Tom Jenkins <tjenkins@devis.com>
|
||||||
# Copyright (C) 2005 Federico Di Gregorio <fog@initd.org>
|
# Copyright (C) 2005 Federico Di Gregorio <fog@initd.org>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# psycopg2 is free software: you can redistribute it and/or modify it
|
||||||
# it under the terms of the GNU General Public License as published by the
|
# under the terms of the GNU Lesser General Public License as published
|
||||||
# Free Software Foundation; either version 2, or (at your option) any later
|
# by the Free Software Foundation, either version 3 of the License, or
|
||||||
# version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but
|
# psycopg2 is distributed in the hope that it will be useful, but WITHOUT
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||||
# for more details.
|
# License for more details.
|
||||||
|
|
||||||
## put in DSN your DSN string
|
## put in DSN your DSN string
|
||||||
|
|
||||||
|
|
|
@ -2,15 +2,15 @@
|
||||||
#
|
#
|
||||||
# Copyright (C) 2001-2006 Federico Di Gregorio <fog@debian.org>
|
# Copyright (C) 2001-2006 Federico Di Gregorio <fog@debian.org>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# psycopg2 is free software: you can redistribute it and/or modify it
|
||||||
# it under the terms of the GNU General Public License as published by the
|
# under the terms of the GNU Lesser General Public License as published
|
||||||
# Free Software Foundation; either version 2, or (at your option) any later
|
# by the Free Software Foundation, either version 3 of the License, or
|
||||||
# version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but
|
# psycopg2 is distributed in the hope that it will be useful, but WITHOUT
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||||
# for more details.
|
# License for more details.
|
||||||
|
|
||||||
## put in DSN your DSN string
|
## put in DSN your DSN string
|
||||||
|
|
||||||
|
|
|
@ -1,70 +0,0 @@
|
||||||
# =======================================================================
|
|
||||||
# $Source: /sources/gnumed/gnumed/gnumed/client/testing/test-psycopg2-datetime-systematic.py,v $
|
|
||||||
__version__ = "$Revision: 1.1 $"
|
|
||||||
__author__ = "K.Hilbert <Karsten.Hilbert@gmx.net>"
|
|
||||||
__license__ = 'GPL (details at http://www.gnu.org)'
|
|
||||||
# =======================================================================
|
|
||||||
|
|
||||||
print "testing psycopg2 date/time parsing"
|
|
||||||
|
|
||||||
import psycopg2
|
|
||||||
print "psycopg2:", psycopg2.__version__
|
|
||||||
|
|
||||||
#dsn = u'dbname=gnumed_v10 user=any-doc password=any-doc'
|
|
||||||
dsn = u'dbname=test'
|
|
||||||
print dsn
|
|
||||||
|
|
||||||
conn = psycopg2.connect(dsn=dsn)
|
|
||||||
|
|
||||||
curs = conn.cursor()
|
|
||||||
cmd = u"""
|
|
||||||
select
|
|
||||||
name,
|
|
||||||
abbrev,
|
|
||||||
utc_offset::text,
|
|
||||||
case when
|
|
||||||
is_dst then 'DST'
|
|
||||||
else 'non-DST'
|
|
||||||
end
|
|
||||||
from pg_timezone_names"""
|
|
||||||
curs.execute(cmd)
|
|
||||||
rows = curs.fetchall()
|
|
||||||
curs.close()
|
|
||||||
conn.rollback()
|
|
||||||
|
|
||||||
for row in rows:
|
|
||||||
|
|
||||||
curs = conn.cursor()
|
|
||||||
|
|
||||||
tz = row[0]
|
|
||||||
cmd = u"set timezone to '%s'" % tz
|
|
||||||
try:
|
|
||||||
curs.execute(cmd)
|
|
||||||
except StandardError, e:
|
|
||||||
print "cannot use time zone", row
|
|
||||||
raise e
|
|
||||||
curs.close()
|
|
||||||
conn.rollback()
|
|
||||||
continue
|
|
||||||
|
|
||||||
cmd = u"""select '1920-01-19 23:00:00+01'::timestamp with time zone"""
|
|
||||||
try:
|
|
||||||
curs.execute(cmd)
|
|
||||||
curs.fetchone()
|
|
||||||
except StandardError, e:
|
|
||||||
print "%s (%s / %s / %s) failed:" % (tz, row[1], row[2], row[3])
|
|
||||||
print " ", e
|
|
||||||
|
|
||||||
curs.close()
|
|
||||||
conn.rollback()
|
|
||||||
|
|
||||||
conn.close()
|
|
||||||
|
|
||||||
# =======================================================================
|
|
||||||
# $Log: test-psycopg2-datetime-systematic.py,v $
|
|
||||||
# Revision 1.1 2009/02/10 18:45:32 ncq
|
|
||||||
# - psycopg2 cannot parse a bunch of settable time zones
|
|
||||||
#
|
|
||||||
# Revision 1.1 2009/02/10 13:57:03 ncq
|
|
||||||
# - test for psycopg2 on Ubuntu-Intrepid
|
|
||||||
#
|
|
|
@ -4,20 +4,16 @@
|
||||||
#
|
#
|
||||||
# This file is part of the psycopg module.
|
# This file is part of the psycopg module.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# psycopg2 is free software: you can redistribute it and/or modify it
|
||||||
# modify it under the terms of the GNU General Public License
|
# under the terms of the GNU Lesser General Public License as published
|
||||||
# as published by the Free Software Foundation; either version 2,
|
# by the Free Software Foundation, either version 3 of the License, or
|
||||||
# or (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# psycopg2 is distributed in the hope that it will be useful, but WITHOUT
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||||
# GNU General Public License for more details.
|
# License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
|
|
||||||
# this a little script that analyze a file with (TYPE, NUMBER) tuples
|
# this a little script that analyze a file with (TYPE, NUMBER) tuples
|
||||||
# and write out C code ready for inclusion in psycopg. the generated
|
# and write out C code ready for inclusion in psycopg. the generated
|
||||||
# code defines the DBAPITypeObject fundamental types and warns for
|
# code defines the DBAPITypeObject fundamental types and warns for
|
||||||
|
|
|
@ -6,15 +6,15 @@ The script can be run at a new PostgreSQL release to refresh the module.
|
||||||
|
|
||||||
# Copyright (C) 2010 Daniele Varrazzo <daniele.varrazzo@gmail.com>
|
# Copyright (C) 2010 Daniele Varrazzo <daniele.varrazzo@gmail.com>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# psycopg2 is free software: you can redistribute it and/or modify it
|
||||||
# it under the terms of the GNU General Public License as published by the
|
# under the terms of the GNU Lesser General Public License as published
|
||||||
# Free Software Foundation; either version 2, or (at your option) any later
|
# by the Free Software Foundation, either version 3 of the License, or
|
||||||
# version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but
|
# psycopg2 is distributed in the hope that it will be useful, but WITHOUT
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||||
# for more details.
|
# License for more details.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import urllib2
|
import urllib2
|
||||||
|
|
|
@ -8,19 +8,15 @@ script exits with error 1.
|
||||||
|
|
||||||
# Copyright (C) 2011 Daniele Varrazzo <daniele.varrazzo@gmail.com>
|
# Copyright (C) 2011 Daniele Varrazzo <daniele.varrazzo@gmail.com>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# psycopg2 is free software: you can redistribute it and/or modify it
|
||||||
# it under the terms of the GNU General Public License as published by
|
# under the terms of the GNU Lesser General Public License as published
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# by the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# psycopg2 is distributed in the hope that it will be useful, but WITHOUT
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||||
# GNU General Public License for more details.
|
# License for more details.
|
||||||
#
|
|
||||||
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
import gc
|
import gc
|
||||||
import sys
|
import sys
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -568,7 +568,7 @@ setup(name="psycopg2",
|
||||||
author_email="fog@initd.org",
|
author_email="fog@initd.org",
|
||||||
url="http://initd.org/psycopg/",
|
url="http://initd.org/psycopg/",
|
||||||
download_url=download_url,
|
download_url=download_url,
|
||||||
license="GPL with exceptions or ZPL",
|
license="LGPL with exceptions or ZPL",
|
||||||
platforms=["any"],
|
platforms=["any"],
|
||||||
description=__doc__.split("\n")[0],
|
description=__doc__.split("\n")[0],
|
||||||
long_description="\n".join(__doc__.split("\n")[2:]),
|
long_description="\n".join(__doc__.split("\n")[2:]),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user