[tekui-devel] tekui: Corrected ProgName and OldPath determination
Timm S. Mueller
tmueller at neoscientists.org
Fri May 9 14:26:21 CEST 2008
details: http://hg.teklib.org/tekui/rev/9de8a2685f03
changeset: 475:9de8a2685f03
user: Timm S. Mueller <tmueller at neoscientists.org>
date: Thu May 08 20:59:17 2008 +0200
description:
Corrected ProgName and OldPath determination
diffs (27 lines):
diff -r c87c97321aa5 -r 9de8a2685f03 tek/lib/ui.lua
--- a/tek/lib/ui.lua Thu May 08 20:51:29 2008 +0200
+++ b/tek/lib/ui.lua Thu May 08 20:59:17 2008 +0200
@@ -48,13 +48,18 @@ local setmetatable = setmetatable
local setmetatable = setmetatable
module "tek.lib.ui"
-_VERSION = "tekUI 3.0"
+_VERSION = "tekUI 3.1"
--- get executable path and name:
-ProgDir, ProgName = arg[0]:match("^(.-/?)([^/]*)$")
+-- Old package path:
+local OldPath = package and package.path or ""
-local OldPath = package.path
-local LocalPath = ProgDir .. "?.lua;" .. OldPath
+-- Get executable path and name:
+if arg and arg[0] then
+ ProgDir, ProgName = arg[0]:match("^(.-/?)([^/]*)$")
+end
+
+-- Modified package path to find modules in the local program directory:
+LocalPath = ProgDir and ProgDir .. "?.lua;" .. OldPath or OldPath
-------------------------------------------------------------------------------
-- class = loadClass(type, name[, pattern[, loader]]):
More information about the tekui-devel
mailing list