diff bing4desktop/bing4desktop.py @ 17:3b8fd6a7f2d0

bing4desktop-0.240207-2
author prymula <prymula76@outlook.com>
date Wed, 07 Feb 2024 12:11:34 +0100
parents 2dea5bff9c0c
children e7a6488c02b7
line wrap: on
line diff
--- a/bing4desktop/bing4desktop.py	Tue Feb 06 20:03:52 2024 +0100
+++ b/bing4desktop/bing4desktop.py	Wed Feb 07 12:11:34 2024 +0100
@@ -22,14 +22,16 @@
 import shutil
 import glob
 
-ver = "0.240206-4"
+ver = "0.240207-2"
 
 BING_URI_BASE = "http://www.bing.com"
 BING_WALLPAPER_PATH = "/HPImageArchive.aspx?format=js&idx=1&n=1&mkt=en-US"
 full_path=""
-actualImage = -1
+actualImage = 1
 COPYRIGHT_TXT = ""
 TITLE = ""
+TMP_COPYRIGHT = ""
+TMP_TITLE = ""
 
 tmp_path =  tempfile.mkdtemp()
 
@@ -72,9 +74,12 @@
         return True
         
     def set(self,file_loc, first_run):
-        global full_path
+        global full_path, TMP_COPYRIGHT, COPYRIGHT_TXT, TMP_TITLE, TITLE
         desktop_env = os.environ.get('DESKTOP_SESSION')
 
+        TMP_COPYRIGHT = COPYRIGHT_TXT
+        TMP_TITLE = TITLE
+
         if len(full_path) == 0:
             messagebox.showinfo("Błąd","Niewybrano obrazu, najpierw wybierz obraz")
             return
@@ -175,7 +180,7 @@
 
 
 class Gui():
-    global COPYRIGHT_TXT, TITLE
+    global TMP_COPYRIGHT, TMP_TITLE
     
     def __init__(self):
         self.window = tk.Tk()
@@ -194,7 +199,7 @@
             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(TITLE + ' --- ' + COPYRIGHT_TXT)),
+            item('Opis zdjęcia', lambda icon, item: icon.notify(TMP_TITLE + ' --- ' + TMP_COPYRIGHT)),
             item('O Programie', lambda icon, item: self.about()),
 
             item('Wyjdź', self.quit_window)
@@ -220,11 +225,11 @@
         global actualImage, BING_WALLPAPER_PATH
         BASE = "/HPImageArchive.aspx?format=js&idx="
         OFF = "&n=1&mkt=en-US"
-
+        
         actualImage = actualImage + n;
         if (actualImage < 0):
-             actualImage = 10
-        elif (actualImage > 10):
+             actualImage = 7
+        elif (actualImage > 7):
              actualImage = 0
              
         wp=WPaper()