machineconfig 5.89__py3-none-any.whl → 5.92__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 machineconfig might be problematic. Click here for more details.
- machineconfig/settings/shells/pwsh/init.ps1 +5 -5
- machineconfig/utils/procs.py +9 -33
- {machineconfig-5.89.dist-info → machineconfig-5.92.dist-info}/METADATA +1 -1
- {machineconfig-5.89.dist-info → machineconfig-5.92.dist-info}/RECORD +7 -7
- {machineconfig-5.89.dist-info → machineconfig-5.92.dist-info}/WHEEL +0 -0
- {machineconfig-5.89.dist-info → machineconfig-5.92.dist-info}/entry_points.txt +0 -0
- {machineconfig-5.89.dist-info → machineconfig-5.92.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
$
|
|
3
|
+
$CONFIG_ROOT = "$HOME\.config\machineconfig"
|
|
4
4
|
|
|
5
5
|
function Add-ToPathIfNotAlready {
|
|
6
6
|
param (
|
|
@@ -16,7 +16,7 @@ function Add-ToPathIfNotAlready {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
Add-ToPathIfNotAlready -Directories @(
|
|
19
|
-
"$
|
|
19
|
+
"$CONFIG_ROOT\src\machineconfig\scripts\windows",
|
|
20
20
|
"$HOME\dotfiles\scripts\windows",
|
|
21
21
|
"C:\Program Files (x86)\GnuWin32\bin",
|
|
22
22
|
"C:\Program Files\CodeBlocks\MinGW\bin",
|
|
@@ -29,9 +29,9 @@ Add-ToPathIfNotAlready -Directories @(
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
# sources ================================================================
|
|
32
|
-
. $
|
|
33
|
-
. $
|
|
34
|
-
. $
|
|
32
|
+
. $CONFIG_ROOT\settings\broot\brootcd.ps1
|
|
33
|
+
. $CONFIG_ROOT\settings\lf\windows\lfcd.ps1
|
|
34
|
+
. $CONFIG_ROOT\settings\tere\terecd.ps1
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
function lsdla { lsd -la }
|
machineconfig/utils/procs.py
CHANGED
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import psutil
|
|
4
4
|
from rich.progress import Progress, SpinnerColumn, TextColumn
|
|
5
|
-
from zoneinfo import ZoneInfo
|
|
6
5
|
from machineconfig.utils.options import choose_from_options
|
|
7
|
-
from typing import Optional
|
|
6
|
+
from typing import Optional
|
|
8
7
|
from rich.console import Console
|
|
9
8
|
from rich.panel import Panel
|
|
10
|
-
from datetime import datetime
|
|
9
|
+
from datetime import datetime
|
|
11
10
|
from machineconfig.utils.accessories import pprint
|
|
12
11
|
|
|
13
12
|
console = Console()
|
|
@@ -63,9 +62,7 @@ class ProcessManager:
|
|
|
63
62
|
for proc in psutil.process_iter():
|
|
64
63
|
try:
|
|
65
64
|
mem_usage_mb = proc.memory_info().rss / (1024 * 1024)
|
|
66
|
-
|
|
67
|
-
create_time_utc = datetime.fromtimestamp(proc.create_time(), tz=timezone.utc)
|
|
68
|
-
create_time_local = create_time_utc.astimezone(ZoneInfo("Australia/Adelaide"))
|
|
65
|
+
create_time = datetime.fromtimestamp(proc.create_time(), tz=None)
|
|
69
66
|
|
|
70
67
|
process_info.append(
|
|
71
68
|
{
|
|
@@ -75,7 +72,7 @@ class ProcessManager:
|
|
|
75
72
|
"cpu_percent": proc.cpu_percent(),
|
|
76
73
|
"memory_usage_mb": mem_usage_mb,
|
|
77
74
|
"status": proc.status(),
|
|
78
|
-
"create_time":
|
|
75
|
+
"create_time": create_time,
|
|
79
76
|
"command": " ".join(proc.cmdline()),
|
|
80
77
|
}
|
|
81
78
|
)
|
|
@@ -208,32 +205,11 @@ class ProcessManager:
|
|
|
208
205
|
console.print(Panel(f"✅ Termination complete: {killed_count} processes terminated", title="[bold blue]Process Info[/bold blue]", border_style="blue"))
|
|
209
206
|
|
|
210
207
|
|
|
211
|
-
def get_age(create_time:
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
create_time_utc = datetime.fromtimestamp(create_time, tz=timezone.utc)
|
|
217
|
-
create_time_local = create_time_utc.astimezone(ZoneInfo("Australia/Adelaide"))
|
|
218
|
-
else:
|
|
219
|
-
# Already a datetime object
|
|
220
|
-
create_time_local = create_time
|
|
221
|
-
|
|
222
|
-
now_local = datetime.now(tz=ZoneInfo("Australia/Adelaide"))
|
|
223
|
-
age = now_local - create_time_local
|
|
224
|
-
return str(age)
|
|
225
|
-
except Exception as e:
|
|
226
|
-
try:
|
|
227
|
-
# Fallback without timezone
|
|
228
|
-
if isinstance(create_time, (int, float)):
|
|
229
|
-
create_time_dt = datetime.fromtimestamp(create_time)
|
|
230
|
-
else:
|
|
231
|
-
create_time_dt = create_time.replace(tzinfo=None) if create_time.tzinfo else create_time
|
|
232
|
-
now_dt = datetime.now()
|
|
233
|
-
age = now_dt - create_time_dt
|
|
234
|
-
return str(age)
|
|
235
|
-
except Exception as ee:
|
|
236
|
-
return f"unknown due to {ee} and {e}"
|
|
208
|
+
def get_age(create_time: int) -> str:
|
|
209
|
+
dtm_now = datetime.now()
|
|
210
|
+
dtm_create = datetime.fromtimestamp(create_time, tz=None)
|
|
211
|
+
delta = dtm_now - dtm_create
|
|
212
|
+
return str(delta).split(".")[0] # remove microseconds
|
|
237
213
|
|
|
238
214
|
|
|
239
215
|
def main():
|
|
@@ -331,7 +331,7 @@ machineconfig/settings/shells/ipy/profiles/default/startup/playext.py,sha256=OJ3
|
|
|
331
331
|
machineconfig/settings/shells/kitty/kitty.conf,sha256=lDdx-dUX3jbKGb3BkS2f2TOpmgGiS-CI-_-lFvhD5A4,52870
|
|
332
332
|
machineconfig/settings/shells/nushell/config.nu,sha256=ug0E0NXNlCzgStScFN6VTsAkUaOTPJZB69P-LS5L2VE,1047
|
|
333
333
|
machineconfig/settings/shells/nushell/env.nu,sha256=4VmaXb-qP6qnMD5TPzkXMLFNlB5QC4l9HEzCvXZE2GQ,315
|
|
334
|
-
machineconfig/settings/shells/pwsh/init.ps1,sha256=
|
|
334
|
+
machineconfig/settings/shells/pwsh/init.ps1,sha256=o98tqfAOZT89rclbhRmDBQ7zU9Rtdm_FvY8alXYGCN0,2647
|
|
335
335
|
machineconfig/settings/shells/pwsh/profile.ps1,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
336
336
|
machineconfig/settings/shells/starship/starship.toml,sha256=5rQTY7ZpKnrnhgu2Y9OJKUYMz5lPLIftO1p1VRuVZwQ,1150
|
|
337
337
|
machineconfig/settings/shells/vtm/settings.xml,sha256=5TNXd-i0eUGo2w3tuhY9aOkwoJdqih8_HO_U6uL2Dts,18262
|
|
@@ -392,7 +392,7 @@ machineconfig/utils/notifications.py,sha256=tuXIudcip0tEioG-bm8BbLr3FMDve4f6Bktl
|
|
|
392
392
|
machineconfig/utils/options.py,sha256=vUO4Kej-vDOv64wHr2HNDyu6PATURpjd7xp6N8OOoJg,7083
|
|
393
393
|
machineconfig/utils/path_extended.py,sha256=4RhL0twcIG2kJxmC4r_YzaiTxrYkSRbdh9SO5ObMABw,53122
|
|
394
394
|
machineconfig/utils/path_helper.py,sha256=0e3Xh3BAEv27oqcezNeVLHJllGmLEgLH4T1l90m-650,8014
|
|
395
|
-
machineconfig/utils/procs.py,sha256=
|
|
395
|
+
machineconfig/utils/procs.py,sha256=lGPzGl6vAdnuzdiP_FrDikEf2NFOTo-li3SuyUgYWuY,10268
|
|
396
396
|
machineconfig/utils/scheduler.py,sha256=jZ_1yghqA3-aINPRmE_76gboqJc0UElroR7urNOfXKs,14940
|
|
397
397
|
machineconfig/utils/scheduling.py,sha256=RF1iXJpqf4Dg18jdZWtBixz97KAHC6VKYqTFSpdLWuc,11188
|
|
398
398
|
machineconfig/utils/source_of_truth.py,sha256=ZAnCRltiM07ig--P6g9_6nEAvNFC4X4ERFTVcvpIYsE,764
|
|
@@ -421,8 +421,8 @@ machineconfig/utils/schemas/installer/installer_types.py,sha256=QClRY61QaduBPJoS
|
|
|
421
421
|
machineconfig/utils/schemas/layouts/layout_types.py,sha256=TcqlZdGVoH8htG5fHn1KWXhRdPueAcoyApppZsPAPto,2020
|
|
422
422
|
machineconfig/utils/schemas/repos/repos_types.py,sha256=ECVr-3IVIo8yjmYmVXX2mnDDN1SLSwvQIhx4KDDQHBQ,405
|
|
423
423
|
machineconfig/utils/ssh_utils/utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
424
|
-
machineconfig-5.
|
|
425
|
-
machineconfig-5.
|
|
426
|
-
machineconfig-5.
|
|
427
|
-
machineconfig-5.
|
|
428
|
-
machineconfig-5.
|
|
424
|
+
machineconfig-5.92.dist-info/METADATA,sha256=VKZb_26gFUj2XJ4609bUjJbV0uwfF39Dlb3lbNv2ULw,3012
|
|
425
|
+
machineconfig-5.92.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
426
|
+
machineconfig-5.92.dist-info/entry_points.txt,sha256=M0jwN_brZdXWhmNVeXLvdKxfkv8WhhXFZYcuKBA9qnk,418
|
|
427
|
+
machineconfig-5.92.dist-info/top_level.txt,sha256=porRtB8qms8fOIUJgK-tO83_FeH6Bpe12oUVC670teA,14
|
|
428
|
+
machineconfig-5.92.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|