debug
This commit is contained in:
@@ -26,10 +26,12 @@ def have_project(name: str) -> bool:
|
||||
def copy_project(source: str, new: str) -> None:
|
||||
with pg.connect(conninfo="dbname=postgres host=127.0.0.1", autocommit=True) as conn:
|
||||
with conn.cursor() as cur:
|
||||
print('copy')
|
||||
cur.execute(f"create database {new} with template = {source}")
|
||||
|
||||
|
||||
def create_project(name: str) -> None:
|
||||
print('create')
|
||||
return copy_project('project', name)
|
||||
|
||||
|
||||
@@ -57,9 +59,6 @@ def clean_project(excluded: list[str] = []) -> None:
|
||||
|
||||
|
||||
def open_project(name: str) -> None:
|
||||
if not have_project(name):
|
||||
create_project(name)
|
||||
|
||||
if name not in conn:
|
||||
conn[name] = pg.connect(conninfo=f"dbname={name} host=127.0.0.1", autocommit=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user