changeset 11:c01d7edb9cb9

bing4desktop-0.240206-0
author prymula <prymula76@outlook.com>
date Tue, 06 Feb 2024 11:58:47 +0100
parents ed9556d0c5d7
children 74d743cf58cb
files bing4desktop/Changelog.txt bing4desktop/DEBIAN/bing4desktop.dsc bing4desktop/DEBIAN/debian.changelog bing4desktop/DEBIAN/debian.control bing4desktop/DEBIAN/debian.rules bing4desktop/DEBIAN/format.sh bing4desktop/Makefile bing4desktop/PKG/PKGBUILD bing4desktop/RPM/bing4desktop.spec bing4desktop/bing4desktop.py
diffstat 10 files changed, 105 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/bing4desktop/Changelog.txt	Tue Feb 06 00:30:36 2024 +0100
+++ b/bing4desktop/Changelog.txt	Tue Feb 06 11:58:47 2024 +0100
@@ -1,3 +1,4 @@
+0.240206-0 - Miał być przełom a skończyło się na kosmetyce
 0.240205-4 - Przetwarzanie zdjęć w katalogu tymczasowym, buildy dla Arch, Fedory i Thumbleweed
 0.240205-3 - Wyświetla zdjęcia (jednak w osobnych oknach), oraz ustawia je jako tapetę, pisze informacje o zdjęciu
 0.240205-2 - Niszczenie frame i odtworzenie, jednak bez zadowalajacych efektów
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bing4desktop/DEBIAN/bing4desktop.dsc	Tue Feb 06 11:58:47 2024 +0100
@@ -0,0 +1,41 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
+Format: 1.0
+Source: bing4desktop
+Binary: bing4desktop
+Architecture: all
+Version: 0.240206-0
+Maintainer: Przemysław R. Pietraszczyk <prymula76@outlook.com>
+Homepage: http://prymula.ct8.pl
+
+DEBTRANSFORM-TAR: bing4desktop-0.240206-0.tar.gz
+ 
+Standards-Version: 5.6.2.0
+Build-Depends: debhelper-compat (>= 12), python3-all, dh-python, python3-pillow, python3-requests,  distutils, fakeroot
+Package-List:
+ verysimpleslideshow deb x11 optional arch=all
+Files:
+ b31649bc23b2b7bca9ab70ea3410711a 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7GYYUL/Azw43QucWPnXr
+uw==
+=+lfH
+-----END PGP SIGNATURE-----
--- a/bing4desktop/DEBIAN/debian.changelog	Tue Feb 06 00:30:36 2024 +0100
+++ b/bing4desktop/DEBIAN/debian.changelog	Tue Feb 06 11:58:47 2024 +0100
@@ -1,18 +1,5 @@
-verysimpleslideshow (0.230909-1) unstable; urgency=low
+bing4desktop (0.240206-0) unstable; urgency=low
 
   * Last release
 
- -- Przemysław R. Pietraszczyk  Thu, 09 Sep 2023 22:47:00 +0200
-
-
-verysimpleslideshow (0.230907-0) unstable; urgency=low
-
-  * Last release
-
- -- Przemysław R. Pietraszczyk  Thu, 07 Sep 2023 19:30:00 +0200
-
-verysimpleslideshow (0.230903-3) unstable; urgency=low
-
-  * Last release
-
- -- Przemysław R. Pietraszczyk  Sun, 03 Sep 2023 21:21:21 +0200
+ -- Przemysław R. Pietraszczyk  Thu, 6 Feb 2024 10:50:00 +0200
--- a/bing4desktop/DEBIAN/debian.control	Tue Feb 06 00:30:36 2024 +0100
+++ b/bing4desktop/DEBIAN/debian.control	Tue Feb 06 11:58:47 2024 +0100
@@ -1,13 +1,13 @@
-Source: verysimpleslideshow
+Source: bing4desktop
 Section: python
 Priority: extra
 Maintainer: Przemysław R. Pietraszczyk
-Build-Depends: debhelper-compat (= 12), python3-all, dh-python, python3-pil, fakeroot
+Build-Depends: debhelper-compat (>= 12), python3-all, dh-python, python3-pillow, python3-requests,  distutils, fkeroot
 Standards-Version: 3.9.6
 Homepage: http://prymula.ct8.pl
 
 
-Package: verysimpleslideshow
+Package: bing4desktop
 Architecture: all
-Depends: ${misc:Depends}, python3-all, python3-pil, ffmpeg
+Depends: ${misc:Depends}, python3-all, python3-pillow, python3-requests
 Description: CLI script for creating slideshows 
--- a/bing4desktop/DEBIAN/debian.rules	Tue Feb 06 00:30:36 2024 +0100
+++ b/bing4desktop/DEBIAN/debian.rules	Tue Feb 06 11:58:47 2024 +0100
@@ -12,12 +12,12 @@
 	@
 
 binary:
