atomicshop 2.9.18__py3-none-any.whl → 2.9.20__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.9.18'
4
+ __version__ = '2.9.20'
atomicshop/permissions.py CHANGED
@@ -5,6 +5,7 @@ import ctypes
5
5
  import contextlib
6
6
  import subprocess
7
7
 
8
+ from . import process
8
9
  from .print_api import print_api
9
10
 
10
11
 
@@ -28,9 +29,10 @@ def is_admin() -> bool:
28
29
  return result
29
30
 
30
31
 
31
- def request_sudo_on_ubuntu():
32
+ def request_sudo_on_ubuntu_by_python():
32
33
  """
33
- The function tries to request sudo on Ubuntu for the user to enter the password.
34
+ The function tries to request sudo on Ubuntu for the user to enter the password, by executing python executable
35
+ with sudo.
34
36
 
35
37
  :return:
36
38
  """
@@ -44,6 +46,26 @@ def request_sudo_on_ubuntu():
44
46
  sys.exit(1)
45
47
 
46
48
 
49
+ def request_sudo_on_ubuntu_by_bash():
50
+ """
51
+ The function tries to request sudo on Ubuntu for the user to enter the password, by executing appropriate
52
+ bash commands.
53
+
54
+ :return:
55
+ """
56
+
57
+ script = """
58
+ if [ "$EUID" -ne 0 ]; then
59
+ echo "This script requires root privileges. Please enter your password for sudo access."
60
+ sudo -v
61
+ while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
62
+ fi
63
+ # Your bash commands that require sudo here
64
+ """
65
+
66
+ process.execute_script(script, shell=True)
67
+
68
+
47
69
  def set_executable_permission(file_path: str):
48
70
  """
49
71
  Function sets the executable permission on a file.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atomicshop
3
- Version: 2.9.18
3
+ Version: 2.9.20
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=M9CdUd43TxcAkGoqpVIcLZJ3BXtWLn6o_tWhlRD4vsI,123
1
+ atomicshop/__init__.py,sha256=BAuzZD_0iRu_797canrTcCE3YDKeaqo3bj1x___RyVo,123
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
@@ -22,7 +22,7 @@ atomicshop/inspect_wrapper.py,sha256=sGRVQhrJovNygHTydqJj0hxES-aB2Eg9KbIk3G31apw
22
22
  atomicshop/ip_addresses.py,sha256=Hvi4TumEFoTEpKWaq5WNF-YzcRzt24IxmNgv-Mgax1s,1190
23
23
  atomicshop/keyboard_press.py,sha256=1W5kRtOB75fulVx-uF2yarBhW0_IzdI1k73AnvXstk0,452
24
24
  atomicshop/pbtkmultifile_argparse.py,sha256=aEk8nhvoQVu-xyfZosK3ma17CwIgOjzO1erXXdjwtS4,4574
25
- atomicshop/permissions.py,sha256=tala8vSLhcfZ9sTTrhji8m7c7WFa1XoVuE-s6QbBRDI,3096
25
+ atomicshop/permissions.py,sha256=d0HUqPfM2UhnE9T4waHqmaXwNxqm7S8xsxMeZTPxPaQ,3750
26
26
  atomicshop/print_api.py,sha256=DhbCQd0MWZZ5GYEk4oTu1opRFC-b31g1VWZgTGewG2Y,11568
27
27
  atomicshop/process.py,sha256=SXaqG8pzNkHvppPhuhixEIXSaqbeDlTUFLaS5bYSp54,14176
28
28
  atomicshop/process_name_cmd.py,sha256=TNAK6kQZm5JKWzEW6QLqVHEG98ZLNDQiSS4YwDk8V8c,3830
@@ -230,8 +230,8 @@ atomicshop/wrappers/socketw/socket_server_tester.py,sha256=AhpurHJmP2kgzHaUbq5ey
230
230
  atomicshop/wrappers/socketw/socket_wrapper.py,sha256=aXBwlEIJhFT0-c4i8iNlFx2It9VpCEpsv--5Oqcpxao,11624
231
231
  atomicshop/wrappers/socketw/ssl_base.py,sha256=k4V3gwkbq10MvOH4btU4onLX2GNOsSfUAdcHmL1rpVE,2274
232
232
  atomicshop/wrappers/socketw/statistics_csv.py,sha256=t3dtDEfN47CfYVi0CW6Kc2QHTEeZVyYhc57IYYh5nmA,826
233
- atomicshop-2.9.18.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
234
- atomicshop-2.9.18.dist-info/METADATA,sha256=0z6bpso-RwK8-9HXDDyuoR9nWCmH3kyBjqeljzn3vmI,10423
235
- atomicshop-2.9.18.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
236
- atomicshop-2.9.18.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
237
- atomicshop-2.9.18.dist-info/RECORD,,
233
+ atomicshop-2.9.20.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
234
+ atomicshop-2.9.20.dist-info/METADATA,sha256=rne9_jgSwxixn80LlxL7JUnxkf_SlsHd0YRLGPb3nhE,10423
235
+ atomicshop-2.9.20.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
236
+ atomicshop-2.9.20.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
237
+ atomicshop-2.9.20.dist-info/RECORD,,