diff --git a/shell/gen_protobuf.py b/shell/gen_protobuf.py index 29d62be..0de1aaa 100644 --- a/shell/gen_protobuf.py +++ b/shell/gen_protobuf.py @@ -3,7 +3,7 @@ import os import yaml sysPath = os.getcwd() -tempPath = f"{sysPath}/pkg/storage/temp" +tempPath = f"{sysPath}/storage/temp" structurePath = f"{sysPath}/pkg/structure" protobufPath = f"{sysPath}/protobuf" @@ -30,9 +30,8 @@ def load_conf(): # 生成对应的数据结构proto文件 def mk_structure(cfg_camel): - path = "protobuf" for key, value in cfg_camel.items(): - proto_path = path + '/' + key + '.proto' + proto_path = f"{protobufPath}/{key}.proto" if not os.path.exists(proto_path): # 如果这个文件不存在 '''生成对应的数据结构proto文件''' file = open(proto_path, 'w') @@ -80,6 +79,6 @@ def mk_storage(cfg_camel): if __name__ == "__main__": - conf, cfg_camel = load_conf() + _, cfg_camel = load_conf() mk_structure(cfg_camel) # 生成对应的数据结构proto文件 mk_storage(cfg_camel)