lunatic-python is loading

This commit is contained in:
Bob Omb 2015-11-09 18:57:16 -08:00
parent ebdcb6e3af
commit e1445cabce
4 changed files with 8 additions and 6 deletions

View File

@ -12,10 +12,11 @@ local magick = ie.require "magick"--]]
package.path = (MODPATH.."/lua-imagesize-1.2/?.lua;"..package.path)
local imagesize = ie.require "imagesize"
--[[
package.path = (MODPATH.."/lunatic-python-bugfix-1.1.1/?.lua;"..package.path)
local python = ie.require "python"
]]
--[[package.loadlib("/usr/lib/x86_64-linux-gnu/libpython2.7.so", "*")--]] --may need to explicitly state this
--[[package.path = (MODPATH.."/lunatic-python-bugfix-1.1.1/?.lua;"..package.path)
local py = ie.require("python", "*")
py.execute("import grass.script as gscript")--]]
--ONLY RUN ONE OF MAGICK OR IMLIB2 AT ANY TIME
package.path = (MODPATH.."/magick/?.lua;"..MODPATH.."/magick/?/init.lua;"..package.path)

View File

@ -1,16 +1,17 @@
local path = "/usr/lib/python2.7/site-packages"
if path then
func = package.loadlib(path.."/lua-python.so", "lua-python")
func = assert(package.loadlib(path.."/lua-python.so", "luaopen_python"))
if func then
func()
return
end
end
local modmask = "/usr/lib/python%d.%d/site-packages/lua-python.so"
local loaded = false
for i = 10, 2, -1 do
for j = 10, 2, -1 do
func = package.loadlib(string.format(modmask, i, j), "lua")
func = package.loadlib(string.format(modmask, i, j), "luaopen_python")
if func then
loaded = true
func()

BIN
rasters/dem.orig.tif Normal file

Binary file not shown.

Binary file not shown.