diff --git a/.gitignore b/.gitignore index e26b6ef..05e45bf 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ wallpapoz-0.4.1-svn92_trunk.tar.bz2 /wallpapoz-0.5.tar.bz2 /wallpapoz-0.6.1.tar.bz2 /wallpapoz-0.6.2.tar.bz2 +/wallpapoz-0.6.2-builder.tar.bz2 diff --git a/sources b/sources index f8b4dab..cd46ad5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -15f052342281eb587bba98c7d6999ce9 wallpapoz-0.6.2.tar.bz2 +SHA512 (wallpapoz-0.6.2.tar.bz2) = 36ed198ba72e08f33ed92dca173f41eb7e7d307366ad42b7cfac2659511f42980351eeb4c02f155469fdf75be79fad37d77bb02118ad91f39da22dae5246860b diff --git a/wallpapoz-0.6.2-CINNAMON.patch b/wallpapoz-0.6.2-CINNAMON.patch new file mode 100644 index 0000000..3fe5866 --- /dev/null +++ b/wallpapoz-0.6.2-CINNAMON.patch @@ -0,0 +1,40 @@ +--- a/share/wallpapoz/lib/wallpapoz_system.py ++++ b/share/wallpapoz/lib/wallpapoz_system.py +@@ -117,6 +117,8 @@ class WallpapozSystem: + self.window_manager = 'XFCE4' + elif wm_name=='Marco': + self.window_manager = 'MATE' ++ elif wm_name=='Mutter (Muffin)': ++ self.window_manager = 'CINNAMON' + else: + try: + output = os.popen("gnome-session --version") +@@ -166,6 +168,9 @@ class WallpapozSystem: + elif self.window_manager == "MATE": + os.system('gsettings set org.mate.background picture-filename ' + '"' + wallpaper + '"') + os.system('gsettings set org.mate.background picture-options ' + self.wallpaper_style) ++ elif self.window_manager == "CINNAMON": ++ os.system("gsettings set org.cinnamon.desktop.background picture-uri 'file://" + wallpaper + "'") ++ os.system("gsettings set org.cinnamon.desktop.background picture-options " + self.wallpaper_style) + elif self.window_manager == "XFCE4": + os.system("xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s " + + '"' + wallpaper + '"') +@@ -183,6 +188,8 @@ class WallpapozSystem: + return os.popen("gsettings get org.gnome.desktop.background picture-uri").read()[8:-2] + elif self.window_manager == "MATE": + return os.popen("gsettings get org.mate.background picture-filename").read()[:-1] ++ elif self.window_manager == "CINNAMON": ++ return os.popen("gsettings get org.cinnamon.desktop.background picture-uri").read()[8:-2] + elif self.window_manager == "XFCE4": + return os.popen("xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path").read()[:-1] + else: +--- a/src/daemon_wallpapoz ++++ b/src/daemon_wallpapoz +@@ -112,6 +112,7 @@ if __name__ == "__main__": + available_style['Gnome'] = { '3' : 'zoom', '2' : 'scaled', '1' : 'stretched', + '0' : 'centered', '4' : 'wallpaper' } + available_style['MATE'] = available_style['Gnome'] ++ available_style['CINNAMON'] = available_style['Gnome'] + available_style['Gnome3'] = available_style['Gnome'] + available_style['XFCE4'] = { '3' : '5', '2' : '4', '1' : '3', '0' : '1', + '4' : '2' } diff --git a/wallpapoz-0.6.2-LXDE.patch b/wallpapoz-0.6.2-LXDE.patch index 7b42b44..aafcf16 100644 --- a/wallpapoz-0.6.2-LXDE.patch +++ b/wallpapoz-0.6.2-LXDE.patch @@ -20,7 +20,7 @@ os.system("xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-style -s " + self.wallpaper_style) + elif self.window_manager == "LXDE": -+ os.system("pcmanfm -w " + wallpaper) ++ os.system("pcmanfm -w " + '"' + wallpaper + '"') + os.system("pcmanfm --wallpaper-mode=" + self.wallpaper_style) ## class method to find current desktop wallpaper diff --git a/wallpapoz-0.6.2-MATE.patch b/wallpapoz-0.6.2-MATE.patch new file mode 100644 index 0000000..8f31556 --- /dev/null +++ b/wallpapoz-0.6.2-MATE.patch @@ -0,0 +1,40 @@ +--- a/share/wallpapoz/lib/wallpapoz_system.py ++++ b/share/wallpapoz/lib/wallpapoz_system.py +@@ -115,6 +115,8 @@ class WallpapozSystem: + pass + if wm_name=='Xfwm4': + self.window_manager = 'XFCE4' ++ elif wm_name=='Marco': ++ self.window_manager = 'MATE' + else: + try: + output = os.popen("gnome-session --version") +@@ -161,6 +163,9 @@ class WallpapozSystem: + elif self.window_manager == "Gnome3": + os.system("gsettings set org.gnome.desktop.background picture-uri 'file://" + wallpaper + "'") + os.system("gsettings set org.gnome.desktop.background picture-options " + self.wallpaper_style) ++ elif self.window_manager == "MATE": ++ os.system('gsettings set org.mate.background picture-filename ' + '"' + wallpaper + '"') ++ os.system('gsettings set org.mate.background picture-options ' + self.wallpaper_style) + elif self.window_manager == "XFCE4": + os.system("xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s " + + '"' + wallpaper + '"') +@@ -176,6 +181,8 @@ class WallpapozSystem: + return os.popen("gconftool-2 -g /desktop/gnome/background/picture_filename").read()[:-1] + elif self.window_manager == "Gnome3": + return os.popen("gsettings get org.gnome.desktop.background picture-uri").read()[8:-2] ++ elif self.window_manager == "MATE": ++ return os.popen("gsettings get org.mate.background picture-filename").read()[:-1] + elif self.window_manager == "XFCE4": + return os.popen("xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path").read()[:-1] + else: +--- a/src/daemon_wallpapoz ++++ b/src/daemon_wallpapoz +@@ -111,6 +111,7 @@ if __name__ == "__main__": + available_style = {} + available_style['Gnome'] = { '3' : 'zoom', '2' : 'scaled', '1' : 'stretched', + '0' : 'centered', '4' : 'wallpaper' } ++ available_style['MATE'] = available_style['Gnome'] + available_style['Gnome3'] = available_style['Gnome'] + available_style['XFCE4'] = { '3' : '5', '2' : '4', '1' : '3', '0' : '1', + '4' : '2' } diff --git a/wallpapoz-0.6.2-python3-desktop-type.patch b/wallpapoz-0.6.2-python3-desktop-type.patch new file mode 100644 index 0000000..5530f16 --- /dev/null +++ b/wallpapoz-0.6.2-python3-desktop-type.patch @@ -0,0 +1,114 @@ +--- wallpapoz-0.6.2/src/wallpapoz.py3.01 2019-11-25 15:36:39.502763400 +0900 ++++ wallpapoz-0.6.2/src/wallpapoz 2019-11-28 13:16:27.404156561 +0900 +@@ -220,7 +220,7 @@ + def get_selected_iter_of_treeview(self, type_selection): + + # treeselection give 2-tuple.... ( model, path ) +- pathlist = self.treeselection.get_selected_rows()[1] ++ model, pathlist = self.treeselection.get_selected_rows() + + # how many of selection do we have + length_of_path_list = len(pathlist) +@@ -883,7 +883,14 @@ + for copy_iter in copy_iter_list: + + # get the parent and child number +- copy_iter_parent_number, copy_iter_child_number = self.store.get_path(copy_iter) ++ if type(self.store) == gtk.TreeStore: ++ copy_iter_parent_number, copy_iter_child_number = self.store.get_path(copy_iter) ++ elif type(self.store) == gtk.ListStore: ++ # "desktop" type xml, workaround ++ copy_iter_child_number = self.store.get_path(copy_iter)[0] ++ copy_iter_parent_number = 0 ++ else: ++ raise + + # we are in new workspace + if copy_iter_parent_number != parent_number_index: +@@ -931,7 +938,11 @@ + # it is not in the same block but still in the same workspace + else: + +- lowest_iter_list.append( ++ if type(self.store) == gtk.ListStore: ++ lowest_iter_list.append( ++ self.store.get_iter(iter_workspace_index+1)) ++ else: ++ lowest_iter_list.append( + self.store.get_iter( (copy_iter_parent_number, iter_workspace_index+1) ) ) + + done_workspace = True +@@ -943,8 +954,13 @@ + # a wallpaper from a workspace, if only one wallpaper existed. + # Need further investigation, however anyway workaround... + new_iter = [] ++ if type(self.store) == gtk.ListStore: ++ parent_number_index = 0 + try: +- new_iter = self.store.get_iter((parent_number_index, iter_workspace_index + 1)) ++ if type(self.store) == gtk.ListStore: ++ new_iter = self.store.get_iter(iter_workspace_index + 1) ++ else: ++ new_iter = self.store.get_iter((parent_number_index, iter_workspace_index + 1)) + except ValueError: + pass + if new_iter: +@@ -970,8 +986,8 @@ + if self.store.get_path(single_iter)[0] != parent_number: + temp_iter_list = [] + parent_number = self.store.get_path(single_iter)[0] +- temp_iter_list.append(single_iter) +- prev_iter = single_iter ++ temp_iter_list.append(single_iter) ++ prev_iter = single_iter + + # do the remaining job + if self.store.iter_n_children( self.store.iter_parent(prev_iter) ) == len(temp_iter_list) and self.work_on_tree == "cut": +@@ -986,11 +1002,17 @@ + # if type(self.store) == gtk.TreeStore: + parent = self.store.iter_parent(position_iter) + new_index = self.store.get_value(position_iter, 0) + 1 +- # if it is child node +- if parent != None: ++ ++ # if it is child node in "workspace" xml or "desktop" type xml ++ if (type(self.store) == gtk.ListStore) or (parent != None): + for single_iter in self.selected_iter: + node_value = self.store.get_value(single_iter, 1) +- position_iter = self.store.insert_after(parent, position_iter, [new_index, node_value, False]) ++ if type(self.store) == gtk.ListStore: ++ # desktop type ++ position_iter = self.store.insert_after(position_iter, [new_index, node_value, False]) ++ else: ++ # child node in workspace xml ++ position_iter = self.store.insert_after(parent, position_iter, [new_index, node_value, False]) + new_index = new_index + 1 + + # after inserting new row, we must sort out the index number after it +@@ -1108,6 +1130,7 @@ + self.order_treeiter_from_lowest_iter(lowest_iter) + + # select something after deleting treenodes ++ self.treeselection.unselect_all() + self.treeselection.select_path(0) + + # create configuration file ( we call this method when we click save button ) +@@ -1274,6 +1297,18 @@ + # Nothing left + return + ++ if type(self.store) == gtk.ListStore: ++ #self.builder.get_object("rename_workspace").set_sensitive(False) ++ #self.rename_workspace_menu.set_sensitive(False) ++ self.builder.get_object("change_wallpaper").set_sensitive(True) ++ self.change_wallpaper_menu.set_sensitive(True) ++ self.builder.get_object("cut").set_sensitive(True) ++ self.cut_menu.set_sensitive(True) ++ self.builder.get_object("copy").set_sensitive(True) ++ self.copy_menu.set_sensitive(True) ++ self.builder.get_object("delete_wallpapers").set_sensitive(True) ++ self.delete_wallpapers_menu.set_sensitive(True) ++ + if type(self.store) == gtk.TreeStore: + parent = self.store.iter_parent(position_iter) + # parent node, enable: rename_workspace diff --git a/wallpapoz-0.6.2-python3.patch b/wallpapoz-0.6.2-python3.patch new file mode 100644 index 0000000..533dcfb --- /dev/null +++ b/wallpapoz-0.6.2-python3.patch @@ -0,0 +1,786 @@ +diff -urp wallpapoz-0.6.2.py2/setup.py wallpapoz-0.6.2.py3/setup.py +--- wallpapoz-0.6.2.py2/setup.py 2019-09-02 14:04:36.124389528 +0900 ++++ wallpapoz-0.6.2.py3/setup.py 2019-09-02 14:50:57.162142691 +0900 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python2 ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + + #============================================================================= +@@ -62,7 +62,7 @@ Options: + """) + + def info(): +- print usage_info ++ print (usage_info) + sys.exit(1) + + def install(src, dst): +@@ -73,9 +73,9 @@ def install(src, dst): + if not os.path.isdir(os.path.dirname(dst)): + os.makedirs(os.path.dirname(dst)) + shutil.copy2(src, dst) +- print _("Installed"), dst ++ print (_("Installed"), dst) + except: +- print _("Error while installing"), dst ++ print (_("Error while installing"), dst) + + def uninstall(path): + try: +@@ -86,71 +86,75 @@ def uninstall(path): + shutil.rmtree(path) + else: + return +- print _("Removed"), path ++ print (_("Removed"), path) + except: +- print _("Error while removing"), path ++ print (_("Error while removing"), path) + + def check_dependencies(): + required_found = True + recommended_found = True +- print _("Checking dependencies...") ++ print (_("Checking dependencies...")) + print +- print _("Required dependencies:") ++ print (_("Required dependencies:")) + print + # Should also check the PyGTK version. To do that we have to load the + # gtk module though, which normally can't be done while using `sudo`. + try: +- import pygtk +- print " PyGTK ........................ OK" ++ #import pygtk ++ import gi ++ gi.require_version("Gtk", "3.0") ++ from gi.repository import Gtk ++ print (" PyGTK ........................ OK") + except ImportError: +- print " !!! PyGTK .................... ", _("Not found") ++ print (" !!! PyGTK .................... ", _("Not found")) + required_found = False + try: + # shutdown the warnings + import warnings + warnings.simplefilter("ignore", Warning) +- import gtk.glade +- print " Python Glade ................. OK" +- except ImportError: +- print " !!! Python Glade ............. ", _("Not found") ++ #import gtk.glade ++ Gtk.Builder() ++ print (" Python Glade ................. OK") ++ except (ImportError, AttributeError): ++ print (" !!! Python Glade ............. ", _("Not found")) + required_found = False + except RuntimeError: + # so we can check dependency when there is no DISPLAY + warnings.simplefilter("default", Warning) + if not os.environ.get("DISPLAY"): +- print " Python Glade ................. SKIP" ++ print (" Python Glade ................. SKIP") + else: +- print " !!! Python Glade ............. ", _("Not found") +- required_found = False ++ print (" !!! Python Glade ............. ", _("Not found")) ++ #required_found = False + try: + from PIL import Image +- print " Python Imaging Library ....... OK" ++ print (" Python Imaging Library ....... OK") + except ImportError: +- print " !!! Python Imaging Library ... ", _("Not found") ++ print (" !!! Python Imaging Library ... ", _("Not found")) + required_found = False + try: + import gnome +- print " Gnome Python ................. OK" ++ print (" Gnome Python ................. OK") + except ImportError: +- print " !!! Gnome Python ............. ", _("Not found") ++ print (" !!! Gnome Python ............. ", _("Not found")) + recommended_found = False + out = os.popen('which xwininfo').readlines + if out == []: +- print " Xwininfo tool ................ ", _("Not found") ++ print (" Xwininfo tool ................ ", _("Not found")) + required_found = False + else: +- print " Xwininfo tool ................ OK" ++ print (" Xwininfo tool ................ OK") + + if not required_found: + print +- print _("Could not find all required dependencies!") +- print _("Please install them and try again.") ++ print (_("Could not find all required dependencies!")) ++ print (_("Please install them and try again.")) + print + sys.exit(1) + if not recommended_found: + print +- print _("Gnome Python is not found. Wallpapoz still could be used and it has been installed.") +- print _("But it means you can not access help documentation in your native language if it is available.") ++ print (_("Gnome Python is not found. Wallpapoz still could be used and it has been installed.")) ++ print (_("But it means you can not access help documentation in your native language if it is available.")) + print + + install_dir = "/usr/local/" +@@ -166,12 +170,12 @@ for opt, value in opts: + if opt == "--installdir": + install_dir = value + if not os.path.isdir(install_dir): +- print _("\n*** Error:"), install_dir, _("does not exist.\n" ) ++ print (_("\n*** Error:"), install_dir, _("does not exist.\n" )) + info() + + if args == ["install"]: + check_dependencies() +- print _("Installing Wallpapoz in"), install_dir, "...\n" ++ print (_("Installing Wallpapoz in"), install_dir, "...\n") + install("src/wallpapoz", "bin/wallpapoz") + install("src/daemon_wallpapoz", "bin/daemon_wallpapoz") + install("src/launcher_wallpapoz.sh", "bin/launcher_wallpapoz.sh") +@@ -193,7 +197,7 @@ if args == ["install"]: + "share/gnome/help/wallpapoz/" + lang + "/legal.xml") + + elif args == ["uninstall"]: +- print _("Uninstalling Wallpapoz from"), install_dir, "...\n" ++ print (_("Uninstalling Wallpapoz from"), install_dir, "...\n") + uninstall("bin/wallpapoz") + uninstall("bin/daemon_wallpapoz") + uninstall("bin/launcher_wallpapoz.sh") +@@ -211,11 +215,11 @@ elif args == ["uninstall"]: + uninstall("share/gnome/help/wallpapoz/" + lang + "/wallpapoz.xml") + uninstall("share/gnome/help/wallpapoz/" + lang + "/legal.xml") + print +- print _(""" ++ print (_(""" + There might still be files in ~/.wallpapoz/ left on your system. + Please remove that directory manually if you do not plan to + install Wallpapoz again later. +-""") ++""")) + + else: + info() +diff -urp wallpapoz-0.6.2.py2/share/wallpapoz/lib/wallpapoz_system.py wallpapoz-0.6.2.py3/share/wallpapoz/lib/wallpapoz_system.py +--- wallpapoz-0.6.2.py2/share/wallpapoz/lib/wallpapoz_system.py 2019-09-02 14:04:36.105389275 +0900 ++++ wallpapoz-0.6.2.py3/share/wallpapoz/lib/wallpapoz_system.py 2019-09-01 21:08:35.000000000 +0900 +@@ -44,8 +44,8 @@ class WallpapozSystem: + + # Check if total_workspaces changed only here + if WallpapozSystem.static_total_workspaces != self.total_workspaces: +- print "daemon_wallpapoz: the number of total workspaces changed during initialization process." +- print "daemon_wallpapoz: respawning daemon_wallpapoz." ++ print ("daemon_wallpapoz: the number of total workspaces changed during initialization process.") ++ print ("daemon_wallpapoz: respawning daemon_wallpapoz.") + self.respawn_system() + + def exec_cmd_under_X(self, cmd): +@@ -57,32 +57,35 @@ class WallpapozSystem: + shell = True + ) + except OSError: +- print "daemon_wallpapoz: fork failed for %s, exiting." %cmd ++ print ("daemon_wallpapoz: fork failed for %s, exiting." %cmd) + sys.exit(1) + + pstdout = p.stdout.read() + pstderr = p.stderr.read() + ret = p.wait() ++ # FIXME ++ pstdout_str = pstdout.decode('utf-8') + + kill_daemon = False + + if (ret != 0) and (ret & 0xFF): +- print "daemon_wallpapoz: %s returned status %i." %(cmd, ret) +- print "daemon_wallpapoz: error message: %s" %pstderr ++ print ("daemon_wallpapoz: %s returned status %i." %(cmd, ret)) ++ print ("daemon_wallpapoz: error message: %s" %pstderr) + kill_daemon = True + +- if (cmd.find('xprop') >= 0) and (pstdout.find('no such atom') >= 0): ++ if (cmd.find('xprop') >= 0) and (pstdout_str.find('no such atom') >= 0): + kill_daemon = True +- if (cmd.find('xprop') >= 0) and (pstdout.find('not') >= 0): ++ if (cmd.find('xprop') >= 0) and (pstdout_str.find('not') >= 0): + kill_daemon = True + + if kill_daemon: + ## No X resource available, kill daemon_wallpapoz +- print "daemon_wallpapoz: X resource seems no longer available." +- print "daemon_wallpapoz: killing daemon_wallpapoz." ++ print ("daemon_wallpapoz: X resource seems no longer available.") ++ print ("daemon_wallpapoz: killing daemon_wallpapoz.") + sys.exit(1) + +- return pstdout ++ #FIXME ++ return pstdout_str + + def set_style(self, style): + self.wallpaper_style = style +@@ -209,7 +212,7 @@ class WallpapozSystem: + new_argv = [] + new_argv.extend(sys.argv) + os.execvp('daemon_wallpapoz', new_argv) +- print "os.execvp failed, exiting..." ++ print ("os.execvp failed, exiting...") + sys.exit(1) + + def prevent_multiple_start(self): +diff -urp wallpapoz-0.6.2.py2/share/wallpapoz/lib/xml_processing.py wallpapoz-0.6.2.py3/share/wallpapoz/lib/xml_processing.py +--- wallpapoz-0.6.2.py2/share/wallpapoz/lib/xml_processing.py 2012-02-20 03:57:12.000000000 +0900 ++++ wallpapoz-0.6.2.py3/share/wallpapoz/lib/xml_processing.py 2019-09-01 21:23:33.000000000 +0900 +@@ -28,7 +28,9 @@ import xml + import os + import sys + import gettext +-import gtk ++import gi ++gi.require_version("Gtk", "3.0") ++from gi.repository import Gtk, GObject + from wallpapoz_system import WallpapozSystem + + # i18n +@@ -36,8 +38,8 @@ APP = "wallpapoz" + DIR = "../../locale" + gettext.bindtextdomain(APP, DIR) + gettext.textdomain(APP) +-gtk.glade.bindtextdomain(APP, DIR) +-gtk.glade.textdomain(APP) ++#gtk.glade.bindtextdomain(APP, DIR) ++#gtk.glade.textdomain(APP) + _ = gettext.gettext + + ## XMLProcessing -- class for processing wallpapoz xml file +@@ -64,7 +66,7 @@ class XMLProcessing: + # if wallpapoz run for the first time ( no configuration file ) + # we make default list, for every workspace, we give one wallpaper that is our current wallpaper + if not os.path.exists(self.config_file): +- print _("No configuration file. Use default configuration.") ++ print (_("No configuration file. Use default configuration.")) + home = os.environ['HOME'] + if not os.path.exists(home + '/.wallpapoz'): + os.makedirs(home + '/.wallpapoz') +@@ -75,7 +77,7 @@ class XMLProcessing: + try: + self.xmldoc = minidom.parse(self.config_file) + except xml.parsers.expat.ExpatError: +- print _("The configuration file is corrupted. Remove it then create a new one again with Wallpapoz!") ++ print (_("The configuration file is corrupted. Remove it then create a new one again with Wallpapoz!")) + sys.exit() + + # wallpapoz node +@@ -101,7 +103,7 @@ class XMLProcessing: + try: + self.xmldoc = minidom.parse(self.config_file) + except xml.parsers.expat.ExpatError: +- print _("The configuration file is corrupted. Remove it then create a new one again with Wallpapoz!") ++ print (_("The configuration file is corrupted. Remove it then create a new one again with Wallpapoz!")) + sys.exit() + + # wallpapoz node +@@ -287,7 +289,7 @@ class XMLProcessing: + # save the xml file + def save(self): + xml_file = open(self.config_file, "w") +- xml_file.write( self.xmldoc.toxml("utf-8") ) ++ xml_file.write( self.xmldoc.toxml("utf-8").decode("utf-8") ) + + # fill list with default value + def default_fill_list(self, type): +@@ -406,4 +408,4 @@ class XMLProcessing: + + # create it + xml_file = open(self.config_file, "w") +- xml_file.write( newdoc.toxml("utf-8") ) ++ xml_file.write( newdoc.toxml("utf-8").decode("utf-8") ) +diff -urp wallpapoz-0.6.2.py2/src/daemon_wallpapoz wallpapoz-0.6.2.py3/src/daemon_wallpapoz +--- wallpapoz-0.6.2.py2/src/daemon_wallpapoz 2019-09-02 14:04:36.168390114 +0900 ++++ wallpapoz-0.6.2.py3/src/daemon_wallpapoz 2019-09-01 20:59:43.000000000 +0900 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python2 ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + + #================================================ +@@ -33,7 +33,7 @@ import array + import time + import threading + import random +-import gtk.glade ++#import gtk.glade + import string + + # so we can call from anywhere +@@ -133,7 +133,7 @@ if __name__ == "__main__": + total_workspaces = wallpapoz_system.get_total_workspaces() + + # create the index for wallpaper list thread +- number.fromlist( range( total_workspaces ) ) ++ number.fromlist( list(range( total_workspaces ) ) ) + + # previous workspace + previous_desktop = -1 +diff -urp wallpapoz-0.6.2.py2/src/wallpapoz wallpapoz-0.6.2.py3/src/wallpapoz +--- wallpapoz-0.6.2.py2/src/wallpapoz 2019-09-02 14:04:36.159389994 +0900 ++++ wallpapoz-0.6.2.py3/src/wallpapoz 2019-09-02 14:13:50.533772653 +0900 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python2 ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + + #============================================================================= +@@ -27,10 +27,10 @@ + ## wallpapoz.py -- the gui tool for creating configuration file and + # calling daemon program + +-import pygtk +-pygtk.require('2.0') +-import gtk.glade +-import gobject ++import gi ++gi.require_version("Gtk", "3.0") ++from gi.repository import Gtk as gtk, GObject as gobject, Gdk as gdk ++from gi.repository import GdkPixbuf + import os + import sys + import stat +@@ -55,8 +55,8 @@ APP = "wallpapoz" + DIR = "../share/locale" + gettext.bindtextdomain(APP, DIR) + gettext.textdomain(APP) +-gtk.glade.bindtextdomain(APP, DIR) +-gtk.glade.textdomain(APP) ++#gtk.glade.bindtextdomain(APP, DIR) ++#gtk.glade.textdomain(APP) + _ = gettext.gettext + + # main class for the gui. This gui will contruct the configuration file that will be used by daemon +@@ -69,25 +69,32 @@ class Wallpapoz: + # the contructor + def __init__(self): + # wallpapoz glade file +- self.wallpapoz_glade_file = "../share/wallpapoz/glade/wallpapoz.glade" ++ #self.wallpapoz_glade_file = "../share/wallpapoz/glade/wallpapoz.glade" ++ self.wallpapoz_builder_file = "../share/wallpapoz/glade/wallpapoz-builder-wallpapoz_window.glade" + + # call the xmlprocessing class to read it later on method related to treeview + self.wallpapozxml = XMLProcessing() + + # Load the glade +- self.main_window = gtk.glade.XML(self.wallpapoz_glade_file, "wallpapoz_window", APP) ++ self.builder = gtk.Builder() ++ self.builder.set_translation_domain(APP) ++ self.builder.add_from_file(self.wallpapoz_builder_file) ++ #self.main_window = gtk.glade.XML(self.wallpapoz_glade_file, "wallpapoz_window", APP) ++ self.main_window = self.builder.get_object("wallpapoz_window") + + # window widget +- self.main_window_widget = self.main_window.get_widget("wallpapoz_window") ++ self.main_window_widget = self.builder.get_object("wallpapoz_window") + + # treeview widget +- self.treeview_widget = self.main_window.get_widget("treeview") ++ self.treeview_widget = self.builder.get_object("treeview") ++ # FIXME set here ++ self.treeselection = self.treeview_widget.get_selection() + + # image widget +- self.image_widget = self.main_window.get_widget("wallpaper_image") ++ self.image_widget = self.builder.get_object("wallpaper_image") + + # image filename widget +- self.wallpaper_filename = self.main_window.get_widget("wallpaper_name_label") ++ self.wallpaper_filename = self.builder.get_object("wallpaper_name_label") + + # create the pop up menu when we right click the treeview widget + self.set_up_popup_menu() +@@ -121,7 +128,7 @@ class Wallpapoz: + "on_move_up_activate" : self.move_up_node, + "on_move_down_activate" : self.move_down_node, + "on_treeview_button_press_event" : self.right_click_menu } +- self.main_window.signal_autoconnect(dic) ++ self.builder.connect_signals(dic) + + # show treeview + self.load_treeview() +@@ -132,16 +139,16 @@ class Wallpapoz: + # set up popup menu when we right click the treeview widget + def set_up_popup_menu(self): + self.popup_menu = gtk.Menu() +- add_wallpapers_files_menu = gtk.MenuItem(_("Add Wallpapers (Files)")) +- add_wallpapers_directory_menu = gtk.MenuItem(_("Add Wallpapers (Directory)")) +- self.cut_menu = gtk.MenuItem(_("Cut")) +- self.copy_menu = gtk.MenuItem(_("Copy")) +- paste_menu = gtk.MenuItem(_("Paste")) +- self.rename_workspace_menu = gtk.MenuItem(_("Rename Workspace")) +- self.change_wallpaper_menu = gtk.MenuItem(_("Change Wallpaper")) +- self.delete_wallpapers_menu = gtk.MenuItem(_("Delete Wallpapers")) +- move_up_menu = gtk.MenuItem(_("Move Up")) +- move_down_menu = gtk.MenuItem(_("Move Down")) ++ add_wallpapers_files_menu = gtk.MenuItem(label=_("Add Wallpapers (Files)")) ++ add_wallpapers_directory_menu = gtk.MenuItem(label=_("Add Wallpapers (Directory)")) ++ self.cut_menu = gtk.MenuItem(label=_("Cut")) ++ self.copy_menu = gtk.MenuItem(label=_("Copy")) ++ paste_menu = gtk.MenuItem(label=_("Paste")) ++ self.rename_workspace_menu = gtk.MenuItem(label=_("Rename Workspace")) ++ self.change_wallpaper_menu = gtk.MenuItem(label=_("Change Wallpaper")) ++ self.delete_wallpapers_menu = gtk.MenuItem(label=_("Delete Wallpapers")) ++ move_up_menu = gtk.MenuItem(label=_("Move Up")) ++ move_down_menu = gtk.MenuItem(label=_("Move Down")) + add_wallpapers_files_menu.connect("activate", self.add_wallpapers_files) + add_wallpapers_directory_menu.connect("activate", self.add_wallpapers_directory) + self.cut_menu.connect("activate", self.cut_treenode) +@@ -175,8 +182,8 @@ class Wallpapoz: + + # popup menu when user right-click the treeview widget + def right_click_menu(self, widget, event): +- if event.type == gtk.gdk.BUTTON_PRESS and event.button == 3: +- self.popup_menu.popup(None, None, None, event.button, event.time) ++ if event.type == gdk.EventType.BUTTON_PRESS and event.button == 3: ++ self.popup_menu.popup(None, None, None, None, event.button, event.time) + + def restart_daemon(self, widget): + self.stop_daemon(None) +@@ -201,8 +208,12 @@ class Wallpapoz: + + # when user click about menu item, show about dialog + def display_about(self, widget): +- about_dialog = gtk.glade.XML(self.wallpapoz_glade_file, "wallpapoz_about_dialog", APP) +- aboutdlg_widget = about_dialog.get_widget("wallpapoz_about_dialog") ++ #about_dialog = gtk.glade.XML(self.wallpapoz_glade_file, "wallpapoz_about_dialog", APP) ++ self.about_dialog_builder_file = "../share/wallpapoz/glade/wallpapoz-builder-wallpapoz_about_dialog.glade" ++ self.about_dialog_builder = gtk.Builder() ++ self.about_dialog_builder.set_translation_domain(APP) ++ self.about_dialog_builder.add_from_file(self.about_dialog_builder_file) ++ aboutdlg_widget = self.about_dialog_builder.get_object("wallpapoz_about_dialog") + aboutdlg_widget.connect('response', lambda w, e: aboutdlg_widget.destroy()) + + # get the selection iter +@@ -326,15 +337,17 @@ class Wallpapoz: + dialog_title = _("Choose Wallpapers") + + # our filechooser dialog +- filechooser_dialog = gtk.FileChooserDialog(dialog_title, self.main_window_widget, gtk.FILE_CHOOSER_ACTION_OPEN) ++ filechooser_dialog = gtk.FileChooserDialog(dialog_title, self.main_window_widget, gtk.FileChooserAction.OPEN) + + # our button +- cancel_button = filechooser_dialog.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) ++ cancel_button = filechooser_dialog.add_button(gtk.STOCK_CANCEL, gtk.ResponseType.CANCEL) + if type_of_ok_button == "change": +- ok_button = filechooser_dialog.add_button(_("Change"), gtk.RESPONSE_OK) ++ ok_button = filechooser_dialog.add_button(_("Change"), gtk.ResponseType.OK) + elif type_of_ok_button == "add": +- ok_button = filechooser_dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK) +- gtk.Tooltips().set_tip(ok_button, _("Add wallpapers")) ++ ok_button = filechooser_dialog.add_button(gtk.STOCK_OK, gtk.ResponseType.OK) ++ # FIXME ++ #gtk.Tooltips().set_tip(ok_button, _("Add wallpapers")) ++ ok_button.set_tooltip_text(_("Add wallpapers")) + + # cancel will quit the filechooser dialog + cancel_button.connect("clicked", lambda w: filechooser_dialog.destroy()) +@@ -379,7 +392,7 @@ class Wallpapoz: + filechooser_dialog.set_select_multiple(True) + + # if user choose the file, add his choice to treeview +- if filechooser_dialog.run() == gtk.RESPONSE_OK: ++ if filechooser_dialog.run() == gtk.ResponseType.OK: + # get the list of filename that we choose to add + filenames = filechooser_dialog.get_filenames() + +@@ -436,15 +449,21 @@ class Wallpapoz: + + # show up the preferences dialog + def preferences_option(self, widget): +- self.preferences_dialog = gtk.glade.XML(self.wallpapoz_glade_file, "preferences_dialog", APP) +- preferences_dialog_widget = self.preferences_dialog.get_widget("preferences_dialog") ++ #self.preferences_dialog = gtk.glade.XML(self.wallpapoz_glade_file, "preferences_dialog", APP) ++ self.preferences_dialog_builder_file = "../share/wallpapoz/glade/wallpapoz-builder-preferences_dialog.glade" ++ self.preferences_dialog_builder = gtk.Builder() ++ self.preferences_dialog_builder.set_translation_domain(APP) ++ self.preferences_dialog_builder.add_from_file(self.preferences_dialog_builder_file) ++ # FIXME ++ self.preferences_dialog = self.preferences_dialog_builder ++ preferences_dialog_widget = self.preferences_dialog.get_object("preferences_dialog") + + # input widgets +- time_changed_widget = self.preferences_dialog.get_widget("preferences_dialog_spin_button_time") +- random_order_widget = self.preferences_dialog.get_widget("preferences_dialog_show_wallpaper_random_order") +- changing_workspace_widget = self.preferences_dialog.get_widget("preferences_dialog_change_wallpaper_changing_workspace") +- style_widget = self.preferences_dialog.get_widget("preferences_dialog_style_combobox") +- size_widget = self.preferences_dialog.get_widget("preferences_dialog_size_combobox") ++ time_changed_widget = self.preferences_dialog.get_object("preferences_dialog_spin_button_time") ++ random_order_widget = self.preferences_dialog.get_object("preferences_dialog_show_wallpaper_random_order") ++ changing_workspace_widget = self.preferences_dialog.get_object("preferences_dialog_change_wallpaper_changing_workspace") ++ style_widget = self.preferences_dialog.get_object("preferences_dialog_style_combobox") ++ size_widget = self.preferences_dialog.get_object("preferences_dialog_size_combobox") + + # load value from xml file + time_changed_widget.set_value(float(self.wallpapozxml.delay())) +@@ -458,19 +477,19 @@ class Wallpapoz: + changing_workspace_widget.set_active(self.wallpapozxml.change_wallpaper_when_changing_workspace()) + + # button +- cancel_button = self.preferences_dialog.get_widget("preferences_cancel_button") ++ cancel_button = self.preferences_dialog.get_object("preferences_cancel_button") + cancel_button.connect("clicked", lambda w: preferences_dialog_widget.destroy()) + +- ok_button = self.preferences_dialog.get_widget("preferences_ok_button") ++ ok_button = self.preferences_dialog.get_object("preferences_ok_button") + ok_button.connect("clicked", self.ok_preferences_dialog) + + def ok_preferences_dialog(self, widget): +- time_changed_widget = self.preferences_dialog.get_widget("preferences_dialog_spin_button_time") +- random_order_widget = self.preferences_dialog.get_widget("preferences_dialog_show_wallpaper_random_order") +- changing_workspace_widget = self.preferences_dialog.get_widget("preferences_dialog_change_wallpaper_changing_workspace") +- style_widget = self.preferences_dialog.get_widget("preferences_dialog_style_combobox") +- size_widget = self.preferences_dialog.get_widget("preferences_dialog_size_combobox") +- preferences_dialog_widget = self.preferences_dialog.get_widget("preferences_dialog") ++ time_changed_widget = self.preferences_dialog.get_object("preferences_dialog_spin_button_time") ++ random_order_widget = self.preferences_dialog.get_object("preferences_dialog_show_wallpaper_random_order") ++ changing_workspace_widget = self.preferences_dialog.get_object("preferences_dialog_change_wallpaper_changing_workspace") ++ style_widget = self.preferences_dialog.get_object("preferences_dialog_style_combobox") ++ size_widget = self.preferences_dialog.get_object("preferences_dialog_size_combobox") ++ preferences_dialog_widget = self.preferences_dialog.get_object("preferences_dialog") + + # user change option for changing_workspace + if changing_workspace_widget.get_active(): +@@ -508,10 +527,17 @@ class Wallpapoz: + if iter == None: + return + +- choose_directory_dialog = gtk.glade.XML(self.wallpapoz_glade_file, "add_wallpapers_directory_dialog", APP) +- choose_directory_dialog_widget = choose_directory_dialog.get_widget("add_wallpapers_directory_dialog") +- filechooser_widget = choose_directory_dialog.get_widget("filechooserwidget") +- recursive_widget = choose_directory_dialog.get_widget("recursive_checkbutton") ++ #choose_directory_dialog = gtk.glade.XML(self.wallpapoz_glade_file, "add_wallpapers_directory_dialog", APP) ++ self.choose_directory_dialog_file = "../share/wallpapoz/glade/wallpapoz-builder-add_wallpapers_directory_dialog.glade" ++ self.choose_directory_dialog_builder = gtk.Builder() ++ self.choose_directory_dialog_builder.set_translation_domain(APP) ++ self.choose_directory_dialog_builder.add_from_file(self.choose_directory_dialog_file) ++ # FIXME ++ choose_directory_dialog = self.choose_directory_dialog_builder ++ ++ choose_directory_dialog_widget = choose_directory_dialog.get_object("add_wallpapers_directory_dialog") ++ filechooser_widget = choose_directory_dialog.get_object("filechooserwidget") ++ recursive_widget = choose_directory_dialog.get_object("recursive_checkbutton") + + # set it to last directory + if self.last_directory == None: +@@ -528,7 +554,7 @@ class Wallpapoz: + + dic = { "on_cancel_add_wallpapers_directory_button_clicked" : (self.cancel_button_add_wallpapers_directory, choose_directory_dialog_widget), + "on_add_wallpapers_directory_button_clicked" : (self.ok_button_add_wallpapers_directory, filechooser_widget, recursive_widget, choose_directory_dialog_widget, iter) } +- choose_directory_dialog.signal_autoconnect(dic) ++ choose_directory_dialog.connect_signals(dic) + + # ok, if we choose the directory ( accept filechooser, recursive checkbutton, iter pointing treenode ), function add_wallpapers_directory call this function + def ok_button_add_wallpapers_directory(self, widget, filechooser_widget, recursive_widget, choose_directory_dialog_widget, iter): +@@ -735,7 +761,7 @@ class Wallpapoz: + ii = ii + 1 + + # enable rename workspace menu +- self.main_window.get_widget("rename_workspace").set_sensitive(True) ++ self.builder.get_object("rename_workspace").set_sensitive(True) + + # name of our left column + left_tvcolumn_name = _("Workspace") +@@ -746,12 +772,12 @@ class Wallpapoz: + self.store = gtk.ListStore(gobject.TYPE_INT, gobject.TYPE_STRING, gobject.TYPE_BOOLEAN) + + # disable cut, copy, paste, rename menu item +- self.main_window.get_widget("cut").set_sensitive(False) +- self.main_window.get_widget("copy").set_sensitive(False) +- self.main_window.get_widget("paste").set_sensitive(False) ++ self.builder.get_object("cut").set_sensitive(False) ++ self.builder.get_object("copy").set_sensitive(False) ++ self.builder.get_object("paste").set_sensitive(False) + + # enable change wallpaper menu item +- self.main_window.get_widget("change_wallpaper").set_sensitive(True) ++ self.builder.get_object("change_wallpaper").set_sensitive(True) + + # make the wallpaper list + for i in range(len(worklist)): +@@ -786,7 +812,7 @@ class Wallpapoz: + + # set mode to multiple selection + self.treeselection = self.treeview_widget.get_selection() +- self.treeselection.set_mode(gtk.SELECTION_MULTIPLE) ++ self.treeselection.set_mode(gtk.SelectionMode.MULTIPLE) + self.treeselection.select_path(0) + + # show image for liststore +@@ -814,7 +840,7 @@ class Wallpapoz: + # status, copy or cut + self.work_on_tree = "copy" + # enable the paste menu item +- self.main_window.get_widget("paste").set_sensitive(True) ++ self.builder.get_object("paste").set_sensitive(True) + + # we call this method when we click cut menu action + def cut_treenode(self, widget): +@@ -829,7 +855,7 @@ class Wallpapoz: + # status, copy or cut + self.work_on_tree = "cut" + # enable the paste menu item +- self.main_window.get_widget("paste").set_sensitive(True) ++ self.builder.get_object("paste").set_sensitive(True) + + # helper function for reordering node after cut&paste, returning list of all lowest not selected iter from the related workspace + def reordering_node_after_cut_and_paste(self, copy_iter_list): +@@ -942,10 +968,10 @@ class Wallpapoz: + parent_number = self.store.get_path(self.selected_iter[0])[0] + for single_iter in self.selected_iter: + if self.store.get_path(single_iter)[0] != parent_number: +- temp_iter_list = [] +- parent_number = self.store.get_path(single_iter)[0] +- temp_iter_list.append(single_iter) +- prev_iter = single_iter ++ temp_iter_list = [] ++ parent_number = self.store.get_path(single_iter)[0] ++ temp_iter_list.append(single_iter) ++ prev_iter = single_iter + + # do the remaining job + if self.store.iter_n_children( self.store.iter_parent(prev_iter) ) == len(temp_iter_list) and self.work_on_tree == "cut": +@@ -990,7 +1016,7 @@ class Wallpapoz: + # make sure the status is reset + self.work_on_tree = None + # disable the paste menu item +- self.main_window.get_widget("paste").set_sensitive(False) ++ self.builder.get_object("paste").set_sensitive(False) + + self.cut_and_reordering_treeiter() + +@@ -1001,7 +1027,7 @@ class Wallpapoz: + # workaround for the case that trying to remove a wallpaper from + # the workspace where only one wallpaper exists + if not lowest_iter_list: +- return ++ return + + # iterate to cut ( really!!! ) the iter from selected iter list + for single_iter in self.selected_iter: +@@ -1212,7 +1238,7 @@ class Wallpapoz: + # make the chooser dialog + filechooser_dialog = self.make_chooser_dialog("change") + # if user okay with his choice, then change the value +- if filechooser_dialog.run() == gtk.RESPONSE_OK: ++ if filechooser_dialog.run() == gtk.ResponseType.OK: + # we interested in image file + if self.is_image_file(filechooser_dialog.get_filename()): + self.store.set_value(iter, 1, filechooser_dialog.get_filename()) +@@ -1235,15 +1261,15 @@ class Wallpapoz: + + if not position_iter: + # Nothing is selected, unfortunately this can happen +- self.main_window.get_widget("rename_workspace").set_sensitive(False) ++ self.builder.get_object("rename_workspace").set_sensitive(False) + self.rename_workspace_menu.set_sensitive(False) +- self.main_window.get_widget("change_wallpaper").set_sensitive(False) ++ self.builder.get_object("change_wallpaper").set_sensitive(False) + self.change_wallpaper_menu.set_sensitive(False) +- self.main_window.get_widget("cut").set_sensitive(False) ++ self.builder.get_object("cut").set_sensitive(False) + self.cut_menu.set_sensitive(False) +- self.main_window.get_widget("copy").set_sensitive(False) ++ self.builder.get_object("copy").set_sensitive(False) + self.copy_menu.set_sensitive(False) +- self.main_window.get_widget("delete_wallpapers").set_sensitive(False) ++ self.builder.get_object("delete_wallpapers").set_sensitive(False) + self.delete_wallpapers_menu.set_sensitive(False) + # Nothing left + return +@@ -1255,13 +1281,13 @@ class Wallpapoz: + + # child node + if parent != None: +- self.main_window.get_widget("rename_workspace").set_sensitive(False) ++ self.builder.get_object("rename_workspace").set_sensitive(False) + self.rename_workspace_menu.set_sensitive(False) +- self.main_window.get_widget("change_wallpaper").set_sensitive(True) ++ self.builder.get_object("change_wallpaper").set_sensitive(True) + self.change_wallpaper_menu.set_sensitive(True) +- self.main_window.get_widget("cut").set_sensitive(True) ++ self.builder.get_object("cut").set_sensitive(True) + self.cut_menu.set_sensitive(True) +- self.main_window.get_widget("copy").set_sensitive(True) ++ self.builder.get_object("copy").set_sensitive(True) + self.copy_menu.set_sensitive(True) + + # See create_configuration_file +@@ -1272,23 +1298,23 @@ class Wallpapoz: + # Only show "Delete wallpapers" menu if there are at least 2 wallpapers + # in a workspace + if childiter: +- self.main_window.get_widget("delete_wallpapers").set_sensitive(True) ++ self.builder.get_object("delete_wallpapers").set_sensitive(True) + self.delete_wallpapers_menu.set_sensitive(True) + else: +- self.main_window.get_widget("delete_wallpapers").set_sensitive(False) ++ self.builder.get_object("delete_wallpapers").set_sensitive(False) + self.delete_wallpapers_menu.set_sensitive(False) + + # parent node + else: +- self.main_window.get_widget("rename_workspace").set_sensitive(True) ++ self.builder.get_object("rename_workspace").set_sensitive(True) + self.rename_workspace_menu.set_sensitive(True) +- self.main_window.get_widget("change_wallpaper").set_sensitive(False) ++ self.builder.get_object("change_wallpaper").set_sensitive(False) + self.change_wallpaper_menu.set_sensitive(False) +- self.main_window.get_widget("cut").set_sensitive(False) ++ self.builder.get_object("cut").set_sensitive(False) + self.cut_menu.set_sensitive(False) +- self.main_window.get_widget("copy").set_sensitive(False) ++ self.builder.get_object("copy").set_sensitive(False) + self.copy_menu.set_sensitive(False) +- self.main_window.get_widget("delete_wallpapers").set_sensitive(False) ++ self.builder.get_object("delete_wallpapers").set_sensitive(False) + self.delete_wallpapers_menu.set_sensitive(False) + + filename = self.store.get_value(position_iter, 1) +@@ -1297,19 +1323,19 @@ class Wallpapoz: + # files' list (i.e. not pointing to desktop name) + if ( (type(self.store) == gtk.TreeStore) and + ( parent == None ) ): +- self.image_widget.clear() ++ self.image_widget.clear() + else: +- from glib import GError as glib_GError ++ from gi.repository.GLib import GError as glib_GError + try: +- anime = gtk.gdk.PixbufAnimation(filename) ++ anime = GdkPixbuf.PixbufAnimation.new_from_file(filename) + + if anime.is_static_image() : + im = Image.open(filename) + # keep image proportions + if im.size[0] > im.size[1]: +- self.image_widget.set_from_pixbuf(gtk.gdk.pixbuf_new_from_file_at_size(filename, 400, int((float(im.size[1])/im.size[0]) * 400))) ++ self.image_widget.set_from_pixbuf(GdkPixbuf.Pixbuf.new_from_file_at_size(filename, 400, int((float(im.size[1])/im.size[0]) * 400))) + else: +- self.image_widget.set_from_pixbuf(gtk.gdk.pixbuf_new_from_file_at_size(filename, int(float(im.size[1])/im.size[0] * 300), 300)) ++ self.image_widget.set_from_pixbuf(GdkPixbuf.Pixbuf.new_from_file_at_size(filename, int(float(im.size[1])/im.size[0] * 300), 300)) + + else: + width = anime.get_width() +@@ -1322,8 +1348,8 @@ class Wallpapoz: + + except IOError: + self.image_widget.clear() +- except glib_GError, (msg): +- print msg ++ except glib_GError as msg: ++ print (msg) + self.image_widget.clear() + + # display image filename diff --git a/wallpapoz-glade-builder-convert.sh b/wallpapoz-glade-builder-convert.sh new file mode 100644 index 0000000..57e0fab --- /dev/null +++ b/wallpapoz-glade-builder-convert.sh @@ -0,0 +1,27 @@ +#!/usr/bin/bash +set -x +set -e + +ORIG_XML=./share/wallpapoz/glade/wallpapoz.glade +NEWTOPDIR=wallpapoz-0.6.2-builder +DIR_XML=$(dirname $ORIG_XML) +BASE_XML=$(basename $ORIG_XML) + +mkdir -p $NEWTOPDIR/$DIR_XML || true + +cat ./src/wallpapoz | sed -n -e '\@gtk.glade.XML@s|^.*"\(.*\)".*$|\1|p' | while read item +do + SPLIT_ORIG_XML=${DIR_XML}/wallpapoz-old-${item}.glade + NEW_BUILDER_XML=${DIR_XML}/wallpapoz-builder-${item}.glade + + > $NEWTOPDIR/$SPLIT_ORIG_XML + head -n 5 $ORIG_XML >> $NEWTOPDIR/$SPLIT_ORIG_XML + cat $ORIG_XML | sed -n -e "\@^\$@p" >> $NEWTOPDIR/$SPLIT_ORIG_XML + echo >> $NEWTOPDIR/$SPLIT_ORIG_XML + tail -n -1 $ORIG_XML >> $NEWTOPDIR/$SPLIT_ORIG_XML + + gtk-builder-convert $NEWTOPDIR/$SPLIT_ORIG_XML $NEWTOPDIR/$NEW_BUILDER_XML + sed -i $NEWTOPDIR/$NEW_BUILDER_XML \ + -e "\@has_resize_grip@d" \ + -e "\@has_separator@d" +done diff --git a/wallpapoz.spec b/wallpapoz.spec index 4860005..02a5901 100644 --- a/wallpapoz.spec +++ b/wallpapoz.spec @@ -7,27 +7,35 @@ %define mainver 0.6.2 %undefine betaver -#%%define svnver svn92_trunk -%define fedorarel 4 +%define baserelease 20 -%define rel %{?betaver:0.}%{fedorarel}%{?svnver:.%svnver}%{?betaver:.%betaver} +%define rel %{?betaver:0.}%{baserelease}%{?betaver:.%betaver} Name: wallpapoz Version: %{mainver} Release: %{rel}%{?dist} Summary: Gnome Multi Backgrounds and Wallpapers Configuration Tool -Group: User Interface/Desktops -License: GPLv2+ +# GPL-2.0-or-later README +# GFDL-1.1-or-later share/gnome/help/wallpapoz/C/legal.xml +# SPDX confirmed +License: GPL-2.0-or-later AND GFDL-1.1-or-later + URL: http://vajrasky.wordpress.com/wallpapoz/ -Source0: https://github.com/downloads/vajrasky/wallpapoz/%{name}-%{mainver}%{?svnver:-%svnver}%{?betaver:%betaver}.tar.bz2 -%if 0%{?fedora} >= 12 +Source0: https://github.com/downloads/vajrasky/wallpapoz/%{name}-%{mainver}%{?betaver:%betaver}.tar.bz2 Source11: wallpapoz-autostart.desktop -%endif # Install daemon_wallpapoz wrapper script, which may # fix 584980, 597687? # and 711541 -Source12: daemon_wallpapoz-wrapper +Source12: daemon_wallpapoz-wrapper +# +# Glade XML converted to GTK builder script +# Source21: wallpapoz-0.6.2-builder.tar.bz2 +# Source21 is generated by the following script. +# Note that the following script uses "gtk-builder-convert" in gtk2-devel +# Now "gtk-builder-convert" is imported to python3, so don't use Source21 +Source22: wallpapoz-glade-builder-convert.sh +# # Misc fixes for daemon_wallpapoz under compiz working, # containing fix for bug 531342, 542244, bug 567437, bug 573642 Patch0: wallpapoz-0.6.1-workspace-num-respawn.patch @@ -77,27 +85,43 @@ Patch14: wallpapoz-0.6.2-wm-return-to-default.patch Patch15: wallpapoz-0.6.2-import-PIL-for-Image.patch # Support LXDE Patch16: wallpapoz-0.6.2-LXDE.patch +# Support MATE +# https://bugzilla.redhat.com/show_bug.cgi?id=1029554#c31 +# https://bugzilla.redhat.com/show_bug.cgi?id=1029554#c38 +Patch17: wallpapoz-0.6.2-MATE.patch +# Support CINNAMON +# https://bugzilla.redhat.com/show_bug.cgi?id=1029554#c44 +Patch18: wallpapoz-0.6.2-CINNAMON.patch +# Switch to python3 +Patch31: wallpapoz-0.6.2-python3.patch +# bug 1773214 and etc, various fixes for "desktop" type xml +Patch32: wallpapoz-0.6.2-python3-desktop-type.patch BuildArch: noarch BuildRequires: desktop-file-utils BuildRequires: gettext -BuildRequires: python-devel -BuildRequires: pygtk2-libglade -BuildRequires: python-imaging -BuildRequires: gnome-python2 +BuildRequires: gobject-introspection +BuildRequires: python3-devel +BuildRequires: python3-imaging +BuildRequires: gtk3 +BuildRequires: python3-gobject +BuildRequires: /usr/bin/gtk-builder-convert +#BuildRequires: gnome-python2 # See bug 456122 %if 0%{?fedora} >= 10 -BuildRequires: gnome-python2-gnome +#BuildRequires: gnome-python2-gnome %endif # Because wallpapoz uses gconftool-2 or so Requires: GConf2 -Requires: pygtk2-libglade -Requires: python-imaging -Requires: gnome-python2-gnome -Requires: xorg-x11-utils -Requires: %{_bindir}/kill -Requires: %{_bindir}/pgrep +Requires: gtk3 +Requires: gobject-introspection +Requires: python3-gobject +Requires: python3-imaging +#Requires: gnome-python2-gnome +Requires: xprop xwininfo +Requires: /usr/bin/kill +Requires: /usr/bin/pgrep %description This tool enables your Gnome desktop to have different @@ -105,25 +129,29 @@ wallpapers for different workspaces or virtual desktops. %prep %setup -q -n %{name}-%{version}%{?svnver:-%svnver} -%patch0 -p1 -b .respawn -%patch2 -p1 -b .dircheck -%patch3 -p1 -b .noitem -%patch4 -p1 -b .patch_init -%patch5 -p1 -b .kill_nox -%patch6 -p1 -b .kill_multi -%patch7 -p1 -b .anime -%patch8 -p1 -b .nonutf8 -%patch9 -p1 -b .deletelastone -%patch10 -p1 -b .deletefirst -%patch12 -p1 -b .workspace_img -%patch13 -p1 -b .workspace_num_incr -%patch14 -p1 -b .default -%patch15 -p1 -b .pil -%patch16 -p1 -b .LXDE +%patch -P0 -p1 -b .respawn +%patch -P2 -p1 -b .dircheck +%patch -P3 -p1 -b .noitem +%patch -P4 -p1 -b .patch_init +%patch -P5 -p1 -b .kill_nox +%patch -P6 -p1 -b .kill_multi +%patch -P7 -p1 -b .anime +%patch -P8 -p1 -b .nonutf8 +%patch -P9 -p1 -b .deletelastone +%patch -P10 -p1 -b .deletefirst +%patch -P12 -p1 -b .workspace_img +%patch -P13 -p1 -b .workspace_num_incr +%patch -P14 -p1 -b .default +%patch -P15 -p1 -b .pil +%patch -P16 -p1 -b .LXDE +%patch -P17 -p1 -b .MATE +%patch -P18 -p1 -b .CINNAMON -# Umm... permission fix -find . -type f -print0 | xargs -0 chmod 0644 -grep -rl --null '#!/usr/bin' . | xargs -0 chmod 0755 +grep -rl --null '/usr/bin/env python$' . | \ + xargs --null sed -i -e 's|/usr/bin/env python|/usr/bin/python2|' + +%patch -P31 -p1 -b .py3 +%patch -P32 -p1 -b .py3.desktop # For setup mkdir TMPBINDIR @@ -135,29 +163,29 @@ popd ln -sf c share/gnome/help/wallpapoz/C %build +bash %{SOURCE22} +find . -type f -print0 | xargs -0 chmod 0644 +grep -rl --null '#!/usr/bin' . | xargs -0 chmod 0755 %install %{__rm} -rf $RPM_BUILD_ROOT %{__mkdir_p} $RPM_BUILD_ROOT%{_prefix} export PATH=$(pwd)/TMPBINDIR:$PATH -%{__python} setup.py install --installdir=$RPM_BUILD_ROOT%{_prefix} +%{__python3} setup.py install --installdir=$RPM_BUILD_ROOT%{_prefix} %{__sed} -i -e 's|%{name}\.png|%{name}|' \ $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop desktop-file-install \ - --vendor fedora \ --dir $RPM_BUILD_ROOT%{_datadir}/applications \ --delete-original \ $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop # Install desktop application autostart stuff -%if 0%{?fedora} >= 12 %{__mkdir_p} ${RPM_BUILD_ROOT}%{_sysconfdir}/xdg/autostart desktop-file-install \ --dir ${RPM_BUILD_ROOT}%{_sysconfdir}/xdg/autostart \ %{SOURCE11} -%endif # Install daemon_wallpapoz wrapper script pushd ${RPM_BUILD_ROOT} @@ -169,28 +197,136 @@ popd # is not needed rm -f ${RPM_BUILD_ROOT}%{_bindir}/launcher_wallpapoz.sh +# Manually install the following +install -cpm 0644 \ + wallpapoz-*/share/wallpapoz/glade/*builder*glade \ + %{buildroot}%{_datadir}/%{name}/glade/ + %{find_lang} %{name} -%clean -%{__rm} -rf $RPM_BUILD_ROOT - %files -f %{name}.lang -%defattr(-,root,root,-) -%doc COPYING README -%{_bindir}/*%{name} +%license COPYING +%doc README +%{_bindir}/%{name} +%{_bindir}/daemon_wallpapoz %{_libexecdir}/daemon_wallpapoz -%if 0%{?fedora} >= 12 %{_sysconfdir}/xdg/autostart/wallpapoz-autostart.desktop -%endif -%{_datadir}/%{name}/ +%dir %{_datadir}/%{name}/ +%{_datadir}/%{name}/glade/ +%{_datadir}/%{name}/lib/ %{_datadir}/gnome/help/%{name}/ %{_datadir}/pixmaps/%{name}.png -%{_datadir}/applications/fedora-%{name}.desktop +%{_datadir}/applications/*%{name}.desktop %changelog +* Sat Nov 08 2025 Mamoru TASAKA - 0.6.2-20 +- Add dep for gobject-introspection explicitly + +* Fri Jul 25 2025 Fedora Release Engineering - 0.6.2-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Sun Jan 19 2025 Fedora Release Engineering - 0.6.2-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Sat Jul 20 2024 Fedora Release Engineering - 0.6.2-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Sat Jan 27 2024 Fedora Release Engineering - 0.6.2-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Tue Nov 21 2023 Mamoru TASAKA - 0.6.2-15 +- Clean up release number and some spec file stuff +- SPDX migration + +* Sat Jul 22 2023 Mamoru TASAKA - 0.6.2-14.3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Sat Jan 21 2023 Fedora Release Engineering - 0.6.2-13.3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sat Jul 23 2022 Fedora Release Engineering - 0.6.2-13.2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Sat Jan 22 2022 Fedora Release Engineering - 0.6.2-13.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Nov 5 2021 Mamoru TASAKA - 0.6.2-13 +- Use python3-ported gtk-builder-convert in build time instead of + glade files generated preliminarily + +* Fri Jul 23 2021 Fedora Release Engineering - 0.6.2-12.3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Jan 27 2021 Fedora Release Engineering - 0.6.2-12.2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jul 28 2020 Adam Jackson - 0.6.2-12.1 +- Require xprop xwininfo, not xorg-x11-utils + +* Fri Jan 31 2020 Fedora Release Engineering - 0.6.2-11.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Nov 28 2019 Mamoru TASAKA - 0.6.2-11 +- bug 1773214 and etc, various fixes for "desktop" type xml + +* Mon Sep 2 2019 Mamoru TASAKA - 0.6.2-10 +- Switch to python3 + +* Sun Sep 1 2019 Mamoru TASAKA - 0.6.2-8.1 +- Escape white spaces in wallpaper name properly + +* Fri Aug 23 2019 Mamoru TASAKA - 0.6.2-9 +- F-31+: Drop gnome-python2-gnome dependency for now + +* Sat Jul 27 2019 Fedora Release Engineering - 0.6.2-8.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Mon Feb 4 2019 Mamoru TASAKA - 0.6.2-8 +- Use python2 explicitly + +* Sun Feb 03 2019 Fedora Release Engineering - 0.6.2-7.9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 0.6.2-7.8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Feb 28 2018 Iryna Shcherbina - 0.6.2-7.7 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Fri Feb 09 2018 Fedora Release Engineering - 0.6.2-7.6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 0.6.2-7.5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 0.6.2-7.4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Fri Feb 05 2016 Fedora Release Engineering - 0.6.2-7.3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Fri Jun 19 2015 Fedora Release Engineering - 0.6.2-7.2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sun Jun 08 2014 Fedora Release Engineering - 0.6.2-7.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Thu Dec 12 2013 Mamoru TASAKA - 0.6.2-7 +- Support CINNAMON (bug 1029554, leigh scott) + +* Wed Nov 27 2013 Mamoru TASAKA - 0.6.2-6 +- Support MATE (bug 1029554, leigh scott, Wolfgang Ulbrich) + +* Sun Aug 04 2013 Fedora Release Engineering - 0.6.2-5.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Sat Feb 9 2013 Mamoru TASAKA - 0.6.2-5 +- F-19: kill vendorization of desktop file (fpc#247) + * Sat Jan 19 2013 Mamoru TASAKA - 0.6.2-4 - Support LXDE