-#!/usr/bin/python
+#!/usr/bin/python3
###############################################################################
# #
# ddns - A dynamic DNS client for IPFire #
# so that we do not do it unnecessarily.
self._db = None
- def __del__(self):
- self._close_database()
-
def _open_database(self, path):
logger.debug("Opening database %s" % path)
# In that case the database file will be created in _open_database().
return os.access(os.path.dirname(self.path), os.W_OK)
- def _close_database(self):
- if self._db:
- self._db_close()
- self._db = None
-
def _execute(self, query, *parameters):
if self._db is None:
self._db = self._open_database(self.path)
"""
Returns the timestamp of the last update (with the given status code).
"""
+ if self._db is None:
+ self._db = self._open_database(self.path)
+
c = self._db.cursor()
try:
"""
Returns the update status of the last update.
"""
+ if self._db is None:
+ self._db = self._open_database(self.path)
+
c = self._db.cursor()
try:
"""
Returns the reason string for the last failed update (if any).
"""
+ if self._db is None:
+ self._db = self._open_database(self.path)
+
c = self._db.cursor()
try: