brunolojor / jbrout

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

feature request. Debug mode #45

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Ability to see in the console not only error messages but also the name of
currently processing file. It must be not default behavior, but only if key
-d is given like a command line argument.

I thins it's good idea, and it help to debug and improve jbrout. For
example on importing and refreshing issues then you try to import folder
with 10 000 images and receive error without description of image which
call this error.

The last situation: I tried to refresh folder with ~1500 photos, and
received error:
Traceback (most recent call last):
   File "./jbrout.py", line 1479, in on_menu_refresh
    self.on_drop_folders_from_os(model,[path])
   File "./jbrout.py", line 1574, in on_drop_folders_from_os
    for nb in iterator:
   File "/home/kefiiir/doc/src/!svn/jbrout-read-only/jbrout/jbrout/db.py",
line 128, in add
    self.__addPhoto( file ,tags,filesInBasket)
   File "/home/kefiiir/doc/src/!svn/jbrout-read-only/jbrout/jbrout/db.py",
line 191, in __addPhoto
    importedTags=node.updateInfo( iii )
   File "/home/kefiiir/doc/src/!svn/jbrout-read-only/jbrout/jbrout/db.py",
line 899, in updateInfo
    nodeComment.text = pc.comment
   File "etree.pyx", line 741, in etree._Element.text.__set__
   File "apihelpers.pxi", line 344, in etree._setNodeText
   File "apihelpers.pxi", line 648, in etree._utf8
 AssertionError: All strings must be XML compatible, either Unicode or ASCII

what I must to do now? I don't know name of the damaged file, and I can't
import all other files in this folder.

Original issue reported on code.google.com by Oleg.Bla...@gmail.com on 21 Jan 2009 at 8:24

GoogleCodeExporter commented 9 years ago
What version of jBrout (displayed in the title bar or in help >> about) and what
operating system please.  

Original comment by r...@wallace.gen.nz on 21 Jan 2009 at 8:31

GoogleCodeExporter commented 9 years ago
revision 168.
Gentoo linux 
x11-libs/gtk+-2.14.4
dev-python/pygtk-2.12.1-r2

Original comment by Oleg.Bla...@gmail.com on 21 Jan 2009 at 8:37

GoogleCodeExporter commented 9 years ago
I assume you are running form the jbrout-svn ebuild.  

To display the console for jBrout under Gentoo Linux simply run it from a
console/xterm session instead of the the window manager menu by running the 
command
"jbrout" and all console output will be displayed int he xterm it was run from
instead of being hidden.

Original comment by r...@wallace.gen.nz on 21 Jan 2009 at 9:03

GoogleCodeExporter commented 9 years ago
I understand that, but in this console output I can't see file name of currently
processing image. I see only something like this

Warning: JPEG format error, rc = 5
Warning: JPEG format error, rc = 5
Warning: JPEG format error, rc = 5
Warning: JPEG format error, rc = 5
Warning: JPEG format error, rc = 5
Warning: JPEG format error, rc = 5
Warning: JPEG format error, rc = 5
Warning: JPEG format error, rc = 5
Warning: JPEG format error, rc = 5
Warning: JPEG format error, rc = 5
Traceback (most recent call last):
  File "./jbrout.py", line 1479, in on_menu_refresh
    self.on_drop_folders_from_os(model,[path])
  File "./jbrout.py", line 1574, in on_drop_folders_from_os
    for nb in iterator:
  File "/home/kefiiir/doc/src/!svn/jbrout-read-only/jbrout/jbrout/db.py", line 128,
in add
    self.__addPhoto( file ,tags,filesInBasket)
  File "/home/kefiiir/doc/src/!svn/jbrout-read-only/jbrout/jbrout/db.py", line 191,
in __addPhoto
    importedTags=node.updateInfo( iii )
  File "/home/kefiiir/doc/src/!svn/jbrout-read-only/jbrout/jbrout/db.py", line 899,
in updateInfo
    nodeComment.text = pc.comment
  File "etree.pyx", line 741, in etree._Element.text.__set__
  File "apihelpers.pxi", line 344, in etree._setNodeText
  File "apihelpers.pxi", line 648, in etree._utf8
AssertionError: All strings must be XML compatible, either Unicode or ASCII

but which one have incorrect jpeg format I don't know, and which one have 
incorrect
none unicode string, I also don't know.

Original comment by Oleg.Bla...@gmail.com on 21 Jan 2009 at 9:10

GoogleCodeExporter commented 9 years ago
try to isolate the faulty picture, and send me back

Original comment by manat...@gmail.com on 26 Jan 2009 at 7:55

GoogleCodeExporter commented 9 years ago
just for me I've chached jbrout/db.py :

before:
    def __addPhoto(self,file,tags,filesInBasket):
        assert type(file)==unicode
        dir,name= os.path.split(file)
        try:
after:
    def __addPhoto(self,file,tags,filesInBasket):
        assert type(file)==unicode
        dir,name= os.path.split(file)
        print file
        try:
it's dirty hack but it works for me, and it helps me to find images wich 
prevented
import. But may be some one from programmers can add something like:

if debug=True:
   print file
and define dubug global variable and cli option.

Original comment by Oleg.Bla...@gmail.com on 24 Mar 2009 at 1:07

GoogleCodeExporter commented 9 years ago
this feature is not needed anymore ... since the filename is displayed with the 
error in the dialog box ... I close it

Original comment by manat...@gmail.com on 14 Oct 2010 at 9:31