check: Clean up the soft dependencies constants mess

This file is meant to make the packagers' job easier,
so it must be as legible as possible.
parent a5105137
......@@ -288,16 +288,10 @@ ges_1_5.check()
if not ges_1_5.satisfied:
HARD_DEPENDENCIES.append(GstPluginDependency("gnonlin", "1.4.0"))
PYCANBERRA_SOFT_DEPENDENCY = ClassicDependency("pycanberra", None,
_("enables sound notifications when rendering is complete"))
GNOMEDESKTOP_SOFT_DEPENDENCY = GIDependency("GnomeDesktop", None,
_("file thumbnails provided by GNOME's thumbnailers"))
NOTIFY_SOFT_DEPENDENCY = GIDependency("Notify", None,
_("enables visual notifications when rendering is complete"))
LIBAV_SOFT_DEPENDENCY = GstPluginDependency("libav", None,
_("additional multimedia codecs through the GStreamer Libav library"))
SOFT_DEPENDENCIES = (PYCANBERRA_SOFT_DEPENDENCY,
GNOMEDESKTOP_SOFT_DEPENDENCY,
NOTIFY_SOFT_DEPENDENCY,
LIBAV_SOFT_DEPENDENCY)
SOFT_DEPENDENCIES = \
(
ClassicDependency("pycanberra", None, _("enables sound notifications when rendering is complete")),
GIDependency("GnomeDesktop", None, _("file thumbnails provided by GNOME's thumbnailers")),
GIDependency("Notify", None, _("enables visual notifications when rendering is complete")),
GstPluginDependency("libav", None, _("additional multimedia codecs through the GStreamer Libav library")),
)
......@@ -42,7 +42,7 @@ from urllib.parse import urlparse
from hashlib import md5
from gi.repository.GstPbutils import DiscovererVideoInfo
from pitivi.check import GNOMEDESKTOP_SOFT_DEPENDENCY
from pitivi.check import missing_soft_deps
from pitivi.configure import get_ui_dir, get_pixmap_dir
from pitivi.settings import GlobalSettings
from pitivi.mediafilespreviewer import PreviewWidget
......@@ -297,7 +297,7 @@ class MediaLibraryWidget(Gtk.VBox, Loggable):
@staticmethod
def _getThumbnailer():
if not GNOMEDESKTOP_SOFT_DEPENDENCY:
if "GnomeDesktop" in missing_soft_deps:
return None
from gi.repository import GnomeDesktop
# We need to instanciate the thumbnail factory on the main thread...
......
......@@ -38,7 +38,7 @@ from gettext import gettext as _
from pitivi import configure
from pitivi.check import PYCANBERRA_SOFT_DEPENDENCY
from pitivi.check import missing_soft_deps
from pitivi.utils.loggable import Loggable
from pitivi.utils.misc import show_user_manual, path_from_uri
from pitivi.utils.ripple_update_group import RippleUpdateGroup
......@@ -870,7 +870,7 @@ class RenderDialog(Loggable):
@staticmethod
def _maybePlayFinishedSound():
if not PYCANBERRA_SOFT_DEPENDENCY:
if "pycanberra" in missing_soft_deps:
return
import pycanberra
canberra = pycanberra.Canberra()
......
......@@ -25,7 +25,7 @@ import resource
from gi.repository import GObject
from pitivi.check import NOTIFY_SOFT_DEPENDENCY
from pitivi.check import missing_soft_deps
from pitivi.configure import APPNAME
from pitivi.utils.loggable import Loggable
......@@ -170,7 +170,7 @@ class FreedesktopOrgSystem(System):
def __init__(self):
System.__init__(self)
if NOTIFY_SOFT_DEPENDENCY:
if "Notify" not in missing_soft_deps:
from gi.repository import Notify
Notify.init(APPNAME)
......@@ -178,7 +178,7 @@ class FreedesktopOrgSystem(System):
# Call super method for consistent logging
System.desktopMessage(self, title, message, icon)
if NOTIFY_SOFT_DEPENDENCY:
if "Notify" not in missing_soft_deps:
from gi.repository import Notify
notification = Notify.Notification.new(title, message, icon=icon)
try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment