brunolojor / jbrout

Automatically exported from code.google.com/p/jbrout
0 stars 0 forks source link

exception log without message #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is just about the log but... 

What steps will reproduce the problem?
1. start jbrout (svn version 269) without exiftool
2. look at the error message
3.

What is the expected output? What do you see instead?
In the code (tools.py in class _Command), an error message is set when
either exiftran or exiftool is not found, but the message is never
displayed... this apparently has to do with the exception processing in
tools.py (class CommandException) which uses a deprecated (as of python
2.6) attribute BaseException.message.

What version of the product are you using? On what operating system?
jbrout svn revision 269

Please provide any additional information below.

Original issue reported on code.google.com by chartier...@gmail.com on 1 Sep 2009 at 1:04

GoogleCodeExporter commented 9 years ago
Doing a search on jbrout code, apart from the CommandException class above, 
there is
a number of 'raise "a string"' which is apparently deprecated (cf. R217 which
corrected it in db.py). 

As for CommandException, it seems it could be replaced by Exception("str") for 
the
raise, and the class CommandException be dropped. 

Original comment by chartier...@gmail.com on 10 Sep 2009 at 10:31

GoogleCodeExporter commented 9 years ago
If one doesn't wish to drop the class CommandException in tools.py, I propose to
replace its current definition by: 

class CommandException(Exception):
   def __init__(self,m):
      self.args=[m]
   def __str__(self):
      return self.args[0]

It seems to work correctly with python 2.4, 2.5 and 2.6  (but the old one, 
though
deprecated, should work too... don't know why it does not print the message.

As for the "raise" simply followed by a string, I noticed that one in jbrout 
main
files (but there are some others in the plugins): 
ExternalTools.py line 183: 
    raise "ExternalTools() : bad constructor"
should be changed to 
    raise Exception ("ExternalTools() : bad constructor")

Original comment by chartier...@gmail.com on 18 Sep 2009 at 10:23

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r277.

Original comment by r...@wallace.gen.nz on 16 Dec 2009 at 1:31