Posts: 1,445
skidoo
Joined: 09 Feb 2012
#1
This is a regression? An older version of the wallpaper.py script wound up in antix16?
Asking because it sure feels like deja vu. I reported this & it was fixed during beta testing way back in 2015.

Code: Select all

demo@antix1:~
$ wallpaper.py
fluxbox
Traceback (most recent call last):
  File"/usr/local/bin/wallpaper.py", line 530, in <module>
    base = MainWindow()
  File"/usr/local/bin/wallpaper.py", line 443, in __init__
    Build_Picture().build_image(Var.IMAGE)
  File"/usr/local/bin/wallpaper.py", line 153, in build_image
    Build_Picture.pix = gtk.gdk.pixbuf_new_from_file_at_scale(image,300,200,True)
glib.GError: Failed to open file '/usr/share/wallpaper/shells-massage-therapy-sand.jpg': No such file or directory
Yes, I'm not using and have deleted the 700Kb+ imagefile"shells-massage-therapy-sand.jpg".

the bug:
success of the wallpaper.py script should not depend on the presence of that specific imagefile
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#2
I don't think that ever got fixed. It appears in antiX-15
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#3
in Aug 2015, Dave mentioned that it is (was) now fixed
post42616.html?hilit=wallpaper

I found this, dated Aug 19

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://github.com/antiX-Dave/antix-wallpaper/blob/master/wallpaper.py"
linktext was:"https://github.com/antiX-Dave/antix-wal ... llpaper.py"
====================================

in this version {compared to wallpaper.py shipped in antiX16} an if() statement has been inserted at line 115.
...but that still wasn't working for me when I tested it today.

I've further modded the copy I retrieved from github, adding a conditional into build_image().
This seems to work; someone else should test it to confirm.

Code: Select all

    def build_image(self, image):
        if os.path.isfile(image):
            Build_Picture.pix = gtk.gdk.pixbuf_new_from_file_at_scale(image,300,200,True)
        else:
            Build_Picture.pix = gtk.gdk.pixbuf_new_from_data("00000000",1,0,1,1,1,1)
        Build_Picture.image = gtk.image_new_from_pixbuf(Build_Picture.pix)
        MainWindow.imagebox.pack_start(Build_Picture.image)
        Build_Picture.image.show()