Format api file

This commit is contained in:
wqy
2022-09-03 01:13:31 +08:00
parent cb429ad822
commit 122f3ebddc

View File

@@ -1,5 +1,10 @@
import api
############################################################
# enum
############################################################
JUNCTION = "JUNCTION"
RESERVOIR = "RESERVOIR"
TANK = "TANK"
@@ -7,7 +12,10 @@ PIPE = "PIPE"
PUMP = "PUMP"
VALVE = "VALVE"
############################################################
# project
############################################################
def have_project(name: str) -> bool:
return api.have_project(name)
@@ -27,7 +35,10 @@ def open_project(name: str) -> None:
def close_project(name: str) -> None:
return api.close_project(name)
############################################################
# operation
############################################################
def undo(name: str) -> None:
return api.undo(name)
@@ -35,7 +46,10 @@ def undo(name: str) -> None:
def redo(name: str) -> None:
return api.redo(name)
# 0.base
############################################################
# type
############################################################
def is_node(name: str, node_id: str) -> bool:
return api.is_node(name, node_id)
@@ -67,14 +81,22 @@ def is_curve(name: str, curve_id: str) -> bool:
def is_pattern(name: str, pattern_id: str) -> bool:
return api.is_pattern(name, pattern_id)
# 1.title
############################################################
# title 1.[TITLE]
############################################################
def set_title(name: str, title: str) -> None:
return api.set_title(name, title)
def get_title(name: str) -> str:
return api.get_title(name)
# 2.junction
############################################################
# junction 2.[JUNCTIONS]
############################################################
def add_junction(name: str, junction_id: str, x: float, y: float, elevation: float) -> None:
return api.add_junction(name, junction_id, x, y, elevation)