mirror of
https://github.com/diodeinc/pcb.git
synced 2026-09-14 20:17:19 +08:00
4413c9d4d9
* Hydrate V2 deps during migrate * Fix mixed hydrated package resolution * Simplify workspace discovery * Clean up workspace package discovery naming * Update stdlib formatting paths
40 lines
1.3 KiB
Python
40 lines
1.3 KiB
Python
io = builtin.io
|
|
|
|
|
|
def input(
|
|
name_or_typ,
|
|
typ=None,
|
|
checks=None,
|
|
default=None,
|
|
optional=False,
|
|
help=None,
|
|
):
|
|
name = name_or_typ if typ != None else None
|
|
typ = typ if typ != None else name_or_typ
|
|
if name != None:
|
|
if checks != None:
|
|
return io(name, typ, checks, default=default, optional=optional, help=help, direction="input")
|
|
return io(name, typ, default=default, optional=optional, help=help, direction="input")
|
|
if checks != None:
|
|
return io(typ, checks, default=default, optional=optional, help=help, direction="input")
|
|
return io(typ, default=default, optional=optional, help=help, direction="input")
|
|
|
|
|
|
def output(
|
|
name_or_typ,
|
|
typ=None,
|
|
checks=None,
|
|
default=None,
|
|
optional=False,
|
|
help=None,
|
|
):
|
|
name = name_or_typ if typ != None else None
|
|
typ = typ if typ != None else name_or_typ
|
|
if name != None:
|
|
if checks != None:
|
|
return io(name, typ, checks, default=default, optional=optional, help=help, direction="output")
|
|
return io(name, typ, default=default, optional=optional, help=help, direction="output")
|
|
if checks != None:
|
|
return io(typ, checks, default=default, optional=optional, help=help, direction="output")
|
|
return io(typ, default=default, optional=optional, help=help, direction="output")
|