Module: check_mk
Branch: master
Commit: 406e79d0a05a399c3cc39f749086ff93d8b0aec8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=406e79d0a05a39…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Sep 4 11:06:03 2012 +0200
Allow precomiled Python web plugins also in local dir
---
web/htdocs/lib.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py
index 5030383..5af2f44 100644
--- a/web/htdocs/lib.py
+++ b/web/htdocs/lib.py
@@ -142,8 +142,13 @@ def load_web_plugins(forwhat, globalvars):
fns = os.listdir(local_plugins_path)
fns.sort()
for fn in fns:
+ file_path = local_plugins_path + "/" + fn
if fn.endswith(".py"):
- execfile(local_plugins_path + "/" + fn, globalvars)
+ execfile(file_path, globalvars)
+ elif fn.endswith(".pyc"):
+ code_bytes = file(file_path).read()[8:]
+ code = marshal.loads(code_bytes)
+ exec code in globalvars
def get_language_dirs():
dirs = [ defaults.locale_dir ]