diff options
author | Santhosh Thottingal <santhosh.thottingal@gmail.com> | 2009-05-24 13:04:44 +0530 |
---|---|---|
committer | Santhosh Thottingal <santhosh.thottingal@gmail.com> | 2009-05-24 13:04:44 +0530 |
commit | 30c1b89bec818490131780389c918f8bcfb7aef6 (patch) | |
tree | d0a5b076a8781247932e7b507124705f9f3e2f03 /silpa/index.py | |
parent | 5a2dfd79178371a529053795d90b48dd96421d88 (diff) | |
download | Rachana.git-30c1b89bec818490131780389c918f8bcfb7aef6.tar.gz Rachana.git-30c1b89bec818490131780389c918f8bcfb7aef6.tar.xz Rachana.git-30c1b89bec818490131780389c918f8bcfb7aef6.zip |
Miscellaneous bug fixes, hit counter, static pages
Diffstat (limited to 'silpa/index.py')
-rwxr-xr-x[-rw-r--r--] | silpa/index.py | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/silpa/index.py b/silpa/index.py index 8a44a15..ccffe09 100644..100755 --- a/silpa/index.py +++ b/silpa/index.py @@ -1,4 +1,4 @@ -#!/home/.laboring/smcweb/bin/python +#!/usr/bin/python # -*- coding: utf-8 -*- from common import * @@ -12,21 +12,28 @@ def index(form): action=form['action'].value else: action=None + handleStats() response=SilpaResponse() if(action): module_manager=ModuleManager() action=action.replace(" ","_") - module_instance = module_manager.getModuleInstance(action) - if(module_instance): - response.setBreadcrumb(module_instance.get_module_name()) - response.setContent(module_instance.process(form)) - response.setErrorMessage(module_instance.get_errormessage()) - response.setSuccessMessage(module_instance.get_successmessage()) - else: - response.setBreadcrumb("Coming Soon") - response.setErrorMessage("Module not available") - response.setContent(None) - response.setSuccessMessage(None) + if action.endswith('.html') or action.endswith('.htm'): + response.setBreadcrumb(None) + response.setContent(getStaticContent(action)) + response.setErrorMessage(None) + response.setSuccessMessage(None) + else: + module_instance = module_manager.getModuleInstance(action) + if(module_instance): + response.setBreadcrumb(module_instance.get_module_name()) + response.setContent(module_instance.process(form)) + response.setErrorMessage(module_instance.get_errormessage()) + response.setSuccessMessage(module_instance.get_successmessage()) + else: + response.setBreadcrumb("Coming Soon") + response.setErrorMessage("Module not available") + response.setContent(None) + response.setSuccessMessage(None) else: #index module_manager=ModuleManager() response.setBreadcrumb("Welcome") |