From 1ccd67e95699828a353b6d8ca94f8cca1d712690 Mon Sep 17 00:00:00 2001 From: knotteye Date: Fri, 16 Apr 2021 21:00:21 -0500 Subject: [PATCH] Update keyring code to work with nuitka3 --- plchat.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/plchat.py b/plchat.py index fb3af73..1263b88 100644 --- a/plchat.py +++ b/plchat.py @@ -25,12 +25,25 @@ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ################################################################################ +import platform, keyring +os = platform.system() +if os == "Windows": + import keyring.backends.Windows + keyring.set_keyring(keyring.backends.Windows.WinVaultKeyring()) +elif os == "Darwin": + import keyring.backends.OS_X + keyring.set_keyring(keyring.backends.OS_X.Keyring()) +else: + # Probably linux or BSD so we'll just go for it + import keyring.backends.SecretService + keyring.set_keyring(keyring.backends.SecretService.Keyring()) + + from qtpy.QtGui import * from qtpy.QtCore import * from qtpy.QtWidgets import * from notifypy import Notify -import sys, keyring, threading, queue, asyncio, urllib, appdirs, os, time, pleroma, re, magic, monkeypatch, requests, misc, json, timeconvert, videowidget, audiowidget - +import sys, threading, queue, asyncio, urllib, appdirs, os, time, pleroma, re, magic, monkeypatch, requests, misc, json, timeconvert, videowidget, audiowidget CACHE = appdirs.AppDirs('plchat', 'plchat').user_cache_dir APPDATA = appdirs.AppDirs('plchat', 'plchat').user_data_dir THREADS = {}