Skip to content

Commit f0bc9c5

Browse files
committed
nim 2.2.0
1 parent 2c08f7b commit f0bc9c5

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/ttop/procfs.nim

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ proc parseUptime(): uint =
179179
let line = readLines(file, 1)[0]
180180
var f: float
181181
doAssert scanf(line, "$f", f)
182-
uint(float(hz) * f)
182+
return uint(float(hz) * f)
183183

184184
proc parseSize(str: string): uint =
185185
let normStr = str.strip(true, false)
@@ -618,10 +618,17 @@ proc group*(pidsInfo: PidsTable, kernel: bool): PidsTable =
618618
inc i
619619
620620
when isMainModule:
621-
let fi = fullInfo()
622-
for _, pi in fi.pidsInfo:
623-
if "firefox" in pi.cmd:
624-
echo pi.pid, ": ", pi.name, " --- ", pi.cmd
621+
template t(body: untyped) =
622+
try:
623+
body
624+
except CatchableError, Defect:
625+
raise getCurrentException()
626+
627+
proc f(): int =
628+
t:
629+
100
630+
631+
echo f()
625632
# let pi = group(fi.pidsInfo)
626633
# fi.pidsInfo.clear()
627634
# for o, pi in pi:

ttop.nimble

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Package
22

3-
version = "1.5.0"
3+
version = "1.5.2"
44
author = "inv2004"
55
description = "Monitoring tool with historical snapshots and alerts"
66
license = "MIT"
@@ -9,7 +9,7 @@ bin = @["ttop"]
99

1010
# Dependencies
1111

12-
requires "nim >= 1.6.10"
12+
requires "nim >= 2.0.10"
1313

1414
requires "https://github.com/inv2004/illwill"
1515
requires "zippy"

0 commit comments

Comments
 (0)