Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

v0.9, simplify config, clean template

  • Loading branch information...
commit e69e47148d637f156199e50bbbd7b2e88d78d39e 1 parent a6e7816
@nopri authored
View
12 app.py
@@ -67,12 +67,14 @@ def cget(section, option, default='', strip=True):
############################### CONSTANT ###############################
-VERSION = '0.8'
+VERSION = '0.9'
NAME = 'Online Store'
PRECISION = 2
FORCE_PROMOTE = False
PS = os.path.sep
CURDIR = os.path.dirname(__file__)
+TEMPLATE_DIR = CURDIR + PS + 'template'
+DOC_ADMIN = CURDIR + PS + 'README.txt'
CONFIG_FILE_DEFAULT = 'config.ini'
DOMAIN = cget('account', 'domain')
BASEURL_DEFAULT = '/store'
@@ -490,7 +492,7 @@ def pget(option, default='', strip=True, callback=None):
def tget(page, globals={}):
p = page + '.html'
- tdir = cget('template', 'dir')
+ tdir = TEMPLATE_DIR
tdd = tdir + PS + TEMPLATE_DEFAULT
tdc = tdd + PS + p
tud = tdir + PS + pget('template', default=TEMPLATE_DEFAULT)
@@ -1350,7 +1352,7 @@ def dcur(id=0, field='*', pget_helper=''):
def atpl():
ret = []
- tdir = cget('template', 'dir')
+ tdir = TEMPLATE_DIR
files = os.listdir(tdir)
for i in files:
info = tinfo(i)
@@ -1816,7 +1818,7 @@ def dstat(date_from='', date_to=''):
def tinfo(template, separator=','):
ret = {}
#
- tdir = cget('template', 'dir')
+ tdir = TEMPLATE_DIR
info = tdir + PS + template + PS + 'info'
#
t = ConfigParser.ConfigParser()
@@ -3892,7 +3894,7 @@ def POST(self):
class admin_doc:
def GET(self):
- f = cget('doc', 'admin')
+ f = DOC_ADMIN
if not f or not os.path.exists(f):
raise web.seeother('/admin')
else:
View
21 config.ini.dist
@@ -2,7 +2,6 @@
#domain: domain name without http/https
[account]
domain =
-value = 200
cart = True
user_content = True
blog = True
@@ -22,34 +21,24 @@ name = onlinestore
#SMTP setting, for sending email
#smtp: host
#user: smtp user
-#default: send as this user (shows in email)
+#default: send as this user (for example: info@domain.tld)
[mail]
smtp =
user =
pass =
-default = info@
-webmail =
+default =
#Session
#dir: session directory
[session]
dir = /tmp/onlinestore-multi-session/
-#Template
-#dir: template directory, please replace /path/to
-[template]
-dir = /path/to/onlinestore-multi/template/
-
-#URL
+#URL
+#base: base URL
[url]
base = /
#Font
-#dir: font directory, containing TTF font file(s)
+#dir: directory contains TTF font file(s), or default font will be used
[font]
dir = /usr/share/fonts/truetype/freefont/
-
-#doc
-#admin: admin documentation
-[doc]
-admin = /path/to/onlinestore-multi/README.txt
View
1  template/default-blue/info
@@ -1,5 +1,4 @@
[general]
-level = 0
owner =
[info]
View
1  template/default/info
@@ -1,5 +1,4 @@
[general]
-level = 0
owner =
[info]
View
1  template/default2-blue/info
@@ -1,5 +1,4 @@
[general]
-level = 0
owner =
[info]
View
1  template/default2/info
@@ -1,5 +1,4 @@
[general]
-level = 0
owner =
[info]
Please sign in to comment.
Something went wrong with that request. Please try again.