diff options
author | Ted Trask <ttrask01@yahoo.com> | 2013-10-21 00:55:30 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2013-10-21 00:55:30 +0000 |
commit | fc996d5c5c994a13d81d336c9fbeda120685cc42 (patch) | |
tree | 1d3c3167a7495c25146f48787ac70f87b9ecc798 /vlc-model.lua | |
parent | 345446b1499f93da9ab64a8b2dade8cf4f00a336 (diff) | |
download | acf-vlc-daemon-fc996d5c5c994a13d81d336c9fbeda120685cc42.tar.bz2 acf-vlc-daemon-fc996d5c5c994a13d81d336c9fbeda120685cc42.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 'vlc-model.lua')
-rw-r--r-- | vlc-model.lua | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/vlc-model.lua b/vlc-model.lua index aa9470f..e210e25 100644 --- a/vlc-model.lua +++ b/vlc-model.lua @@ -1,4 +1,4 @@ -module(..., package.seeall) +local mymodule = {} -- Load libraries modelfunctions = require("modelfunctions") @@ -11,7 +11,7 @@ local processname="vlc" local configfile = "/etc/conf.d/"..tostring(processname) local logfile = "/var/log/vlc/vlc.log" -function set_processname(p) +function mymodule.set_processname(p) processname = p configfile = "/etc/conf.d/"..tostring(processname) end @@ -24,24 +24,24 @@ end -- ################################################################################ -- 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, tostring(processname).." Status") end -function getconfigfile() +function mymodule.getconfigfile() -- FIXME Validate return modelfunctions.getfiledetails(configfile) end -function get_filedetails() +function mymodule.get_filedetails() local path=logfile local path2 if fs.is_file(configfile) then @@ -53,12 +53,13 @@ function get_filedetails() return modelfunctions.getfiledetails(path) end -function setconfigfile(self, filedetails) +function mymodule.setconfigfile(self, filedetails) -- FIXME Validate return modelfunctions.setfiledetails(self, filedetails, {configfile}) end -function getleases() +function mymodule.getleases() return modelfunctions.getfiledetails(leasefile) end +return mymodule |