-	mkdir -pm 0755 debian/verysimpleslideshow
-	mkdir -pm 0755 debian/verysimpleslideshow/usr/bin
-	mkdir -pm 0755 debian/verysimpleslideshow/usr/share
-	mkdir -pm 0755 debian/verysimpleslideshow/usr/share/verysimpleslideshow
-	cp verysimpleslideshow.py debian/verysimpleslideshow/usr/bin/
-	cp CzytajTo debian/verysimpleslideshow/usr/share/verysimpleslideshow/
-	#chmod 0755 /usr/bin/verysimpleslideshow.py
+	mkdir -pm 0755 debian/bing4desktop
+	mkdir -pm 0755 debian/bing4desktop/usr/bin
+	mkdir -pm 0755 debian/bing4desktop/usr/share/bing4desktop
+	mkdir -pm 0755 debian/bing4desktop/etc/xdg/autostart
+	cp bing4desktop.py debian/bing4desktop/usr/bin/
+	cp bing.ico debian/bing4desktop/usr/share/bing4desktop/
+	cp bing4desktop.desktop debian/bing4desktop/etc/xdg/autostart
 	dh_gencontrol
 	dh_builddeb
--- a/bing4desktop/DEBIAN/format.sh	Tue Feb 06 00:30:36 2024 +0100
+++ b/bing4desktop/DEBIAN/format.sh	Tue Feb 06 11:58:47 2024 +0100
@@ -1,2 +1,2 @@
 mkdir exec
-exec /usr/lib/build/debtransform ./ ./verysimpleslideshow.dsc ./exec
+exec /usr/lib/build/debtransform ./ ./bing4desktop.dsc ./exec
--- a/bing4desktop/Makefile	Tue Feb 06 00:30:36 2024 +0100
+++ b/bing4desktop/Makefile	Tue Feb 06 11:58:47 2024 +0100
@@ -6,5 +6,12 @@
 	mkdir -pm 0755 $(DESTDIR)/etc/xdg/autostart
 	install -m 0755 bing4desktop.py $(DESTDIR)$(prefix)/bin
 	install -m 0644 bing.ico $(DESTDIR)$(prefix)/share/bing4desktop
-	install -m 0755 bing4desktop.desktop $(DESTDIR)/etc/xdg/autostart
+	install -m 0644 bing4desktop.desktop $(DESTDIR)/etc/xdg/autostart
 .PHONY: install
+
+uninstall:
+	rm $(prefix)/bin/bing4desktop.py
+	rm $(prefix)/share/bing4desktop/bing.ico
+	rm /etc/xdg/autostart/bing4desktop.desktop
+	rmdir $(prefix)/share/bing4desktop/
+.PHONY: uninstall
--- a/bing4desktop/PKG/PKGBUILD	Tue Feb 06 00:30:36 2024 +0100
+++ b/bing4desktop/PKG/PKGBUILD	Tue Feb 06 11:58:47 2024 +0100
@@ -1,8 +1,8 @@
 # Maintainer: Przemyslaw R. Pietraszczyk <prymula76@outlook.com>
 
-pkgname=verysimpleslideshow
-pkgver=0.240205
-pkgrel=4
+pkgname=bing4desktop
+pkgver=0.240206
+pkgrel=0
 pkgdesc="Beautify your desktop with photos from Bing search engine"
 arch=('any')
 url="prymula.ct8.pl"
@@ -13,7 +13,7 @@
 makedepends=('python' 'python-pillow' 'python-requests')
 source=(${pkgname}-${pkgver}-${pkgrel}.tar.gz)
 noextract=()
-sha256sums=('f9b22dc950b1ac543f0daf8e2620b27d9c2a2064e9d41eaca7085e8a3b35d312') #generate with 'makepkg -g' || sha256sum
+sha256sums=('a33af8e09868dcec11bee8a27067b6955884abbb2598ab15ad155c116dc89f4e') #generate with 'makepkg -g' || sha256sum
 
 #build() {
 	#cd "$srcdir/${pkgname}-${pkgver}-${pkgrel}"
@@ -22,5 +22,5 @@
 
 package() {
 	cd "$srcdir/${pkgname}-${pkgver}-${pkgrel}"
-	make DESTDIR="${pkgdir}" install
+	make DESTDIR="${pkgdir}" prefix=/usr install
 }
--- a/bing4desktop/RPM/bing4desktop.spec	Tue Feb 06 00:30:36 2024 +0100
+++ b/bing4desktop/RPM/bing4desktop.spec	Tue Feb 06 11:58:47 2024 +0100
@@ -15,10 +15,10 @@
 # Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
-%define unmangled_version 0.240205-4
+%define unmangled_version 0.240206-0
 Name:       bing4desktop
-Version:	0.240205
-Release:    4
+Version:	0.240206
+Release:    0
 Summary:	Beautify your desktop with photos from Bing search engine
 License:	Public Domain
 URL:		https://prymula.ct8.pl
