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

Freeze exception for cfget 0.17-1



Hello,

I've uploaded yesterday cfget 0.17-1 to unstable. Testing has 0.16-1.

This is the changelog:

  * New upstream version
     - Fixed a DeprecationWarning with python 2.6
     - Allow empty values, treating them as unsets
     - Round function returns an int, not a float

Although it is a new upstream version, the change from 0.16 is rather
minimal and it is mostly bugfixing. I am the maintainer as well as
upstream, so when I fix minor problems like a DeprecationWarning it
makes sense for me to do a new upstream release rather than a new debian
release with a patch.

The changelog has no "Closes:" entries because the bugs were found by a
customer, reported to me directly and fixed right away.

There are no packages that depend on cfget.

Debdiff:

diff -Nru cfget-0.16/cfget cfget-0.17/cfget
--- cfget-0.16/cfget	2010-07-16 10:51:29.000000000 +0200
+++ cfget-0.17/cfget	2010-08-26 17:23:11.000000000 +0200
@@ -9,7 +9,7 @@
 import cPickle as pickle
 import __builtin__
 
-VERSION="0.16"
+VERSION="0.17"
 
 # Functions to report different levels of feedback. They will be redefined
 # according to command line options
@@ -50,7 +50,7 @@
     "Normal .ini file format"
     RE_EMPTY = re.compile(r"^\s*(?:[#;].+)?$")
     RE_SECTION = re.compile(r"^\s*\[([^\]]+)\]\s*$")
-    RE_VALUE = re.compile(r"^\s*([^=]+)=(.+)$")
+    RE_VALUE = re.compile(r"^\s*([^=]+)=(.*)$")
 
     section = None
     for lineno, line in enumerate(open(pathname)):
@@ -66,7 +66,11 @@
                 path = key.strip().lower()
             else:
                 path = section + "/" + key.strip().lower()
-            yield path, value.strip()
+            value = value.strip()
+            if value:
+                yield path, value
+            else:
+                yield path, None
         else:
             raise ParseError(pathname, lineno+1, "line not a comment, and not in the form [section] or key=value")
 
@@ -385,7 +389,7 @@
         self.add_templater("autoconf", autoconf_replacer)
         self.add_function("query", lambda db, x: db.query(x))
         self.add_function("int", lambda db, x: int(x))
-        self.add_function("round", lambda db, x: round(x))
+        self.add_function("round", lambda db, x: int(round(x)))
         self.interpreter = Interpreter(self)
 
     def normalise_path(self, path):
@@ -401,7 +405,10 @@
         for path, value in parser(pathname):
             path = self.normalise_path(path)
             if path is None: continue
-            self.staticdb[path] = value
+            if value is None:
+                self.staticdb.pop(path, None)
+            else:
+                self.staticdb[path] = value
 
     def load_plugin(self, pathname):
         """
@@ -734,7 +741,7 @@
         sys.exit(1)
     except UserError, e:
         if opts.debug: raise
-        warning(e.message)
+        warning(str(e))
         sys.exit(1)
 
     sys.exit(0)
diff -Nru cfget-0.16/debian/changelog cfget-0.17/debian/changelog
--- cfget-0.16/debian/changelog	2010-07-16 10:52:40.000000000 +0200
+++ cfget-0.17/debian/changelog	2010-08-26 17:23:09.000000000 +0200
@@ -1,3 +1,12 @@
+cfget (0.17-1) unstable; urgency=low
+
+  * New upstream version
+     - Fixed a DeprecationWarning with python 2.6
+     - Allow empty values, treating them as unsets
+     - Round function returns an int, not a float
+
+ -- Enrico Zini <enrico@debian.org>  Thu, 26 Aug 2010 17:23:00 +0200
+
 cfget (0.16-1) unstable; urgency=low
 
   * New upstream version
diff -Nru cfget-0.16/PKG-INFO cfget-0.17/PKG-INFO
--- cfget-0.16/PKG-INFO	2010-07-16 10:53:07.000000000 +0200
+++ cfget-0.17/PKG-INFO	2010-08-26 17:23:25.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: cfget
-Version: 0.16
+Version: 0.17
 Summary: get information out of config files
 Home-page: UNKNOWN
 Author: Enrico Zini
diff -Nru cfget-0.16/setup.py cfget-0.17/setup.py
--- cfget-0.16/setup.py	2010-07-16 10:51:29.000000000 +0200
+++ cfget-0.17/setup.py	2010-08-26 16:17:10.000000000 +0200
@@ -3,7 +3,7 @@
 
 setup(
     name='cfget',
-    version='0.16',
+    version='0.17',
     description='get information out of config files',
     author='Enrico Zini',
     author_email='enrico@enricozini.org',
diff -Nru cfget-0.16/testdata/general.ini cfget-0.17/testdata/general.ini
--- cfget-0.16/testdata/general.ini	2010-07-15 19:35:08.000000000 +0200
+++ cfget-0.17/testdata/general.ini	2010-08-26 16:15:48.000000000 +0200
@@ -4,6 +4,7 @@
 start = 2009-08-07 06:05:04
 end = 2009-09-08 07:06:05
 answer = 42
+nothing =
 
 [test_underscore]
 works = true
diff -Nru cfget-0.16/tests/__init__.py cfget-0.17/tests/__init__.py
--- cfget-0.16/tests/__init__.py	2010-07-16 10:51:29.000000000 +0200
+++ cfget-0.17/tests/__init__.py	2010-08-26 16:15:48.000000000 +0200
@@ -32,6 +32,7 @@
 
     def test_simple_expr(self):
         # Test the expression interpreter
+        self.assertEquals(self.db.query("general/nothing"), None)
         self.assertEquals(self.db.query("general/answer"), "42")
         self.assertEquals(self.db.query("(general/answer)"), "42")
         self.assertEquals(self.db.query("general/answer + 1"), 43)


Ciao,

Enrico

-- 
GPG key: 4096R/E7AD5568 2009-05-08 Enrico Zini <enrico@enricozini.org>

Attachment: signature.asc
Description: Digital signature


Reply to: