From 8b49a54dfe53bbc68c89147f43d24f3be2d8e1b4 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Sun, 20 Oct 2013 01:06:44 +0000 Subject: 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. --- pingu-model.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'pingu-model.lua') diff --git a/pingu-model.lua b/pingu-model.lua index 223bb3d..d81f903 100644 --- a/pingu-model.lua +++ b/pingu-model.lua @@ -1,4 +1,4 @@ -module(..., package.seeall) +local mymodule = {} -- Load libraries modelfunctions = require("modelfunctions") @@ -18,22 +18,24 @@ 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, "Pingu Status") end -function get_filedetails() +function mymodule.get_filedetails() return modelfunctions.getfiledetails(configfile) end -function update_filedetails(self, filedetails) +function mymodule.update_filedetails(self, filedetails) return modelfunctions.setfiledetails(self, filedetails, {configfile}) end + +return mymodule -- cgit v1.2.3