diff options
author | chai <chaifix@163.com> | 2018-07-13 21:53:49 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-07-13 21:53:49 +0800 |
commit | 7ca80e57f06922e464626c7a6a1d7965e716b53f (patch) | |
tree | bda9271234720424b7dfc5c2d25b9df4ba3d01df /path.py | |
parent | 181b206863d3765fe5343ceea8e1e00e52ffba9e (diff) |
Diffstat (limited to 'path.py')
-rw-r--r-- | path.py | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +import config +from config import Config + +root = Config.get("route", "url") +imgsDir = Config.get("route", "images") +templDir = Config.get("route", "templates") +disk = Config.get("route", "disk") + +class Path(object): + # 拼接url + def url(path): + return root + '/' + path + + # 图片url + def img(imgFile): + return root + imgsDir + '/' + imgFile + + # 图片硬盘路径 + def imgpath(imgFile): + return disk + imgsDir + '/' + imgFile + + # html模板硬盘路径 + def template(templ): + return templDir + '/' + templ + |