From c1803a7603135e2c148d89d5e05596f5d251842a Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 31 Jan 2018 18:27:58 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cgi-bin/path.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 cgi-bin/path.py (limited to 'cgi-bin/path.py') 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 + -- cgit v1.1-26-g67d0