def scan(*roots): """Add books to library""" if len(roots) == 0: abort('Usage: fab scan:ROOT_PATH[,ROOT_PATH...]') call_roots = [] for root in roots: root = path.expanduser(root) if path.exists(root): call_roots.append(path.abspath(root)) else: abort('Path %s not exists' % root) _manage('pl_scan', "'%s'" % "' '".join(call_roots))
def fast(): """Fast tests (no db)""" _manage('test', 'ponylib --settings=ponylib.settings_no_db_tests --verbosity=2')
def test(): """All tests""" _manage('test', 'ponylib --verbosity=2')
def install(): """Upgrade project""" _manage('syncdb') _manage('migrate')
def upgrade(): """Upgrade project""" with lcd(settings.PROJECT_ROOT): local('pip install -r requirements.txt') _manage('syncdb') _manage('migrate')
def setup(): """Init or update database""" _manage('syncdb') _manage('migrate')
def drop_index(force=False): """Drop search index""" _manage('pl_drop_index')
def shell(): """Django shell""" _manage("shell")
def build_index(force=False): """Update search index""" if force: _manage('pl_rebuild_index') else: _manage('pl_build_index')
def drop_engine(): """Init or update search engine""" _manage('pl_drop_ts_engine')
def setup_engine(): """Init or update search engine""" _manage('pl_setup_ts_engine') build_index()
def cl(): """Compile locale messages""" _manage('compilemessages')
def up(): """Update locales""" _manage('makemessages', '-l en_US') _manage('makemessages', '-l ru_RU')