summaryrefslogtreecommitdiff
path: root/cgi-bin/path.py
diff options
context:
space:
mode:
Diffstat (limited to 'cgi-bin/path.py')
-rw-r--r--cgi-bin/path.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/cgi-bin/path.py b/cgi-bin/path.py
new file mode 100644
index 0000000..ac1ed5a
--- /dev/null
+++ b/cgi-bin/path.py
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+import config
+from config import Config
+
+root = Config.get("route", "url")
+imgsDir = Config.get("route", "imgs_dir")
+templDir = Config.get("route", "templ_dir")
+
+class Path(object):
+ # 拼接url
+ def url(path):
+ return root + path
+
+ # 保存的图片路径
+ def img(imgFile):
+ return root + imgsDir + imgFile
+
+ # html模板路径
+ def template(templ):
+ return templDir + templ
+