diff options
author | B Stack <bgstack15@gmail.com> | 2020-04-03 08:43:52 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2020-04-03 08:43:52 -0400 |
commit | 03a6e58ff8754567fc8b6daca10fe241935572ba (patch) | |
tree | 87d810a4293c592b86bbbae6fb679cca37cbd201 /src/usr/bin | |
parent | actually apply those fixes (diff) | |
download | logout-manager-03a6e58ff8754567fc8b6daca10fe241935572ba.tar.gz logout-manager-03a6e58ff8754567fc8b6daca10fe241935572ba.tar.bz2 logout-manager-03a6e58ff8754567fc8b6daca10fe241935572ba.zip |
fix #4 fix rest of frontends for py3.8 distro
Diffstat (limited to 'src/usr/bin')
-rwxr-xr-x | src/usr/bin/logout-manager-cli | 8 | ||||
-rwxr-xr-x | src/usr/bin/logout-manager-gtk | 6 | ||||
-rwxr-xr-x | src/usr/bin/logout-manager-ncurses | 6 | ||||
-rwxr-xr-x | src/usr/bin/logout-manager-tcl | 7 | ||||
-rwxr-xr-x | src/usr/bin/logout-manager-trayicon | 1 |
5 files changed, 18 insertions, 10 deletions
diff --git a/src/usr/bin/logout-manager-cli b/src/usr/bin/logout-manager-cli index fde7d55..c325db4 100755 --- a/src/usr/bin/logout-manager-cli +++ b/src/usr/bin/logout-manager-cli @@ -13,16 +13,17 @@ # https://stackoverflow.com/questions/3061/calling-a-function-of-a-module-by-using-its-name-a-string/12025554#12025554 # Improve: # Dependencies: -# Devuan: python3-dotenv python3 +# dep-devuan: python3-dotenv, python3 # Documentation: -import os, platform, sys, argparse +import os, sys, argparse +from distro import linux_distribution from dotenv import load_dotenv # all this to load the libpath try: defaultdir="/etc/sysconfig" - thisplatform = platform.platform().lower() + thisplatform = linux_distribution()[0].lower() if 'debian' in thisplatform or 'devuan' in thisplatform: defaultdir="/etc/default" # load_dotenv keeps existing environment variables as higher precedent @@ -32,6 +33,7 @@ except: if 'LOGOUT_MANAGER_LIBPATH' in os.environ: for i in os.environ['LOGOUT_MANAGER_LIBPATH'].split(":"): sys.path.append(i) +sys.path.append("/usr/share/logout-manager") import lmlib def eprint(*args, **kwargs): diff --git a/src/usr/bin/logout-manager-gtk b/src/usr/bin/logout-manager-gtk index 389ad70..400594d 100755 --- a/src/usr/bin/logout-manager-gtk +++ b/src/usr/bin/logout-manager-gtk @@ -25,10 +25,11 @@ # support global conf file, and user conf file # far future: provide graphical way to change commands run # Dependencies: -# Devuan: python3-dotenv +# dep-devuan: python3-dotenv # Documentation: import gi, os, platform, sys +from distro import linux_distribution gi.require_version("Gtk", "3.0") from gi.repository import Gtk from gi.repository import Gdk @@ -39,7 +40,7 @@ from dotenv import load_dotenv # all this to load the libpath try: defaultdir="/etc/sysconfig" - thisplatform = platform.platform().lower() + thisplatform = linux_distribution()[0].lower() if 'debian' in thisplatform or 'devuan' in thisplatform: defaultdir="/etc/default" # load_dotenv keeps existing environment variables as higher precedent @@ -49,6 +50,7 @@ except: if 'LOGOUT_MANAGER_LIBPATH' in os.environ: for i in os.environ['LOGOUT_MANAGER_LIBPATH'].split(":"): sys.path.append(i) +sys.path.append("/usr/share/logout-manager") import lmlib # graphical classes and functions diff --git a/src/usr/bin/logout-manager-ncurses b/src/usr/bin/logout-manager-ncurses index 7ff5e18..67b18d7 100755 --- a/src/usr/bin/logout-manager-ncurses +++ b/src/usr/bin/logout-manager-ncurses @@ -20,13 +20,14 @@ # accepts enabled attribute # add "zeroindex" bool -import curses, os, platform, sys +import curses, os, sys +from distro import linux_distribution from dotenv import load_dotenv # all this to load the libpath try: defaultdir="/etc/sysconfig" - thisplatform = platform.platform().lower() + thisplatform = linux_distribution()[0].lower() if 'debian' in thisplatform or 'devuan' in thisplatform: defaultdir="/etc/default" # load_dotenv keeps existing environment variables as higher precedent @@ -36,6 +37,7 @@ except: if 'LOGOUT_MANAGER_LIBPATH' in os.environ: for i in os.environ['LOGOUT_MANAGER_LIBPATH'].split(":"): sys.path.append(i) +sys.path.append("/usr/share/logout-manager") import lmlib class CursesMenu(object): diff --git a/src/usr/bin/logout-manager-tcl b/src/usr/bin/logout-manager-tcl index 17e0eed..9cadc5c 100755 --- a/src/usr/bin/logout-manager-tcl +++ b/src/usr/bin/logout-manager-tcl @@ -26,11 +26,11 @@ # Devuan: python3-tk python3-pil.imagetk python3-cairosvg # el7: python36-tkinter python36-pillow-tk ( pip3 install cairosvg ) -import glob, os, platform, re, sys +import glob, os, re, sys import tkinter as tk +from distro import linux_distribution from functools import partial from pathlib import Path -from sys import path from dotenv import load_dotenv # loading PIL.ImageTk after tkinter makes ImageTk use the PIL version, which supports PNG. This is important on tcl < 8.6 (that is, el7) from PIL import Image, ImageTk @@ -46,7 +46,7 @@ except: # all this to load the libpath try: defaultdir="/etc/sysconfig" - thisplatform = platform.platform().lower() + thisplatform = linux_distribution()[0].lower() if 'debian' in thisplatform or 'devuan' in thisplatform: defaultdir="/etc/default" # load_dotenv keeps existing environment variables as higher precedent @@ -56,6 +56,7 @@ except: if 'LOGOUT_MANAGER_LIBPATH' in os.environ: for i in os.environ['LOGOUT_MANAGER_LIBPATH'].split(":"): sys.path.append(i) +sys.path.append("/usr/share/logout-manager") import lmlib # graphical classes and functions diff --git a/src/usr/bin/logout-manager-trayicon b/src/usr/bin/logout-manager-trayicon index 4aed3b5..9eaaa32 100755 --- a/src/usr/bin/logout-manager-trayicon +++ b/src/usr/bin/logout-manager-trayicon @@ -43,6 +43,7 @@ except: if 'LOGOUT_MANAGER_LIBPATH' in os.environ: for i in os.environ['LOGOUT_MANAGER_LIBPATH'].split(":"): sys.path.append(i) +sys.path.append("/usr/share/logout-manager") import lmlib def is_dryrun(): |