add utils modul

This commit is contained in:
Andreas Stephanides
2017-08-29 00:19:30 +02:00
parent 3263bec344
commit 434bfbff18
2 changed files with 9 additions and 5 deletions

View File

@@ -6,6 +6,10 @@ from config import Config
import os import os
import re import re
from os.path import isfile, abspath from os.path import isfile, abspath
from utils import pjoin2
from utils import pjoin
package_directory = os.path.dirname(os.path.abspath(__file__)) package_directory = os.path.dirname(os.path.abspath(__file__))
#cfg = Config(file('./config.cfg')) #cfg = Config(file('./config.cfg'))
@@ -106,11 +110,6 @@ def get_flatpage(path):
return (is_index, path, page) 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): def misskey(a,key):
if not a.has_key(key): if not a.has_key(key):

5
utils.py Normal file
View File

@@ -0,0 +1,5 @@
def pjoin (rt,pth):
return u'{}/{}'.format(rt,pth)
def pjoin2 (pth):
return u'/'.join(pth) or u''