##// END OF EJS Templates
litle html updates for changeset
litle html updates for changeset

File last commit:

r327:0e87466a default
r332:40b409af default
Show More
websetup.py
49 lines | 1.3 KiB | text/x-python | PythonLexer
Marcin Kuzminski
initial commit.
r0 """Setup the pylons_app application"""
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
r327
from os.path import dirname as dn, join as jn
from pylons_app.config.environment import load_environment
from pylons_app.lib.db_manage import DbManage
Marcin Kuzminski
initial commit.
r0 import logging
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
r327 import os
import sys
Marcin Kuzminski
initial commit.
r0 log = logging.getLogger(__name__)
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
r327 ROOT = dn(dn(os.path.realpath(__file__)))
sys.path.append(ROOT)
def setup_repository():
log.info('Seting up repositories.config')
fname = 'repositories.config'
try:
tmpl = open(jn(ROOT, 'pylons_app', 'config', 'repositories.config_tmpl')).read()
except IOError:
raise
path = raw_input('Specify valid full path to your repositories'
' you can change this later in repositories.config file:')
if not os.path.isdir(path):
log.error('You entered wrong path')
sys.exit()
path = jn(path, '*')
dest_path = jn(ROOT, fname)
f = open(dest_path, 'wb')
f.write(tmpl % {'repo_location':path})
f.close()
log.info('created repositories.config in %s', dest_path)
Marcin Kuzminski
initial commit.
r0
def setup_app(command, conf, vars):
"""Place any commands to setup pylons_app here"""
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
r327 setup_repository()
dbmanage = DbManage(log_sql=True)
dbmanage.create_tables(override=True)
dbmanage.admin_prompt()
dbmanage.create_permissions()
Marcin Kuzminski
initial commit.
r0 load_environment(conf.global_conf, conf.local_conf)
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
r327