[gnome-lirc-properties] Fix warnings with newer Pythons



commit f9af722c09232494828549d07ebe110509a49693
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Sep 10 16:55:34 2009 +0100

    Fix warnings with newer Pythons
    
    Use hashlib, and rework the Python parsing exception to work
    without warnings in Python 2.6. Require Python 2.5 for hashlib.

 configure.ac                          |    2 +-
 gnome_lirc_properties/lirc.py         |   15 ++++++++++++---
 gnome_lirc_properties/net/services.py |    2 +-
 3 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index dd43ddf..52e0387 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,7 +10,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
 dnl check for programs ===
 
 AM_PROG_CC_C_O
-AM_PATH_PYTHON(2.4)
+AM_PATH_PYTHON(2.5)
 IT_PROG_INTLTOOL([0.35.0])
 
 dnl localization support ===
diff --git a/gnome_lirc_properties/lirc.py b/gnome_lirc_properties/lirc.py
index 45cced2..d7d0ca2 100644
--- a/gnome_lirc_properties/lirc.py
+++ b/gnome_lirc_properties/lirc.py
@@ -32,10 +32,19 @@ class ParseError(Exception):
     '''
     Execption describing a parse error.
     '''
+    @apply
 
-    def __init__(self, filename, lineno, message = _('Malformed configuration file')):
-        message = '%s:%d: %s' % (filename, lineno, message)
-        super(ParseError, self).__init__(message)
+    def message():
+        def get(self):
+            return self._message
+
+        def set(self, value):
+            self._message = value
+
+        return property(get, set)
+
+    def __init__(self, filename, lineno, msg = _('Malformed configuration file')):
+        self.message = '%s:%d: %s' % (filename, lineno, msg)
 
 class Receiver(object):
     '''
diff --git a/gnome_lirc_properties/net/services.py b/gnome_lirc_properties/net/services.py
index bebdce7..f076695 100644
--- a/gnome_lirc_properties/net/services.py
+++ b/gnome_lirc_properties/net/services.py
@@ -20,7 +20,7 @@ Download and update services.
 '''
 
 import gobject, httplib, locale, logging
-import md5, os, re, rfc822, sha, time, urllib2
+import hashlib, os, re, rfc822, time, urllib2
 
 from gettext   import gettext as _
 from StringIO  import StringIO



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]