def make_db(db_name, prefix="/private", pg_src="/private/src/postgis-1.5.3" ): sys_call(["%s/bin/createdb" % prefix, db_name]) sys_call(["%s/bin/psql" % prefix, "-d", db_name, "-f", "%s/postgis/postgis.sql" % pg_src]) sys_call(["%s/bin/psql" % prefix, "-d", db_name, "-f", "%s/spatial_ref_sys.sql" % pg_src])
def drop_db(db_name, prefix="/private"): sys_call(["%s/bin/dropdb" % prefix, db_name])