Bug fixes:
Really fix the third party module test bug.
--
sim
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+mp3togo (0.3.2) unstable; urgency=low
+
+ * Really be graceful in the absence of third party modules.
+ Thanks fab for the patch.
+
+ -- Simeon Veldstra <reallifesim@gmail.com> Wed, 17 May 2006 12:32:00 -0700
+
mp3togo (0.3.1) unstable; urgency=low
* Thanks: Christopher Arndt for setup.py fix and suggestions.
--- a/debian/mp3togo.1
+++ b/debian/mp3togo.1
@@ -134,4 +134,4 @@ License can be found in /usr/share/commo
.PP
mp3togo can be found online at http://puddle.ca/mp3togo
-.\" created by instant / docbook-to-man, Tue 16 May 2006, 13:17
+.\" created by instant / docbook-to-man, Wed 17 May 2006, 18:51
--- a/mp3togo/__init__.py
+++ b/mp3togo/__init__.py
@@ -21,5 +21,5 @@
# __all__ = ('converter', 'main', 'options', 'setup')
-version = '0.3.1'
+version = '0.3.2'
--- a/mp3togo/conf.py
+++ b/mp3togo/conf.py
@@ -129,20 +129,16 @@ Description:
"""
# Check for Third party modules:
- for name in ('ogg.vorbis', 'ID3', 'xmms'):
- try:
- if '.' in name:
- __import__(name, [], [], [name.split('.')[1]])
- else:
- __import__(name)
- except ImportError:
- msg = "Third party module: " + name
- msg += "is not available. Doing without"
- log(1, "Third party module: %s is not available. Doing without")
+ self.mod = {'ogg.vorbis': False,
+ 'ID3': False,
+ 'fictionalmod': False,
+ 'xmms': False}
# Go ahead and read in the data:
self.getconf(argv, conffile, readconf)
+
+
# All hooks are called with the lock held
# must reference the ._d dict directly
def _post_hook(self):
--- a/mp3togo/options.py
+++ b/mp3togo/options.py
@@ -83,6 +83,9 @@ interface.
# Binaries to check for:
self.bin = {}
+
+ # Third party modules to check for:
+ self.mod = {}
self._help_preamble = ""
@@ -210,10 +213,27 @@ interface.
self.bin[bin] = os.path.join(spot, bin)
break
if self.bin[bin]:
- self.log(3, "%s binary found at %s" % (bin, self.bin[bin]))
+ self.log(4, "%s binary found at %s" % (bin, self.bin[bin]))
else:
self.log(2, "%s binary not found" % bin)
+ #Check for third party modules:
+ for name in self.mod.keys():
+ try:
+ if '.' in name:
+ __import__(name, [], [], [name.split('.')[1]])
+ self.mod[name] = True
+ else:
+ __import__(name)
+ except ImportError:
+ msg = "Third party module: " + name
+ msg += "is not available. Doing without"
+ self.log(2, "Third party module: %s is not available. Doing without" % name)
+ self.mod[name] = False
+ else:
+ self.log(4, "Third party module: %s found" % name)
+ self.mod[name] = True
+
#Do any post configuration chores
self._post_hook()
self._unlock()