Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)

        def load_migrations(basedir):
    import imp
    from uuid import uuid4
    result = {}
    for filename in os.listdir(basedir):
        if not filename.endswith('.pigrate.py'):
            continue
        tokens = filename[:-len('.pigrate.py')].split('-')
        if len(tokens) < 2:
            continue
        migration = Pigration(int(tokens[0]), '-'.join(tokens[1:]), imp.load_source(uuid4().get_hex(), os.path.join(basedir, filename)))
        if migration.id in result:
            raise PigrateError("'{0}' and '{1}' have the same timestamp".format(migration, result[migration.id]))
        result[migration.id] = migration
    return result
        


src/p/i/pigrate-0.0.3/pigrate/command.py   pigrate(Download)
    # avoid timestamp collision
    id = internal.util.current_utc_millis()
    while id in internal.load_migrations(basedir):
        id = id + 1
    time.sleep(0.001)
def up(basedir, env, interactive=False):
    config = internal.load_config(basedir, env)
    _ensure_pig_status_table(config)
 
    migs = internal.load_migrations(basedir)
def down(basedir, env, interactive=False):
    config = internal.load_config(basedir, env)
    _ensure_pig_status_table(config)
 
    migs = internal.load_migrations(basedir)
def status(basedir, env, interactive=NOT_USED):
    config = internal.load_config(basedir, env)
 
    migs = internal.load_migrations(basedir)
    statuses = _collect_migration_statuses(config)