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/utils/silpautils.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/utils/silpautils.py')
-rw-r--r-- | silpa/utils/silpautils.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/silpa/utils/silpautils.py b/silpa/utils/silpautils.py index 02556af..25a3df8 100644 --- a/silpa/utils/silpautils.py +++ b/silpa/utils/silpautils.py @@ -14,6 +14,24 @@ def getModulesList(): if(item.startswith("SILPA_ACTION.")): action_dict[item.replace("SILPA_ACTION.","")]=conf_dict[item] return action_dict +def getStaticContent(page): + try: + return open("doc/"+page).read() + except: + return "Could not find the requested page "+ page +def handleStats(): + Hits="0" + try: + InFile = open("count.dat", "r") # Text file with total hits + Hits = InFile.readline() + except: + pass + x = int(Hits) + 1 + h = str(x) + OutFile = open("count.dat", "w") + OutFile.write(str(x)) + OutFile.close() + def loadConfiguration(): conf_dict={} conffile = codecs. open("silpa.conf",encoding='utf-8', errors='ignore') |