From 434bfbff189ae1c95cd69a9caa462fd4a0c4903c Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Tue, 29 Aug 2017 00:19:30 +0200 Subject: [PATCH] add utils modul --- __init__.py | 9 ++++----- utils.py | 5 +++++ 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 utils.py diff --git a/__init__.py b/__init__.py index e7dfa12..f82657e 100644 --- a/__init__.py +++ b/__init__.py @@ -6,6 +6,10 @@ from config import Config import os import re from os.path import isfile, abspath +from utils import pjoin2 +from utils import pjoin + + package_directory = os.path.dirname(os.path.abspath(__file__)) #cfg = Config(file('./config.cfg')) @@ -106,11 +110,6 @@ def get_flatpage(path): return (is_index, path, page) -def pjoin (rt,pth): - return u'{}/{}'.format(rt,pth) - -def pjoin2 (pth): - return u'/'.join(pth) or u'' def misskey(a,key): if not a.has_key(key): diff --git a/utils.py b/utils.py new file mode 100644 index 0000000..df36e62 --- /dev/null +++ b/utils.py @@ -0,0 +1,5 @@ +def pjoin (rt,pth): + return u'{}/{}'.format(rt,pth) + +def pjoin2 (pth): + return u'/'.join(pth) or u''