--- a/bing4desktop/bing4desktop.py	Tue Feb 06 00:30:36 2024 +0100
+++ b/bing4desktop/bing4desktop.py	Tue Feb 06 11:58:47 2024 +0100
@@ -20,22 +20,22 @@
 import json
 import tempfile
 import shutil
+import glob
 
-ver = "0.240205-4"
+ver = "0.240206-0"
 
 BING_URI_BASE = "http://www.bing.com"
-BING_WALLPAPER_PATH = "/HPImageArchive.aspx?format=js&idx=50&n=1&mkt=en-US"
+BING_WALLPAPER_PATH = "/HPImageArchive.aspx?format=js&idx=1&n=1&mkt=en-US"
 full_path=""
 actualImage = -1
 COPYRIGHT_TXT = ""
+TITLE = ""
 
 tmp_path =  tempfile.mkdtemp()
 
-
-
 class WPaper:
     def get(self):
-        global full_path, COPYRIGHT_TXT
+        global full_path, COPYRIGHT_TXT, TITLE
         # open the Bing HPImageArchive URI and ask for a JSON response
         resp = requests.get(BING_URI_BASE + BING_WALLPAPER_PATH)
 
@@ -43,6 +43,8 @@
             json_response = json.loads(resp.content)
             wallpaper_path = json_response['images'][0]['url']
             COPYRIGHT_TXT = json_response['images'][0]['copyright']
+            TITLE = json_response['images'][0]['title']
+
             filename = wallpaper_path.split('/')[-1]
             wallpaper_uri = BING_URI_BASE + wallpaper_path
             filename_short = filename.split('&')
@@ -173,16 +175,28 @@
 
 
 class Gui():
-    global COPYRIGHT_TXT
+    global COPYRIGHT_TXT, TITLE
     
     def __init__(self):
         self.window = tk.Tk()
-        self.image =  Image.open("bing.ico")
+        self.image = None
+        for ico in ['./bing.ico', '/usr/share/bing4desktop/bing.ico']:
+            try:
+                self.image =  Image.open(ico)
+            except FileNotFoundError as fs:
+                print ('W bieżącym katalogu, brak ikony, ', fs)
+            finally:
+                break
+                
+            #if self.image != None:
+            #   break
+            
+        self.tmp = None
         self.menu = (
             item("Ustaw Tapetę", lambda icon, item: wp.set(full_path, True)),
             item('Tapeta poprzednia', lambda icon, item: self.change_pic(1)),
             item('Tapeta następna', lambda icon, item: self.change_pic(-1)),
-            item('Opis zdjęcia', lambda icon, item: icon.notify(COPYRIGHT_TXT)),
+            item('Opis zdjęcia', lambda icon, item: icon.notify(TITLE + ' --- ' + COPYRIGHT_TXT)),
             item('O Programie', lambda icon, item: self.about()),
 
             item('Wyjdź', self.quit_window)
@@ -204,7 +218,6 @@
         self.window.destroy()
         self.window.update()
 
-   
     def change_pic(self, n):
         global actualImage, BING_WALLPAPER_PATH
         BASE = "/HPImageArchive.aspx?format=js&idx="
@@ -216,8 +229,6 @@
         elif (actualImage > 10):
              actualImage = 0
              
-        print ("FULL: ", len(full_path))
-        
         wp=WPaper()
         if wp.get():
             BING_WALLPAPER_PATH = BASE+str(actualImage)+OFF
@@ -225,21 +236,28 @@
                 cleanup()
                 exit
             
+            # Wszystko pięknie tylko metoda 'show', zmienia nazwę pliku przechowywanego w TMP
+            # Pozatym nie ubija a nie znalazłem nic lepszego
+            print ("GLOB: ", glob.glob( os.path.join('/tmp', '*.PNG')))
+            for infile in glob.glob( os.path.join('/tmp', '*.PNG')):
+                print ("INFILE: ", infile)
+                viewer = subprocess.Popen(['/usr/bin/eom', infile])
+                viewer.terminate()
+                viewer.kill()  # make sure the viewer is gone; not needed on Windows  
+                
             img = Image.open(full_path) #.convert('RGBA')  # PIL solution
-            tmp = img.resize((600, 400), None, None, 3.0)
-            tmp.show()
+            self.tmp = img.resize((600, 400), None, None, 3.0)
+            self.tmp.show()
 
     def quit_window(self):
         self.icon.stop()
         self.window.destroy()
 
-
     def show_window(self):
         self.icon.stop()
         self.window.protocol('WM_DELETE_WINDOW', self.withdraw_window)
         self.window.after(0, self.window.deiconify)
 
-
     def withdraw_window(self):
         self.window.withdraw()
         self.icon = pystray.Icon("name", self.image, "title", self.menu)