p3lib 1.1.102__py3-none-any.whl → 1.1.104__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- p3lib/gnome_desktop_app.py +13 -3
- {p3lib-1.1.102.dist-info → p3lib-1.1.104.dist-info}/METADATA +1 -1
- {p3lib-1.1.102.dist-info → p3lib-1.1.104.dist-info}/RECORD +6 -6
- {p3lib-1.1.102.dist-info → p3lib-1.1.104.dist-info}/LICENSE +0 -0
- {p3lib-1.1.102.dist-info → p3lib-1.1.104.dist-info}/WHEEL +0 -0
- {p3lib-1.1.102.dist-info → p3lib-1.1.104.dist-info}/top_level.txt +0 -0
p3lib/gnome_desktop_app.py
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
import os
|
4
4
|
import sys
|
5
5
|
import platform
|
6
|
+
import site
|
6
7
|
|
7
8
|
class GnomeDesktopApp(object):
|
8
9
|
"""@brief Responsible for adding and removing gnome desktop files for launching applications on a Linux system."""
|
@@ -19,7 +20,8 @@ class GnomeDesktopApp(object):
|
|
19
20
|
"""@brief Constructor.
|
20
21
|
@param icon_file The name of the icon file. This can be an absolute file name the filename on it's own.
|
21
22
|
If just a filename is passed then the icon file must sit in a folder named 'assets'.
|
22
|
-
This assets folder must be in the same folder as the startup file
|
23
|
+
This assets folder must be in the same folder as the startup file, it's parent or
|
24
|
+
the python3 site packages folder.
|
23
25
|
@param app_name The name of the application.
|
24
26
|
If not defined then the name of the program executed at startup is used.
|
25
27
|
This name has _ and - character replace with space characters and each
|
@@ -71,7 +73,11 @@ class GnomeDesktopApp(object):
|
|
71
73
|
path2 = os.path.join(startup_parent_path, 'assets')
|
72
74
|
self._abs_icon_file = os.path.join(path2, icon_file)
|
73
75
|
if not os.path.isfile(self._abs_icon_file):
|
74
|
-
|
76
|
+
site_packages_folder = site.getusersitepackages()
|
77
|
+
path3 = os.path.join(site_packages_folder, 'assets')
|
78
|
+
self._abs_icon_file = os.path.join(path3, icon_file)
|
79
|
+
if not os.path.isfile(self._abs_icon_file):
|
80
|
+
raise Exception(f"{self._app_name} icon file ({icon_file}) not found.")
|
75
81
|
|
76
82
|
def _get_gnome_desktop_file(self):
|
77
83
|
"""@brief Determine and return the name of the gnome desktop file.
|
@@ -117,9 +123,13 @@ class GnomeDesktopApp(object):
|
|
117
123
|
self._create_gnome_desktop_file()
|
118
124
|
|
119
125
|
def delete(self):
|
120
|
-
"""@brief Delete the gnome desktop file if present
|
126
|
+
"""@brief Delete the gnome desktop file if present.
|
127
|
+
@return True if a desktop file was deleted."""
|
128
|
+
deleted = False
|
121
129
|
if os.path.isfile(self._gnome_desktop_file):
|
122
130
|
os.remove(self._gnome_desktop_file)
|
131
|
+
deleted = True
|
132
|
+
return deleted
|
123
133
|
|
124
134
|
"""
|
125
135
|
Example usage
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: p3lib
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.104
|
4
4
|
Summary: A group of python modules for networking, plotting data, config storage, automating boot scripts, ssh access and user input output.
|
5
5
|
Home-page: https://github.com/pjaos/p3lib
|
6
6
|
Author: Paul Austen
|
@@ -6,7 +6,7 @@ p3lib/boot_manager.py,sha256=l7WlaoIRt4cu2jAdCs3FnDeNO2v2jzqideNZ3qg2r_4,19652
|
|
6
6
|
p3lib/conduit.py,sha256=jPkjdtyCx2I6SFqcEo8y2g7rgnZ-jNY7oCuYIETzT5Q,6046
|
7
7
|
p3lib/database_if.py,sha256=XKu1w3zftGbj4Rh54wrWJnoCtqHkhCzJUPN2S70XIKg,11915
|
8
8
|
p3lib/file_io.py,sha256=A7_GKYPlmjRjq6U1YuWhmB0OhLhNm6cWQfQX8qfgYTk,5041
|
9
|
-
p3lib/gnome_desktop_app.py,sha256=
|
9
|
+
p3lib/gnome_desktop_app.py,sha256=otNm4DF0q5o4HMgsHlASAqG5GfZK_94y5jYSUAFq5Q4,6491
|
10
10
|
p3lib/helper.py,sha256=xTKPgpziwr4zyaoc0sjZRFr0M91fo7Tok_nSAvtiTZE,12020
|
11
11
|
p3lib/json_networking.py,sha256=6u4s1SmypjTYPnSxHP712OgQ3ZJaxOqIkgHQ1J7Qews,9738
|
12
12
|
p3lib/mqtt_rpc.py,sha256=6LmFA1kR4HSJs9eWbOJORRHNY01L_lHWjvtE2fmY8P8,10511
|
@@ -17,8 +17,8 @@ p3lib/pconfig.py,sha256=2yZUK5nkqpAm4Y_xcJq5H9Lxmc8dfYei1Pi0Ek2Crh0,35376
|
|
17
17
|
p3lib/ssh.py,sha256=OyoAQ_h1L2RfkjTAChDrvLFfl4Fe_gBNdX5rvK-wKiw,42125
|
18
18
|
p3lib/table_plot.py,sha256=RPncwVlGUkkx5Fw0dHQedXo0TSPlTi__VrJBDzaMsuI,32116
|
19
19
|
p3lib/uio.py,sha256=Aaxc99XiE3d2f9vLjaN-bZsckoNxay5t0ujdK6PXGrw,23265
|
20
|
-
p3lib-1.1.
|
21
|
-
p3lib-1.1.
|
22
|
-
p3lib-1.1.
|
23
|
-
p3lib-1.1.
|
24
|
-
p3lib-1.1.
|
20
|
+
p3lib-1.1.104.dist-info/LICENSE,sha256=igqTy5u0kVWM1n-NUZMvAlinY6lVjAXKoag0okkS8V8,1067
|
21
|
+
p3lib-1.1.104.dist-info/METADATA,sha256=6uoDW17_NFjczYntS5wBSPflShu_r2QYIZPMHOR6SJY,919
|
22
|
+
p3lib-1.1.104.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
23
|
+
p3lib-1.1.104.dist-info/top_level.txt,sha256=SDCpXYh-19yCFp4Z8ZK4B-3J4NvTCJElZ42NPgcR6-U,6
|
24
|
+
p3lib-1.1.104.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|