Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
lutris / usr / lib / python3 / dist-packages / lutris / gui / widgets / notifications.py
Size: Mime:
# Third Party Libraries
import gi

# Lutris Modules
from lutris.util.log import logger

NOTIFY_SUPPORT = True
try:
    gi.require_version('Notify', '0.7')
    from gi.repository import Notify
except ImportError:
    NOTIFY_SUPPORT = False

if NOTIFY_SUPPORT:
    Notify.init("lutris")
else:
    logger.warning("Notifications are disabled, please install" " GObject bindings for 'Notify' to enable them.")


def send_notification(title, text, file_path_to_icon="lutris"):
    if NOTIFY_SUPPORT:
        notification = Notify.Notification.new(title, text, file_path_to_icon)
        notification.show()
    else:
        logger.info(title)
        logger.info(text)