Changeset - c49ebe560af2
[Not reviewed]
default
0 1 0
Marcin Kuzminski - 15 years ago 2010-05-27 00:04:29
marcin@python-works.com
fixed dbmanage script to work as standalone script
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
pylons_app/lib/db_manage.py
Show inline comments
 
import logging
 
from os.path import dirname as dn
 
from sqlalchemy.engine import create_engine
 
import os
 
import sys
 
ROOT = dn(dn(dn(os.path.realpath(__file__))))
 
sys.path.append(ROOT)
 

	
 
from pylons_app.model.db import Users
 
from pylons_app.model.meta import Session
 

	
 
from pylons_app.lib.auth import get_crypt_password
 
from pylons_app.model import init_model
 

	
 
ROOT = dn(dn(dn(os.path.realpath(__file__))))
 

	
 
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s')
 
from pylons_app.model.meta import Base
 

	
 
class DbManage(object):
 
    def __init__(self):
 
        dburi = 'sqlite:////%s' % os.path.join(ROOT, 'hg_app.db')
0 comments (0 inline, 0 general)