atomicshop 2.18.29__py3-none-any.whl → 2.18.32__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.

Potentially problematic release.


This version of atomicshop might be problematic. Click here for more details.

atomicshop/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  """Atomic Basic functions and classes to make developer life easier"""
2
2
 
3
3
  __author__ = "Den Kras"
4
- __version__ = '2.18.29'
4
+ __version__ = '2.18.32'
atomicshop/filesystem.py CHANGED
@@ -1711,13 +1711,12 @@ def create_ubuntu_desktop_shortcut(
1711
1711
  comment: str = "Shortcut to execute the Python script",
1712
1712
  categories: str = "Utility",
1713
1713
  set_executable: bool = False,
1714
+ set_trusted: bool = False,
1714
1715
  set_xfce_exe_checksum: bool = False
1715
1716
  ):
1716
1717
  """
1717
1718
  Create a desktop shortcut on Ubuntu.
1718
-
1719
1719
  Either file_path or command must be specified.
1720
- If command is specified, working_directory must be specified.
1721
1720
 
1722
1721
  :param file_path: string, The file_path to execute when the shortcut is clicked.
1723
1722
  Example2: '/path/to/script.sh'
@@ -1733,6 +1732,8 @@ def create_ubuntu_desktop_shortcut(
1733
1732
  :param comment: string, A comment to describe the shortcut.
1734
1733
  :param categories: string, The categories of the shortcut.
1735
1734
  :param set_executable: boolean, If True, the shortcut will be made executable.
1735
+ :param set_trusted: boolean, If True, the shortcut will be marked as trusted.
1736
+ This is needed for GNOME.
1736
1737
  :param set_xfce_exe_checksum: boolean, If True, the shortcut will be made safe executable for XFCE.
1737
1738
 
1738
1739
  :return: None
@@ -1742,23 +1743,21 @@ def create_ubuntu_desktop_shortcut(
1742
1743
  raise ValueError("Either 'file_path' or 'command' must be specified.")
1743
1744
  if command and file_path:
1744
1745
  raise ValueError("Only one of 'file_path' or 'command' can be specified.")
1745
- if command and not working_directory:
1746
- raise ValueError("Working directory must be specified if 'command' is specified.")
1747
1746
 
1748
1747
  from .permissions import ubuntu_permissions
1749
1748
 
1750
1749
  # Get the user's directory.
1751
1750
  desktop_dir = os.path.expanduser("~/Desktop")
1752
1751
 
1753
- # Full path to the .desktop file
1754
- shortcut_path = os.path.join(desktop_dir, f"{shortcut_name}.desktop")
1755
-
1756
- if not working_directory:
1752
+ if not working_directory and file_path:
1757
1753
  working_directory = os.path.dirname(file_path)
1758
1754
 
1759
1755
  if not shortcut_name:
1760
1756
  shortcut_name: str = Path(file_path).stem
1761
1757
 
1758
+ # Full path to the .desktop file
1759
+ shortcut_path = os.path.join(desktop_dir, f"{shortcut_name}.desktop")
1760
+
1762
1761
  # Generate the content for the .desktop file
1763
1762
  desktop_entry = [
1764
1763
  "[Desktop Entry]",
@@ -1766,7 +1765,7 @@ def create_ubuntu_desktop_shortcut(
1766
1765
  "Type=Application",
1767
1766
  f"Name={shortcut_name}",
1768
1767
  f"Exec={file_path}",
1769
- f"Path={working_directory}",
1768
+ f"Path={working_directory}" if working_directory else "",
1770
1769
  f"Icon={icon_path}" if icon_path else "",
1771
1770
  f"Terminal={'true' if terminal else 'false'}",
1772
1771
  f"Comment={comment}",
@@ -1781,6 +1780,10 @@ def create_ubuntu_desktop_shortcut(
1781
1780
  if set_executable:
1782
1781
  ubuntu_permissions.set_executable(shortcut_path)
1783
1782
 
1783
+ # Mark the .desktop file as trusted
1784
+ if set_trusted:
1785
+ ubuntu_permissions.set_trusted_executable(shortcut_path)
1786
+
1784
1787
  # Make the .desktop file safe executable for XFCE
1785
1788
  if set_xfce_exe_checksum:
1786
1789
  ubuntu_permissions.set_xfce_exe_checksum(shortcut_path)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atomicshop
3
- Version: 2.18.29
3
+ Version: 2.18.32
4
4
  Summary: Atomic functions and classes to make developer life easier
5
5
  Author: Denis Kras
6
6
  License: MIT License
@@ -1,4 +1,4 @@
1
- atomicshop/__init__.py,sha256=vD4D8D_jAMvDG5p9XvZfPSYd4zd_0MaNWcj-D9lkvE8,124
1
+ atomicshop/__init__.py,sha256=_U3jQmMLY0GEzKgxdVWbZY8fOJFW7Jo6tpT0QM-Nt-Y,124
2
2
  atomicshop/_basics_temp.py,sha256=6cu2dd6r2dLrd1BRNcVDKTHlsHs_26Gpw8QS6v32lQ0,3699
3
3
  atomicshop/_create_pdf_demo.py,sha256=Yi-PGZuMg0RKvQmLqVeLIZYadqEZwUm-4A9JxBl_vYA,3713
4
4
  atomicshop/_patch_import.py,sha256=ENp55sKVJ0e6-4lBvZnpz9PQCt3Otbur7F6aXDlyje4,6334
@@ -14,7 +14,7 @@ atomicshop/dns.py,sha256=5Gimq_WY2arqg7BeGmR7P--fGfnH0Dsh8lrOt_H0jRY,6817
14
14
  atomicshop/domains.py,sha256=Rxu6JhhMqFZRcoFs69IoEd1PtYca0lMCG6F1AomP7z4,3197
15
15
  atomicshop/emails.py,sha256=I0KyODQpIMEsNRi9YWSOL8EUPBiWyon3HRdIuSj3AEU,1410
16
16
  atomicshop/file_types.py,sha256=-0jzQMRlmU1AP9DARjk-HJm1tVE22E6ngP2mRblyEjY,763
17
- atomicshop/filesystem.py,sha256=jSFHv34KhR4r2dt65pUYNy3bCqBtnOiqqxOo_vdrmdA,67573
17
+ atomicshop/filesystem.py,sha256=9ipi8n49r5FZDwE4ZWnT00jAXGostpauzaJotpqdiss,67696
18
18
  atomicshop/functions.py,sha256=pK8hoCE9z61PtWCxQJsda7YAphrLH1wxU5x-1QJP-sY,499
19
19
  atomicshop/get_process_list.py,sha256=8cxb7gKe9sl4R6H2yMi8J6oe-RkonTvCdKjRFqi-Fs4,6075
20
20
  atomicshop/get_process_name_cmd_dll.py,sha256=CtaSp3mgxxJKCCVW8BLx6BJNx4giCklU_T7USiCEwfc,5162
@@ -321,8 +321,8 @@ atomicshop/wrappers/socketw/statistics_csv.py,sha256=fgMzDXI0cybwUEqAxprRmY3lqbh
321
321
  atomicshop/wrappers/winregw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
322
322
  atomicshop/wrappers/winregw/winreg_installed_software.py,sha256=Qzmyktvob1qp6Tjk2DjLfAqr_yXV0sgWzdMW_9kwNjY,2345
323
323
  atomicshop/wrappers/winregw/winreg_network.py,sha256=AENV88H1qDidrcpyM9OwEZxX5svfi-Jb4N6FkS1xtqA,8851
324
- atomicshop-2.18.29.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
325
- atomicshop-2.18.29.dist-info/METADATA,sha256=qUnmPIO-_pwUQ74EV5jl84JWBrlUigxl-lavHMHKEHQ,10631
326
- atomicshop-2.18.29.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
327
- atomicshop-2.18.29.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
328
- atomicshop-2.18.29.dist-info/RECORD,,
324
+ atomicshop-2.18.32.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
325
+ atomicshop-2.18.32.dist-info/METADATA,sha256=Q7QlfbvCcv0GKqy39I7UOlRciTWAf_5VK92VXFttpwc,10631
326
+ atomicshop-2.18.32.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
327
+ atomicshop-2.18.32.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
328
+ atomicshop-2.18.32.dist-info/RECORD,,