Skip to content

Commit

Permalink
Merge branch 'v0.5.8-dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
milouse committed Jan 12, 2022
2 parents 9630456 + 56d42a8 commit aa131ac
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion chwall/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.7"
__version__ = "0.5.8"
9 changes: 7 additions & 2 deletions chwall/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ def daemon_loop():
pid_file = "{}/chwall_pid".format(BASE_CACHE_PATH)
if os.path.isfile(pid_file):
os.unlink(pid_file)
# Try to keep cache as clean as possible
cleanup_cache()
if error_code == 0:
logger.info("Kthxbye!")
return error_code
Expand Down Expand Up @@ -242,6 +240,13 @@ def start_daemon():
f.write(str(os.getpid()))
logger.info(_("Starting Chwall Daemon v{version}…")
.format(version=__version__))
# Try to keep cache as clean as possible
deleted = cleanup_cache()
logger.info(gettext.ngettext(
"{number} cache entry has been removed.",
"{number} cache entries have been removed.",
deleted
).format(number=deleted))
sys.exit(daemon_loop())


Expand Down
2 changes: 1 addition & 1 deletion chwall/fetcher/muzei.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def fetch_pictures(config):
today = datetime.date.today()
year = today.year
month = today.month - 1
if month == -1:
if month == 0:
month = 12
year -= 1
# We get the last month meta file to have enough wallpaper to show (~30).
Expand Down
1 change: 1 addition & 0 deletions chwall/fetcher/natgeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def fetch_pictures(config):
month_idx = t.month - 2
if month_idx == -1:
month_idx = 11
year -= 1
month = month_label[month_idx]
final_uri = "https://www.nationalgeographic.co.uk/page-data/" \
f"photo-of-the-day/{year}/{month}/page-data.json"
Expand Down
8 changes: 7 additions & 1 deletion chwall/gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ def _build_translations_for_desktop_file(localedir):
"comment": [],
"next_name": [],
"previous_name": [],
"favorite_name": [],
"blacklist_name": []
}
for lng in sorted(os.listdir(localedir)):
Expand Down Expand Up @@ -280,6 +281,10 @@ def _build_translations_for_desktop_file(localedir):
"Name[{lang}]={key}".format(
lang=lng,
key=_("Previous wallpaper")))
lng_attrs["favorite_name"].append(
"Name[{lang}]={key}".format(
lang=lng,
key=_("Save as favorite")))
lng_attrs["blacklist_name"].append(
"Name[{lang}]={key}".format(
lang=lng,
Expand Down Expand Up @@ -316,11 +321,12 @@ def generate_desktop_file(localedir="./locale", out="chwall-app.desktop"):
Type=Application
Categories=GTK;GNOME;Utility;
StartupNotify=false
Actions=Next;Previous;Blacklist;
Actions=Next;Previous;Favorite;Blacklist;
""".format(app_exec=get_binary_path("app", "xdg"))

actions = _build_action_block("next", lng_attrs) \
+ _build_action_block("previous", lng_attrs) \
+ _build_action_block("favorite", lng_attrs) \
+ _build_action_block("blacklist", lng_attrs)
df_content += "\n".join(actions)

Expand Down
2 changes: 1 addition & 1 deletion chwall/gui/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def make_general_pane(self):
adj=Gtk.Adjustment(sleep_time, 5, 120, 1), factor=60)
genbox.pack_start(prefbox, False, False, 0)

environments = [("gnome", "Gnome, Budgie, …"),
environments = [("gnome", "Gnome, Pantheon, Budgie, …"),
("mate", "Mate"), ("xfce", "XFCE"),
("nitrogen", _("Use Nitrogen application"))]
prefbox = self.make_select_pref(
Expand Down
2 changes: 0 additions & 2 deletions chwall/gui/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class ChwallGui:
def __init__(self):
self.app = None
self.reload_config()
# Try to keep cache as clean as possible
cleanup_cache()

def reload_config(self):
self.config = read_config()
Expand Down
2 changes: 1 addition & 1 deletion chwall/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def xdg_autostart_file(self, component, app_name, app_desc, write=False):
elif component == "icon":
file_content += """\
X-GNOME-Autostart-enabled=false
NotShowIn=GNOME
NotShowIn=GNOME;Pantheon;
Categories=GTK;TrayIcon;Utility;
"""
if write is False:
Expand Down
4 changes: 2 additions & 2 deletions locale/es/LC_MESSAGES/chwall.po
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Chwall Translation Effort
# Copyright (C) 2021 Chwall volunteers
# Copyright (C) 2022 Chwall volunteers
# This file is distributed under the same license as the Chwall package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Chwall 0.5.7\n"
"Project-Id-Version: Chwall 0.5.8\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-07-16 14:13+0200\n"
"PO-Revision-Date: 2020-05-02 12:28+0000\n"
Expand Down
4 changes: 2 additions & 2 deletions locale/fr/LC_MESSAGES/chwall.po
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Chwall Translation Effort
# Copyright (C) 2021 Chwall volunteers
# Copyright (C) 2022 Chwall volunteers
# This file is distributed under the same license as the Chwall package.
# Automatically generated, 2019.
#
msgid ""
msgstr ""
"Project-Id-Version: Chwall 0.5.7\n"
"Project-Id-Version: Chwall 0.5.8\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-07-16 14:13+0200\n"
"PO-Revision-Date: 2021-07-16 14:08+0200\n"
Expand Down

0 comments on commit aa131ac

Please sign in to comment.