Skip to content
This repository has been archived by the owner on Oct 29, 2018. It is now read-only.

PyGIWarning: Notify was imported without specifying a version first. #288

Open
stieg opened this issue Nov 11, 2015 · 17 comments
Open

PyGIWarning: Notify was imported without specifying a version first. #288

stieg opened this issue Nov 11, 2015 · 17 comments

Comments

@stieg
Copy link
Collaborator

stieg commented Nov 11, 2015

Scudcloud is failing to start on my Fedora 23. Here is the message seen on the command line:

$ scudcloud 
/usr/share/scudcloud/lib/notifier.py:3: PyGIWarning: Notify was imported without specifying a version first. Use gi.require_version('Notify', '0.7') before import to ensure that the right version gets loaded.
  from gi.repository import Notify

Relevant Code

from dbus.exceptions import DBusException
try:
    from gi.repository import Notify
except ImportError:
    import notify2
    Notify = None

Package info

$ rpm -qi scudcloud
Name        : scudcloud
Version     : 1.0.86
Release     : 1.fc23
Architecture: noarch
Install Date: Wed 28 Oct 2015 10:37:37 AM CDT
Group       : Applications/Internet
Size        : 286962
License     : MIT
Signature   : (none)
Source RPM  : scudcloud-1.0.86-1.fc23.src.rpm
Build Date  : Mon 26 Oct 2015 03:47:58 PM CDT
Build Host  : Lucious.stiegnet.homelinux.net
Relocations : (not relocatable)
URL         : https://github.com/raelgc/scudcloud/
Summary     : Non official desktop client for Slack
Description :
ScudCloud uses the QT library with Webkit to render the web version of
Slack, and enhances it by integrating the QWebkit-Native bridge to
improve desktop integration.  Features include:
* Multiple teams support
* Native system notifications
* Count of unread direct mentions at launcher/system tray icon
* Alert/wobbling on new messages
* Channels quick list (Unity only)
* Optional "Close to Tray"

python3-gobject-base package info:

$ rpm -qi python3-gobject-base 
Name        : python3-gobject-base
Version     : 3.18.0
Release     : 2.fc23
Architecture: x86_64
Install Date: Fri 23 Oct 2015 09:57:14 AM CDT
Group       : Unspecified
Size        : 1065381
License     : LGPLv2+ and MIT
Signature   : RSA/SHA256, Mon 19 Oct 2015 08:22:24 AM CDT, Key ID 32474cf834ec9cba
Source RPM  : pygobject3-3.18.0-2.fc23.src.rpm
Build Date  : Mon 19 Oct 2015 06:52:05 AM CDT
Build Host  : buildvm-08.phx2.fedoraproject.org
Relocations : (not relocatable)
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : https://live.gnome.org/PyGObject
Summary     : Python 3 bindings for GObject Introspection base package
Description :
This package provides the non-cairo specific bits of the GObject Introspection
library.
@oblitum
Copy link

oblitum commented Nov 23, 2015

I'm getting this error message too. I'm on Arch Linux using an aur package (current version 1.1.1-1). I got here because of the message when starting from console but currently my client is stuck loading. It has been like this for some days, I'm now using the web interface.

@raelgc
Copy link
Owner

raelgc commented Nov 25, 2015

This is just a warning, the failing to start is due some improvements on Slack side, now fixed in ScudCloud, as we can see in #294. Please upgrade to latest version.

@raelgc raelgc closed this as completed Nov 25, 2015
@oblitum
Copy link

oblitum commented Nov 25, 2015

@raelgc but as I've stated, I'm running 1.1.1-1. Do you mean master's tip?

@raelgc raelgc reopened this Nov 25, 2015
@raelgc
Copy link
Owner

raelgc commented Nov 25, 2015

To stop this warning, maybe we can try a fix like this:

import gi
gi.require_version('Notify', '0.7')

@oblitum
Copy link

oblitum commented Nov 25, 2015

@raelgc is it the reason for the "always loading" behavior too?

@raelgc
Copy link
Owner

raelgc commented Nov 25, 2015

@oblitum Unfortunately, no.

Can you double check if your /opt/scudcloud/lib/scudcloud.py has the following lines (usually close to 81)?

        # Enabling Local Storage (now required by Slack)
        QWebSettings.globalSettings().setAttribute(QWebSettings.LocalStorageEnabled, True)
        # We need browsing history (required to not limit LocalStorage)
        QWebSettings.globalSettings().setAttribute(QWebSettings.PrivateBrowsingEnabled, False)

@oblitum
Copy link

oblitum commented Nov 25, 2015

@raelgc

This is what I have there:

    def webSettings(self):
        self.cookiesjar = PersistentCookieJar(self)
        self.zoom = self.readZoom()
        # Required by Youtube videos (HTML5 video support only on Qt5)
        QWebSettings.globalSettings().setAttribute(QWebSettings.PluginsEnabled, self.plugins)
        # We don't want Java
        QWebSettings.globalSettings().setAttribute(QWebSettings.JavaEnabled, False)
        # We don't need History
        QWebSettings.globalSettings().setAttribute(QWebSettings.PrivateBrowsingEnabled, False)
        # Enabling Local Storage (now required by Slack)
        QWebSettings.globalSettings().setAttribute(QWebSettings.LocalStorageEnabled, True)
        # Enabling Cache
        self.diskCache = QNetworkDiskCache(self)
        self.diskCache.setCacheDirectory(self.settings_path)
        # Required for copy and paste clipboard integration
        QWebSettings.globalSettings().setAttribute(QWebSettings.JavascriptCanAccessClipboard, True)
        # Enabling Inspeclet only when --debug=True (requires more CPU usage)
        QWebSettings.globalSettings().setAttribute(QWebSettings.DeveloperExtrasEnabled, self.debug)

@oblitum
Copy link

oblitum commented Nov 25, 2015

I've checked sources on GitHub at the 1.1.1 tag and it's the same as the one I've pasted.

@raelgc
Copy link
Owner

raelgc commented Nov 25, 2015

Yeap, the values are correct.

@oblitum
Copy link

oblitum commented Nov 25, 2015

@raelgc It has been fixed, I needed to reboot though.

@oblitum
Copy link

oblitum commented Nov 25, 2015

@raelgc I mean, the always loading behavior. I didn't check the message in the terminal yet after reboot.

@oblitum
Copy link

oblitum commented Nov 25, 2015

@raelgc yes, the warning still remains.

@raelgc
Copy link
Owner

raelgc commented Nov 25, 2015

@oblitum, nice to hear you're now able to connect!

@oblitum
Copy link

oblitum commented Nov 25, 2015

@raelgc thanks!

@raelgc raelgc closed this as completed Feb 4, 2016
@raelgc
Copy link
Owner

raelgc commented Apr 4, 2016

These warnings are always displayed in Ubuntu 16.04. While not an issue, they as easily fixable.

@zeeshanrealist
Copy link

Are we supposed to have those packages installed too on terminal?

@raelgc
Copy link
Owner

raelgc commented Sep 30, 2016

@zeeshanrealist These warnings will be always displayed in 16.04. Only in the 16.10 version we fixed this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants