Compare commits

...

3 Commits

Author SHA1 Message Date
Tero Paloheimo c60cc43e4c
Merge d1eadd380d into 766e9a9795 2024-02-19 08:10:36 -07:00
Сергій 766e9a9795
Translated using Weblate (Ukrainian)
Currently translated at 100.0% (116 of 116 strings)

Translation: Safe Eyes/Translations
Translate-URL: https://hosted.weblate.org/projects/safe-eyes/translations/uk/
2024-02-15 14:01:56 +01:00
Tero Paloheimo d1eadd380d Remove use of distutils
As of Python 3.12 setuptools is no longer installed by default and
if setuptools is not installed distutils is not found and SafeEyes
fails to start.

Furthermore distutils is deprecated and should thus not be used
anymore. The packaging module provides a replacement for LooseVersion
and it is added in this commit.
2023-12-30 19:42:32 +02:00
4 changed files with 13 additions and 11 deletions

View File

@ -6,17 +6,17 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2021-08-18 00:37+0000\n"
"Last-Translator: Tymofii Lytvynenko <till.svit@gmail.com>\n"
"PO-Revision-Date: 2024-02-15 13:01+0000\n"
"Last-Translator: Сергій <sergiy.goncharuk.1@gmail.com>\n"
"Language-Team: Ukrainian <https://hosted.weblate.org/projects/safe-eyes/"
"translations/uk/>\n"
"Language: uk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 4.8-dev\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 5.4-dev\n"
# Short break
msgid "Tightly close your eyes"
@ -48,7 +48,7 @@ msgstr "Випийте води"
# Long break
msgid "Walk for a while"
msgstr "Трохи походіть"
msgstr "Прогуляйтесь"
# Long break
msgid "Lean back at your seat and relax"
@ -289,7 +289,7 @@ msgstr "Нова перерва"
# Settings dialog
msgid "Remove"
msgstr "Видалити"
msgstr "Вилучити"
# Settings dialog
msgid "Discard"

View File

@ -22,9 +22,10 @@ This module contains the entity classes used by Safe Eyes and its plugins.
import logging
import random
from distutils.version import LooseVersion
from enum import Enum
from packaging.version import parse
from safeeyes import utility
@ -323,7 +324,7 @@ class Config:
else:
user_config_version = str(
meta_obj.get('config_version', '0.0.0'))
if LooseVersion(user_config_version) != LooseVersion(system_config_version):
if parse(user_config_version) != parse(system_config_version):
# Update the user config
self.__merge_dictionary(
self.__user_config, self.__system_config)

View File

@ -32,7 +32,6 @@ import sys
import shutil
import subprocess
import threading
from distutils.version import LooseVersion
from logging.handlers import RotatingFileHandler
from pathlib import Path
@ -43,6 +42,7 @@ gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from gi.repository import GLib
from gi.repository import GdkPixbuf
from packaging.version import parse
gi.require_version('Gdk', '3.0')
@ -559,7 +559,7 @@ def __update_plugin_config(plugin, plugin_config, config):
if plugin_config is None:
config['plugins'].remove(plugin)
else:
if LooseVersion(plugin.get('version', '0.0.0')) != LooseVersion(plugin_config['meta']['version']):
if parse(plugin.get('version', '0.0.0')) != parse(plugin_config['meta']['version']):
# Update the configuration
plugin['version'] = plugin_config['meta']['version']
setting_ids = []

View File

@ -8,6 +8,7 @@ requires = [
'psutil',
'croniter',
'PyGObject',
'packaging',
'python-xlib'
]