aboutsummaryrefslogtreecommitdiff
path: root/net.lua
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2009-08-05 21:50:41 +0200
committerAdrian C. (anrxc) <anrxc@sysphere.org>2009-08-05 21:50:41 +0200
commit4c74de711f564d26ebefef7f9422289bd76ef8c2 (patch)
tree404eb00b19214c8455dc1d0397d34353b895efce /net.lua
parent2d4efa6893a582a7bc6a15b4840a116c0547b534 (diff)
downloadvicious-legacy-4c74de711f564d26ebefef7f9422289bd76ef8c2.tar.xz
Padding removed, along with deprecated helper functions.
If you have any use for it then continue using an older vicious tag, or keep maintaining it in your local vicious copy.
Diffstat (limited to 'net.lua')
-rw-r--r--net.lua19
1 files changed, 1 insertions, 18 deletions
diff --git a/net.lua b/net.lua
index c9f0fb2..6e7163e 100644
--- a/net.lua
+++ b/net.lua
@@ -9,7 +9,6 @@ local os = { time = os.time }
local io = { open = io.open }
local setmetatable = setmetatable
local math = { floor = math.floor }
-local helpers = require("vicious.helpers")
-- }}}
@@ -21,7 +20,7 @@ module("vicious.net")
local nets = {}
-- {{{ Net widget type
-function worker(format, padding)
+function worker(format)
-- Get /proc/net/dev
local f = io.open("/proc/net/dev")
local args = {}
@@ -36,14 +35,6 @@ function worker(format, padding)
-- Transmited bytes, 7 fields from end of the line
send = tonumber(line:match("([%d]+)%s+%d+%s+%d+%s+%d+%s+%d+%s+%d+%s+%d+%s+%d$"))
- if padding then
- args["{"..name.." rx}"] = helpers.bytes_to_string(recv, nil, padding)
- args["{"..name.." tx}"] = helpers.bytes_to_string(send, nil, padding)
- else
- args["{"..name.." rx}"] = helpers.bytes_to_string(recv)
- args["{"..name.." tx}"] = helpers.bytes_to_string(send)
- end
-
args["{"..name.." rx_b}"] = math.floor(recv*10)/10
args["{"..name.." tx_b}"] = math.floor(send*10)/10
@@ -83,14 +74,6 @@ function worker(format, padding)
down = (recv - nets[name][1])/interval
up = (send - nets[name][2])/interval
- if padding then
- args["{"..name.." down}"] = helpers.bytes_to_string(down, true, padding)
- args["{"..name.." up}"] = helpers.bytes_to_string(up, true, padding)
- else
- args["{"..name.." down}"] = helpers.bytes_to_string(down, true)
- args["{"..name.." up}"] = helpers.bytes_to_string(up, true)
- end
-
args["{"..name.." down_b}"] = math.floor(down*10)/10
args["{"..name.." up_b}"] = math.floor(up*10)/10