]> git.openstreetmap.org Git - osqa.git/blobdiff - forum_modules/pgfulltext/management.py
initial import
[osqa.git] / forum_modules / pgfulltext / management.py
old mode 100755 (executable)
new mode 100644 (file)
index 89eb139..487580f
@@ -1,29 +1,29 @@
-import os\r
-\r
-from django.db import connection, transaction\r
-from django.conf import settings\r
-\r
-import forum.models\r
-\r
-if settings.DATABASE_ENGINE in ('postgresql_psycopg2', 'postgresql', ):\r
-    from django.db.models.signals import post_syncdb\r
-\r
-    def setup_pgfulltext(sender, **kwargs):\r
-        if sender == forum.models:\r
-           install_pg_fts()\r
-\r
-    post_syncdb.connect(setup_pgfulltext)\r
-\r
-def install_pg_fts():\r
-    f = open(os.path.join(os.path.dirname(__file__), 'pg_fts_install.sql'), 'r')\r
-    \r
-    try:\r
-        cursor = connection.cursor()\r
-        cursor.execute(f.read())\r
-        transaction.commit_unless_managed()\r
-    except:\r
-        pass\r
-    finally:\r
-        cursor.close()\r
-\r
-    f.close()\r
+import os
+
+from django.db import connection, transaction
+from django.conf import settings
+
+import forum.models
+
+if settings.DATABASE_ENGINE in ('postgresql_psycopg2', 'postgresql', ):
+    from django.db.models.signals import post_syncdb
+
+    def setup_pgfulltext(sender, **kwargs):
+        if sender == forum.models:
+           install_pg_fts()
+
+    post_syncdb.connect(setup_pgfulltext)
+
+def install_pg_fts():
+    f = open(os.path.join(os.path.dirname(__file__), 'pg_fts_install.sql'), 'r')
+    
+    try:
+        cursor = connection.cursor()
+        cursor.execute(f.read())
+        transaction.commit_unless_managed()
+    except:
+        pass
+    finally:
+        cursor.close()
+
+    f.close()