blob: 335389e8b0cdd506a99d17e7e3e121358deae8a1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
diff -Naur hamster-applet-2.24.0.orig/configure.ac hamster-applet-2.24.0/configure.ac
--- hamster-applet-2.24.0.orig/configure.ac 2008-09-22 22:20:03.000000000 +0530
+++ hamster-applet-2.24.0/configure.ac 2008-09-26 15:46:37.000000000 +0530
@@ -100,20 +100,38 @@
AC_MSG_RESULT($PYGTK_DEFSDIR)
-AC_MSG_CHECKING([for pysqlite2 module])
-if AC_RUN_LOG([DISPLAY= $PYTHON -c '
+if test "x$PYTHON_VERSION" = "x2.5"; then
+ AC_MSG_CHECKING([for python sqlite module])
+ if AC_RUN_LOG([DISPLAY= $PYTHON -c '
+try:
+ import sqlite3
+except ImportError, e:
+ if str(e).find("sqlite3") >= 0:
+ raise
+except:
+ pass
+ ']); then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Python 2.5: inbuilt sqlite is required to build hamster])
+ fi
+else
+ AC_MSG_CHECKING([for pysqlite2 module])
+ if AC_RUN_LOG([DISPLAY= $PYTHON -c '
try:
import pysqlite2
except ImportError, e:
if str(e).find("pysqlite2") >= 0:
- raise
+ raise
except:
pass
-']); then
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
- AC_MSG_ERROR([pysqlite2 Python module required to build hamster])
+ ']); then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Python 2.4: pysqlite2 module required to build hamster])
+ fi
fi
diff -Naur hamster-applet-2.24.0.orig/hamster/db.py hamster-applet-2.24.0/hamster/db.py
--- hamster-applet-2.24.0.orig/hamster/db.py 2008-09-22 22:20:02.000000000 +0530
+++ hamster-applet-2.24.0/hamster/db.py 2008-09-26 16:05:58.000000000 +0530
@@ -21,7 +21,14 @@
"""separate file for database operations"""
-from pysqlite2 import dbapi2 as sqlite
+try:
+ import sqlite3 as sqlite
+except ImportError:
+ try:
+ from pysqlite2 import dbapi2 as sqlite
+ except ImportError:
+ print "Error: Neither sqlite3 nor pysqlite2 found"
+ raise
import os, time
import datetime
import hamster
|