Changeset 753 for trunk


Ignore:
Timestamp:
Jul 1, 2013, 4:29:38 PM (6 years ago)
Author:
Nick Burch
Message:

Start to switch to psycopg2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/scripts/generic-python-import/generic_importer.py

    r752 r753  
    2929#  to work.
    3030
    31 from pyPgSQL import PgSQL
    3231from geo_helper import turn_wgs84_into_osgb36, turn_osgb36_into_eastingnorthing, \
    3332                                                turn_wgs84_into_osie36, turn_osie36_into_eastingnorthing
     33import psycopg2
    3434import os
    3535import sys
     
    9393                if dbtype == "pgsql" or dbtype == "postgres" or dbtype == "postgresql":
    9494                        if len(dbhost):
    95                                 dbh = PgSQL.connect(database=dbname, host=dbhost, user=dbuser, password=dbpass)
     95                                dbh = psycopg2.connect(database=dbname, host=dbhost, user=dbuser, password=dbpass)
    9696                        else:
    97                                 dbh = PgSQL.connect(database=dbname, user=dbuser, password=dbpass)
     97                                dbh = psycopg2.connect(database=dbname, user=dbuser, password=dbpass)
    9898                else:
    9999                        raise Exception("Unknown dbtype %s" % dbtype)
Note: See TracChangeset for help on using the changeset viewer.