Commit 2926f2eb authored by Og B. Maciel's avatar Og B. Maciel

Import sqlite3 if using python 2.5, or pysqlite2 if using python 2.4. Fixes Bug #555136

svn path=/trunk/; revision=675
parent 97196f66
2008-10-23 Og Maciel <ogmaciel@gnome.org>
* src/gui/aboutdialog.py: Use gnomevfs for url_show method.
* src/daemon/main.py, src/lib/dal.py, configure.ac: Don't try to import
pysqlite2 in python 2.5. Patch by John Millikin (Fixes Bug: #555136).
2008-10-17 Og Maciel <ogmaciel@gnome.org>
* src/lib/dbus_actions.py: Don't try to cast a dbus.String into an int type, if catId is 'None'.
......
......@@ -32,7 +32,43 @@ AC_SUBST(DBUS_SERVICES_DIR)
AC_SUBST(VERSION)
AM_CHECK_PYMOD([gobject], , , AC_MSG_ERROR([Python module gobject required to run BillReminder]))
AM_CHECK_PYMOD_VERSION([pysqlite2.dbapi2], [version], [2.3.0], , AC_MSG_ERROR([Python module pysqlite2 >= 2.3.0 required to run BillReminder]))
dnl This entire python check section borrowed from the hamster-applet project.
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 BillReminder])
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
except:
pass
']); then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([Python 2.4: pysqlite2 module required to build BillReminder])
fi
fi
AM_CHECK_PYMOD([dbus], , , AC_MSG_ERROR([Python module dbus required to run BillReminder]))
AC_PATH_PROG(GCONFTOOL, gconftool-2)
......
......@@ -16,11 +16,6 @@ try:
except ImportError:
print 'Required package: dbus-python'
raise SystemExit
try:
import pysqlite2
except ImportError:
print 'Required package: pysqlite2'
raise SystemExit
from lib import common
from lib import i18n
......@@ -67,34 +62,6 @@ class Daemon(object):
""" Make the program run like a daemon """
def __init__(self, options):
""" Detach process and run it as a daemon """
"""
if not options.app_nodaemon:
# Fork first child
try:
pid = os.fork()
except OSError, err:
print >> sys.stderr, \
('Unexpected error:', sys.exc_info()[0], err)
if pid == 0:
os.setsid()
# Fork second child
try:
pid = os.fork()
except OSError, err:
print >> sys.stderr, \
('Unexpected error:', sys.exc_info()[0], err)
if pid == 0:
os.umask(0)
else:
raise SystemExit
else:
raise SystemExit
# Redirect STDIN, STDOUT and STDERR
sys.stdin.close()
"""
if options.app_verbose:
sys.stdout.write('\n')
sys.stdout = VerboseDevice(type_='stdout')
......
......@@ -12,8 +12,8 @@ import lib.common as common
from lib import i18n
try:
import gnome
def open_url(url): gnome.url_show(url)
import gnomevfs
def open_url(url): gnomevfs.url_show(url)
except:
import os
def open_url(url): os.system("xdg-open %s" % url)
......
......@@ -6,8 +6,11 @@ import os
import sys
try:
from pysqlite2 import dbapi2 as sqlite
import sqlite3 as sqlite
except ImportError:
try:
from pysqlite2 import dbapi2 as sqlite
except ImportError:
print "Please install pysqlite2"
sys.exit(1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment