'Check the environment for reasons libnotify isn\'t working.  Return a
user-readable message indicating possible issues.'

@staticmethod
def diagnose():

    if (not Notify):
        return u'<p>Error:    gir-notify    isn\'t    installed.    On    Ubuntu/Debian,    install    the    <a    href="apt:gir1.2-notify-0.7">gir1.2-notify-0.7</a>    or    <a    href="apt:gir1.0-notify-0.4">gir1.0-notify-0.4</a>    package.'
    if ((u'DISPLAY' not in os.environ) and (u'DBUS_SESSION_BUS_ADDRESS' not in os.environ)):
        return u"<p>Error:    Environment    variables    DISPLAY    and    DBUS_SESSION_BUS_ADDRESS    aren't    set.        libnotify    will    only    work    when    you    run    SickRage    from    a    desktop    login."
    try:
        import dbus
    except (ImportError, Exception):
        dbus = None
    if dbus:
        try:
            bus = dbus.SessionBus()
        except dbus.DBusException as e:
            return u'<p>Error:    unable    to    connect    to    D-Bus    session    bus:    <code>{}</code>.<p>Are    you    running    SickRage    in    a    desktop    session?'.format(cgi.escape(e))
        try:
            bus.get_object(u'org.freedesktop.Notifications', u'/org/freedesktop/Notifications')
        except dbus.DBusException as e:
            return u"<p>Error:    there    doesn't    seem    to    be    a    notification    daemon    available:    <code>{}</code>    <p>Try    installing    notification-daemon    or    notify-osd.".format(cgi.escape(e))
    return u'<p>Error:    Unable    to    send    notification.'
