mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-03 11:46:22 -07:00
Fix some deepsource Python style complaints
This commit is contained in:
parent
e55d00adb2
commit
f443617966
2 changed files with 11 additions and 8 deletions
16
build.py
16
build.py
|
@ -115,7 +115,7 @@ def run_cmd(cmd, print_output=True, realtime=False, print_command=False):
|
||||||
def set_vars(goos=""):
|
def set_vars(goos=""):
|
||||||
""" Sets version and GOOS-related variables to be used globally"""
|
""" Sets version and GOOS-related variables to be used globally"""
|
||||||
global gcos
|
global gcos
|
||||||
global gcos_name # used for release, since macOS GOOS is "darwin"
|
global gcos_name # used for release, since macOS GOOS is "darwin"
|
||||||
global exe
|
global exe
|
||||||
global gochan_bin
|
global gochan_bin
|
||||||
global gochan_exe
|
global gochan_exe
|
||||||
|
@ -158,7 +158,8 @@ def build(debugging=False):
|
||||||
print("Building for", gcos)
|
print("Building for", gcos)
|
||||||
build_cmd += gcflags + ldflags
|
build_cmd += gcflags + ldflags
|
||||||
|
|
||||||
status = run_cmd(build_cmd + " -o " + gochan_exe + " ./cmd/gochan",
|
status = run_cmd(
|
||||||
|
build_cmd + " -o " + gochan_exe + " ./cmd/gochan",
|
||||||
realtime=True, print_command=True)[1]
|
realtime=True, print_command=True)[1]
|
||||||
if status != 0:
|
if status != 0:
|
||||||
print("Failed building gochan, see command output for details")
|
print("Failed building gochan, see command output for details")
|
||||||
|
@ -175,7 +176,7 @@ def clean():
|
||||||
|
|
||||||
def dependencies():
|
def dependencies():
|
||||||
for dep in gc_dependencies:
|
for dep in gc_dependencies:
|
||||||
run_cmd("go get -v " + dep, realtime = True, print_command = True)
|
run_cmd("go get -v " + dep, realtime=True, print_command=True)
|
||||||
|
|
||||||
|
|
||||||
def docker(option="guestdb", attached=False):
|
def docker(option="guestdb", attached=False):
|
||||||
|
@ -188,7 +189,7 @@ def docker(option="guestdb", attached=False):
|
||||||
cmd = cmd.format("docker/docker-compose-syncForMac.yaml")
|
cmd = cmd.format("docker/docker-compose-syncForMac.yaml")
|
||||||
if attached is False:
|
if attached is False:
|
||||||
cmd += " --detach"
|
cmd += " --detach"
|
||||||
status = run_cmd(cmd, print_output = True, realtime = True, print_command = True)[1]
|
status = run_cmd(cmd, print_output=True, realtime=True, print_command=True)[1]
|
||||||
if status != 0:
|
if status != 0:
|
||||||
print("Failed starting a docker container, exited with status code", status)
|
print("Failed starting a docker container, exited with status code", status)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
@ -297,7 +298,7 @@ def sass(minify=False, watch=False):
|
||||||
if watch:
|
if watch:
|
||||||
sass_cmd += "--watch "
|
sass_cmd += "--watch "
|
||||||
sass_cmd += "sass:html/css"
|
sass_cmd += "sass:html/css"
|
||||||
status = run_cmd(sass_cmd, realtime = True, print_command = True)[1]
|
status = run_cmd(sass_cmd, realtime=True, print_command=True)[1]
|
||||||
if status != 0:
|
if status != 0:
|
||||||
print("Failed running sass with status", status)
|
print("Failed running sass with status", status)
|
||||||
sys.exit(status)
|
sys.exit(status)
|
||||||
|
@ -306,7 +307,7 @@ def sass(minify=False, watch=False):
|
||||||
def test():
|
def test():
|
||||||
pkgs = os.listdir("pkg")
|
pkgs = os.listdir("pkg")
|
||||||
for pkg in pkgs:
|
for pkg in pkgs:
|
||||||
run_cmd("go test " + path.join("./pkg", pkg), realtime = True, print_command = True)
|
run_cmd("go test " + path.join("./pkg", pkg), realtime=True, print_command=True)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -357,7 +358,8 @@ if __name__ == "__main__":
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("Received keyboard interrupt, exiting")
|
print("Received keyboard interrupt, exiting")
|
||||||
elif action == "install":
|
elif action == "install":
|
||||||
parser.add_argument("--js",
|
parser.add_argument(
|
||||||
|
"--js",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
help="only install JavaScript (useful for frontend development)")
|
help="only install JavaScript (useful for frontend development)")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
|
|
|
@ -11,7 +11,8 @@ class macro():
|
||||||
|
|
||||||
# macros
|
# macros
|
||||||
macros = [
|
macros = [
|
||||||
macro("serial pk","BIGSERIAL PRIMARY KEY",
|
macro(
|
||||||
|
"serial pk","BIGSERIAL PRIMARY KEY",
|
||||||
"BIGINT NOT NULL AUTO_INCREMENT UNIQUE PRIMARY KEY"),
|
"BIGINT NOT NULL AUTO_INCREMENT UNIQUE PRIMARY KEY"),
|
||||||
macro("fk to serial", "BIGINT", "BIGINT"),
|
macro("fk to serial", "BIGINT", "BIGINT"),
|
||||||
macro("drop fk", "DROP CONSTRAINT", "DROP FOREIGN KEY")
|
macro("drop fk", "DROP CONSTRAINT", "DROP FOREIGN KEY")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue