d
This commit is contained in:
20
Utilities/platform/2/generation/pipeSource.py
Normal file
20
Utilities/platform/2/generation/pipeSource.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from generation.isNotKeyword import *
|
||||
|
||||
def pipeSource(name, entity):
|
||||
props = entity.pipes[name]
|
||||
if "vm" in props:
|
||||
return "core.vm." + name
|
||||
elif "$vm" in props:
|
||||
return "core.vm.$" + name
|
||||
else:
|
||||
# Если это что-то неизвестное заранее, то ищем строку,
|
||||
# отличную от известных ключевых слов для инструкции pipe.
|
||||
default = "world"
|
||||
src = next(filter(isNotKeyword, props), default)
|
||||
# Прямое обращение к VM.
|
||||
if src.startswith("vm."):
|
||||
src = "core." + src
|
||||
# Значение по умолчанию.
|
||||
elif src == default:
|
||||
return default + "." + name
|
||||
return src
|
||||
Reference in New Issue
Block a user