Commit e8a5b0b2 authored by Fabien Amarger's avatar Fabien Amarger
Browse files

fix(black)

parent b0bf397b8847
Pipeline #88903 canceled with stages
in 2 minutes and 22 seconds
......@@ -122,6 +122,7 @@
return schema
def run_and_print_if_error(command):
res = subprocess.run(command, shell=True, capture_output=True)
if res.returncode != 0:
......@@ -164,8 +165,10 @@
f"creating the cube inside the folder {cube_master_folder}/ "
"(the schema is there)"
)
create_cube = (f'cubicweb-ctl newcube {args.instance_name}'
' -s "cube representating {args.owl_model}"')
create_cube = (
f"cubicweb-ctl newcube {args.instance_name}"
' -s "cube representating {args.owl_model}"'
)
run_and_print_if_error(create_cube)
cube_subfolder = cube_master_folder.replace("-", "_")
......@@ -180,7 +183,9 @@
f"creating the instance {args.instance_name}. "
f"The parameters are in ~/etc/cubicweb.d/{args.instance_name}/"
)
create_instance = ("CW_DB_DRIVER=sqlite cubicweb-ctl create "
f"{args.instance_name} {args.instance_name} -a --no-db-create")
create_instance = (
"CW_DB_DRIVER=sqlite cubicweb-ctl create "
f"{args.instance_name} {args.instance_name} -a --no-db-create"
)
run_and_print_if_error(create_instance)
......@@ -185,6 +190,8 @@
run_and_print_if_error(create_instance)
db_init = ("CW_DB_DRIVER=sqlite cubicweb-ctl db-create "
f"{args.instance_name} -a --drop=y")
db_init = (
"CW_DB_DRIVER=sqlite cubicweb-ctl db-create "
f"{args.instance_name} -a --drop=y"
)
run_and_print_if_error(db_init)
......@@ -189,4 +196,4 @@
run_and_print_if_error(db_init)
source_path = os.path.expanduser(f'~/etc/cubicweb.d/{args.instance_name}/sources')
source_path = os.path.expanduser(f"~/etc/cubicweb.d/{args.instance_name}/sources")
# The source file has to be modified to include sqlite
......@@ -192,5 +199,5 @@
# The source file has to be modified to include sqlite
driver_regexp = re.compile('db-driver.*')
admin_pass = re.compile('password=(.*)')
with open(source_path, 'r') as f:
driver_regexp = re.compile("db-driver.*")
admin_pass = re.compile("password=(.*)")
with open(source_path, "r") as f:
content = f.read()
......@@ -196,4 +203,4 @@
content = f.read()
replaced_content = driver_regexp.sub('db-driver=sqlite', content)
replaced_content = driver_regexp.sub("db-driver=sqlite", content)
admin_pwd = next(admin_pass.finditer(content)).group(1)
......@@ -198,6 +205,6 @@
admin_pwd = next(admin_pass.finditer(content)).group(1)
with open(source_path, 'w') as f:
with open(source_path, "w") as f:
f.write(replaced_content)
print(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment