Roundup Tracker - Issues

Message2807

Author fresh
Recipients
Date 2006-06-24.10:01:42
Message-id
In-reply-to
Logged In: YES 
user_id=24723

I didn't find as many patches were needed:

Index: lib/python/roundup/backends/back_postgresql.py
===================================================================
--- lib/python/roundup/backends/back_postgresql.py     
(revision 1989)
+++ lib/python/roundup/backends/back_postgresql.py     
(working copy)
@@ -9,7 +9,8 @@
 __docformat__ = 'restructuredtext'
 
 import os, shutil, popen2, time
-import psycopg
+import psycopg2
+from psycopg2.extensions import QuotedString
 
 from roundup import hyperdb, date
 from roundup.backends import rdbms_common
@@ -39,8 +40,8 @@
     template1['database'] = 'template1'
     
     try:
-        conn = psycopg.connect(**template1)
-    except psycopg.OperationalError, message:
+        conn = psycopg2.connect(**template1)
+    except psycopg2.OperationalError, message:
         raise hyperdb.DatabaseError, message
     
     conn.set_isolation_level(0)
@@ -59,7 +60,7 @@
     '''
     try:
         cursor.execute(command)
-    except psycopg.ProgrammingError, err:
+    except psycopg2.ProgrammingError, err:
         response = str(err).split('\n')[0]
         if response.find('FATAL') != -1:
             raise RuntimeError, response
@@ -76,7 +77,7 @@
     """Check if database already exists"""
     db = getattr(config, 'POSTGRESQL_DATABASE')
     try:
-        conn = psycopg.connect(**db)
+        conn = psycopg2.connect(**db)
         conn.close()
         if __debug__:
             print >> hyperdb.DEBUG, '+++ database exists +++'
@@ -95,8 +96,8 @@
     def sql_open_connection(self):
         db = getattr(self.config, 'POSTGRESQL_DATABASE')
         try:
-            conn = psycopg.connect(**db)
-        except psycopg.OperationalError, message:
+            conn = psycopg2.connect(**db)
+        except psycopg2.OperationalError, message:
             raise hyperdb.DatabaseError, message
 
         cursor = conn.cursor()
@@ -180,7 +181,7 @@
     def sql_stringquote(self, value):
         ''' psycopg.QuotedString returns a "buffer" object
with the
             single-quotes around it... '''
-        return str(psycopg.QuotedString(str(value)))[1:-1]
+        return str(QuotedString(str(value)))[1:-1]
 
     def sql_index_exists(self, table_name, index_name):
         sql = 'select count(*) from pg_indexes where ' \
History
Date User Action Args
2009-02-03 14:23:07adminlinkissue1429391 messages
2009-02-03 14:23:07admincreate