Mercurial > public > src > rhodecode
comparison pylons_app/lib/db_manage.py @ 228:c49ebe560af2
fixed dbmanage script to work as standalone script
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 27 May 2010 00:04:29 +0200 |
parents | c6526b7531e9 |
children | 69a29242ba61 |
comparison
equal
deleted
inserted
replaced
227:351013049742 | 228:c49ebe560af2 |
---|---|
1 import logging | 1 import logging |
2 from os.path import dirname as dn | 2 from os.path import dirname as dn |
3 from sqlalchemy.engine import create_engine | 3 from sqlalchemy.engine import create_engine |
4 import os | 4 import os |
5 import sys | |
6 ROOT = dn(dn(dn(os.path.realpath(__file__)))) | |
7 sys.path.append(ROOT) | |
8 | |
5 from pylons_app.model.db import Users | 9 from pylons_app.model.db import Users |
6 from pylons_app.model.meta import Session | 10 from pylons_app.model.meta import Session |
7 | 11 |
8 from pylons_app.lib.auth import get_crypt_password | 12 from pylons_app.lib.auth import get_crypt_password |
9 from pylons_app.model import init_model | 13 from pylons_app.model import init_model |
10 | 14 |
11 ROOT = dn(dn(dn(os.path.realpath(__file__)))) | 15 |
12 logging.basicConfig(level=logging.DEBUG, format='%(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s') | 16 logging.basicConfig(level=logging.DEBUG, format='%(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s') |
13 from pylons_app.model.meta import Base | 17 from pylons_app.model.meta import Base |
14 | 18 |
15 class DbManage(object): | 19 class DbManage(object): |
16 def __init__(self): | 20 def __init__(self): |