summaryrefslogtreecommitdiffstats
path: root/clamav-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-10-18 20:08:58 +0000
committerTed Trask <ttrask01@yahoo.com>2013-10-18 20:08:58 +0000
commit84b63e040c4dd3f55aafc6089b36cbe1066a58f7 (patch)
tree9451edbd515312521fa0085949b00025e960775d /clamav-model.lua
parentd63c6695c768b9cf893eb7f0f22a8078b4df3b86 (diff)
downloadacf-clamav-84b63e040c4dd3f55aafc6089b36cbe1066a58f7.tar.bz2
acf-clamav-84b63e040c4dd3f55aafc6089b36cbe1066a58f7.tar.xz
Remove all calls to 'module' in preparation for move to Lua 5.2
Use mymodule parameter for module definition. This was also helpful in revealing places where the code relied on the global environment.
Diffstat (limited to 'clamav-model.lua')
-rw-r--r--clamav-model.lua20
1 files changed, 11 insertions, 9 deletions
diff --git a/clamav-model.lua b/clamav-model.lua
index d83484d..c1e1d2a 100644
--- a/clamav-model.lua
+++ b/clamav-model.lua
@@ -1,4 +1,4 @@
-module(..., package.seeall)
+local mymodule = {}
-- Load libraries
modelfunctions = require("modelfunctions")
@@ -18,23 +18,23 @@ local path = "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
-- ################################################################################
-- PUBLIC FUNCTIONS
-function get_startstop(self, clientdata)
+function mymodule.get_startstop(self, clientdata)
return modelfunctions.get_startstop(processname)
end
-function startstop_service(self, startstop, action)
+function mymodule.startstop_service(self, startstop, action)
return modelfunctions.startstop_service(startstop, action)
end
-function getstatus()
+function mymodule.getstatus()
return modelfunctions.getstatus(processname, packagename, "ClamAV Status")
end
-function getstatusdetails()
+function mymodule.getstatusdetails()
return cfe({ type="longtext", value="", label="ClamAV Status Details" })
end
-function getfilelist()
+function mymodule.getfilelist()
local listed_files = {}
for i,name in ipairs(filelist) do
@@ -47,15 +47,15 @@ function getfilelist()
return cfe({ type="list", value=listed_files, label="ClamAV File List" })
end
-function getfiledetails(self, clientdata)
+function mymodule.getfiledetails(self, clientdata)
return modelfunctions.getfiledetails(clientdata.filename, filelist)
end
-function updatefiledetails(self, filedetails)
+function mymodule.updatefiledetails(self, filedetails)
return modelfunctions.setfiledetails(self, filedetails, filelist)
end
-function getlogfile ()
+function mymodule.getlogfile ()
local files = {}
local logfilepath = format.parse_configfile(fs.read_file(filelist[1]) or "").LogFile
if not logfilepath then
@@ -71,3 +71,5 @@ function getlogfile ()
end
return cfe({ value=files, label="ClamAV logfiles" })
end
+
+return mymodule