feat(structure): add gen-tools

This commit is contained in:
bandl 2021-09-19 10:37:30 +08:00
parent 8714fc8b8f
commit c1ca0a499f
11 changed files with 217 additions and 143 deletions

View File

@ -29,7 +29,7 @@ func init() {
func setDefaultConfValue() { func setDefaultConfValue() {
// 设置一些默认值 // 设置一些默认值
viper.Set("version", "base-01") viper.SetDefault("version", "base-01")
} }
func LoadConf(path string) error { func LoadConf(path string) error {

View File

@ -20,4 +20,7 @@ dev:
.PHONY: gen-struct .PHONY: gen-struct
gen-struct: gen-struct:
@python3 ./shell/make-struct.py @python3 ./shell/make-struct.py
@gofmt -w $(BASE_PATH)/structure/generate/structure.gen.go
.PHONY: gen-protobuf
gen-protobuf:
@python3 ./shell/gen_protobuf.py

View File

@ -20,7 +20,7 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
) )
type StringXSet struct { type Set struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
@ -29,8 +29,8 @@ type StringXSet struct {
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
} }
func (x *StringXSet) Reset() { func (x *Set) Reset() {
*x = StringXSet{} *x = Set{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_stringx_proto_msgTypes[0] mi := &file_stringx_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -38,13 +38,13 @@ func (x *StringXSet) Reset() {
} }
} }
func (x *StringXSet) String() string { func (x *Set) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*StringXSet) ProtoMessage() {} func (*Set) ProtoMessage() {}
func (x *StringXSet) ProtoReflect() protoreflect.Message { func (x *Set) ProtoReflect() protoreflect.Message {
mi := &file_stringx_proto_msgTypes[0] mi := &file_stringx_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -56,26 +56,26 @@ func (x *StringXSet) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use StringXSet.ProtoReflect.Descriptor instead. // Deprecated: Use Set.ProtoReflect.Descriptor instead.
func (*StringXSet) Descriptor() ([]byte, []int) { func (*Set) Descriptor() ([]byte, []int) {
return file_stringx_proto_rawDescGZIP(), []int{0} return file_stringx_proto_rawDescGZIP(), []int{0}
} }
func (x *StringXSet) GetKey() *BaseKey { func (x *Set) GetKey() *BaseKey {
if x != nil { if x != nil {
return x.Key return x.Key
} }
return nil return nil
} }
func (x *StringXSet) GetValue() string { func (x *Set) GetValue() string {
if x != nil { if x != nil {
return x.Value return x.Value
} }
return "" return ""
} }
type StringxGet struct { type Get struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
@ -83,8 +83,8 @@ type StringxGet struct {
Key *BaseKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Key *BaseKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
} }
func (x *StringxGet) Reset() { func (x *Get) Reset() {
*x = StringxGet{} *x = Get{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_stringx_proto_msgTypes[1] mi := &file_stringx_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -92,13 +92,13 @@ func (x *StringxGet) Reset() {
} }
} }
func (x *StringxGet) String() string { func (x *Get) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*StringxGet) ProtoMessage() {} func (*Get) ProtoMessage() {}
func (x *StringxGet) ProtoReflect() protoreflect.Message { func (x *Get) ProtoReflect() protoreflect.Message {
mi := &file_stringx_proto_msgTypes[1] mi := &file_stringx_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -110,12 +110,12 @@ func (x *StringxGet) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use StringxGet.ProtoReflect.Descriptor instead. // Deprecated: Use Get.ProtoReflect.Descriptor instead.
func (*StringxGet) Descriptor() ([]byte, []int) { func (*Get) Descriptor() ([]byte, []int) {
return file_stringx_proto_rawDescGZIP(), []int{1} return file_stringx_proto_rawDescGZIP(), []int{1}
} }
func (x *StringxGet) GetKey() *BaseKey { func (x *Get) GetKey() *BaseKey {
if x != nil { if x != nil {
return x.Key return x.Key
} }
@ -127,10 +127,10 @@ type StringxComm struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
// Types that are assignable to StringXComm: // Types that are assignable to Comm:
// *StringxComm_Get // *StringxComm_Get
// *StringxComm_Set // *StringxComm_Set
StringXComm isStringxComm_StringXComm `protobuf_oneof:"string_x_comm"` Comm isStringxComm_Comm `protobuf_oneof:"comm"`
} }
func (x *StringxComm) Reset() { func (x *StringxComm) Reset() {
@ -165,62 +165,60 @@ func (*StringxComm) Descriptor() ([]byte, []int) {
return file_stringx_proto_rawDescGZIP(), []int{2} return file_stringx_proto_rawDescGZIP(), []int{2}
} }
func (m *StringxComm) GetStringXComm() isStringxComm_StringXComm { func (m *StringxComm) GetComm() isStringxComm_Comm {
if m != nil { if m != nil {
return m.StringXComm return m.Comm
} }
return nil return nil
} }
func (x *StringxComm) GetGet() *StringXSet { func (x *StringxComm) GetGet() *Set {
if x, ok := x.GetStringXComm().(*StringxComm_Get); ok { if x, ok := x.GetComm().(*StringxComm_Get); ok {
return x.Get return x.Get
} }
return nil return nil
} }
func (x *StringxComm) GetSet() *StringxGet { func (x *StringxComm) GetSet() *Get {
if x, ok := x.GetStringXComm().(*StringxComm_Set); ok { if x, ok := x.GetComm().(*StringxComm_Set); ok {
return x.Set return x.Set
} }
return nil return nil
} }
type isStringxComm_StringXComm interface { type isStringxComm_Comm interface {
isStringxComm_StringXComm() isStringxComm_Comm()
} }
type StringxComm_Get struct { type StringxComm_Get struct {
Get *StringXSet `protobuf:"bytes,1,opt,name=get,proto3,oneof"` Get *Set `protobuf:"bytes,1,opt,name=get,proto3,oneof"`
} }
type StringxComm_Set struct { type StringxComm_Set struct {
Set *StringxGet `protobuf:"bytes,2,opt,name=set,proto3,oneof"` Set *Get `protobuf:"bytes,2,opt,name=set,proto3,oneof"`
} }
func (*StringxComm_Get) isStringxComm_StringXComm() {} func (*StringxComm_Get) isStringxComm_Comm() {}
func (*StringxComm_Set) isStringxComm_StringXComm() {} func (*StringxComm_Set) isStringxComm_Comm() {}
var File_stringx_proto protoreflect.FileDescriptor var File_stringx_proto protoreflect.FileDescriptor
var file_stringx_proto_rawDesc = []byte{ var file_stringx_proto_rawDesc = []byte{
0x0a, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x0a, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3e, 0x0a, 0x0a, 0x53, 0x0a, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x37, 0x0a, 0x03, 0x53,
0x74, 0x72, 0x69, 0x6e, 0x67, 0x58, 0x53, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x08, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x28, 0x0a, 0x0a, 0x53, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x21, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b,
0x74, 0x72, 0x69, 0x6e, 0x67, 0x78, 0x47, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x49, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x69, 0x6e,
0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x60, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x78, 0x67, 0x78, 0x43, 0x6f, 0x6d, 0x6d, 0x12, 0x18, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20,
0x43, 0x6f, 0x6d, 0x6d, 0x12, 0x1f, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x53, 0x65, 0x74, 0x48, 0x00, 0x52, 0x03, 0x67, 0x65, 0x74,
0x0b, 0x32, 0x0b, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x58, 0x53, 0x65, 0x74, 0x48, 0x00, 0x12, 0x18, 0x0a, 0x03, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e,
0x52, 0x03, 0x67, 0x65, 0x74, 0x12, 0x1f, 0x0a, 0x03, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x47, 0x65, 0x74, 0x48, 0x00, 0x52, 0x03, 0x73, 0x65, 0x74, 0x42, 0x06, 0x0a, 0x04, 0x63, 0x6f,
0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x78, 0x47, 0x65, 0x74, 0x48, 0x6d, 0x6d, 0x42, 0x0b, 0x5a, 0x09, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x00, 0x52, 0x03, 0x73, 0x65, 0x74, 0x42, 0x0f, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x5f, 0x78, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x42, 0x0b, 0x5a, 0x09, 0x70, 0x6b, 0x67, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -237,16 +235,16 @@ func file_stringx_proto_rawDescGZIP() []byte {
var file_stringx_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_stringx_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_stringx_proto_goTypes = []interface{}{ var file_stringx_proto_goTypes = []interface{}{
(*StringXSet)(nil), // 0: StringXSet (*Set)(nil), // 0: Set
(*StringxGet)(nil), // 1: StringxGet (*Get)(nil), // 1: Get
(*StringxComm)(nil), // 2: StringxComm (*StringxComm)(nil), // 2: StringxComm
(*BaseKey)(nil), // 3: BaseKey (*BaseKey)(nil), // 3: BaseKey
} }
var file_stringx_proto_depIdxs = []int32{ var file_stringx_proto_depIdxs = []int32{
3, // 0: StringXSet.key:type_name -> BaseKey 3, // 0: Set.key:type_name -> BaseKey
3, // 1: StringxGet.key:type_name -> BaseKey 3, // 1: Get.key:type_name -> BaseKey
0, // 2: StringxComm.get:type_name -> StringXSet 0, // 2: StringxComm.get:type_name -> Set
1, // 3: StringxComm.set:type_name -> StringxGet 1, // 3: StringxComm.set:type_name -> Get
4, // [4:4] is the sub-list for method output_type 4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type 4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name 4, // [4:4] is the sub-list for extension type_name
@ -262,7 +260,7 @@ func file_stringx_proto_init() {
file_base_proto_init() file_base_proto_init()
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_stringx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_stringx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StringXSet); i { switch v := v.(*Set); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -274,7 +272,7 @@ func file_stringx_proto_init() {
} }
} }
file_stringx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_stringx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StringxGet); i { switch v := v.(*Get); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:

View File

@ -0,0 +1,34 @@
// Code generated by gen-struct. DO NOT EDIT.
// make gen-struct generated
package generate
const (
DEFAULT_KEY = iota
{% for key in keys %}
{{key}}
{% endfor %}
)
const (
DEFAULT_COMM = iota
{% for key in sets %}
{{key}}
{% endfor %}
)
var CommKeyString = map[string]int {
{% for kmp in key_maps %}
{% for comm in kmp.val %}
"{{comm}}": {{kmp.key}},
{% endfor %}
{% endfor %}
}
var CommKey = map[int]int {
{% for kmp in key_maps %}
{% for comm in kmp.upper %}
{{comm}}: {{kmp.key}},
{% endfor %}
{% endfor %}
}

View File

@ -5,37 +5,72 @@ package generate
const ( const (
DEFAULT_KEY = iota DEFAULT_KEY = iota
STRING_X STRING_X
LIST_X
) )
const ( const (
DEFAULT_COMM = iota DEFAULT_COMM = iota
SET_COMM SET
GET_COMM GET
ADD_COMM ADD
REDUCE_COMM REDUCE
SETBIT_COMM SETBIT
GETBIT_COMM GETBIT
L_SET
) )
var CommKey = map[string]int{ var CommKeyString = map[string]int {
"set": STRING_X, "set": STRING_X,
"get": STRING_X, "get": STRING_X,
"add": STRING_X, "add": STRING_X,
"reduce": STRING_X, "reduce": STRING_X,
"setbit": STRING_X, "setbit": STRING_X,
"getbit": STRING_X, "getbit": STRING_X,
"l_set": LIST_X,
} }
var CommKey = map[int]int {
SET: STRING_X,
GET: STRING_X,
ADD: STRING_X,
REDUCE: STRING_X,
SETBIT: STRING_X,
GETBIT: STRING_X,
L_SET: LIST_X,
}

View File

@ -8,3 +8,5 @@ STRING_X:
- setbit - setbit
- getbit - getbit
LIST_X:
- l_set

View File

@ -4,9 +4,7 @@ type CacheValue interface {
LengthByte() int64 LengthByte() int64
} }
type ParseComm func(comm interface{}) ([]string, error) type KeyBase interface {
type CacheStruct interface {
SizeByte() int64 SizeByte() int64
// TODO RollBack 事务相关, V2 实现 // TODO RollBack 事务相关, V2 实现
@ -16,7 +14,5 @@ type CacheStruct interface {
// Comment 事务相关, V2 实现 // Comment 事务相关, V2 实现
Comment() error Comment() error
ParseCommend(comm ParseComm) ([]string, error)
Encode() ([]byte, error) Encode() ([]byte, error)
} }

View File

@ -3,22 +3,13 @@ syntax = "proto3";
option go_package = "pkg/proto"; option go_package = "pkg/proto";
import "stringx.proto"; import "stringx.proto";
message Comm {
oneof comm_option {
StringxComm string_comm = 1;
}
}
message CommendRequest {
Comm commends = 1;
}
message CommendResponse { message CommendResponse {
repeated string result = 1; repeated string result = 1;
} }
service CommServer { service CommServer {
rpc Commend (CommendRequest) returns (CommendResponse); rpc Get (GetRequest) returns (CommendResponse);
} rpc Set (SetRequest) returns (CommendResponse);
rpc Add ()
}

View File

@ -5,18 +5,20 @@ import "base.proto";
option go_package = "pkg/proto"; option go_package = "pkg/proto";
message StringXSet { message SetRequest {
BaseKey key = 1; BaseKey key = 1;
string value = 2; string value = 2;
} }
message StringxGet { message GetRequest {
BaseKey key = 1; BaseKey key = 1;
} }
message StringxComm { message AddRequest {
oneof string_x_comm { BaseKey key = 1;
StringXSet get = 1; int64 value = 2;
StringxGet set = 2; }
}
} message RedceRequest {
BaseKey key = 1;
}

1
shell/gen_protobuf.py Normal file
View File

@ -0,0 +1 @@
import os

View File

@ -1,72 +1,84 @@
import os import os
from typing import Dict, List
from jinja2 import Template from jinja2 import Template
import yaml import yaml
sysPath = os.getcwd() sysPath = os.getcwd()
tempPath = f"{sysPath}/pkg/structure/generate"
tem_text = '''// Code generated by gen-struct. DO NOT EDIT. structurePath = f"{sysPath}/pkg/structure"
// make gen-struct generated protobufPath = f"{sysPath}/protobuf"
package generate
const (
DEFAULT_KEY = iota
{% for key in keys %}
{{key}}
{% endfor %}
)
const (
DEFAULT_COMM = iota
{% for key in sets %}
{{key}}
{% endfor %}
)
var CommKey = map[string]int {
{% for kmp in key_maps %}
{% for comm in kmp.val %}
"{{comm}}": {{kmp.key}},
{% endfor %}
{% endfor %}
}
'''
class KeyMap(object): class KeyMap(object):
def __init__(self, key, val) -> None: def __init__(self, key: str, val) -> None:
self.key = key self.key = key
self.val = val self.val = val
self.upper = [v.upper() for v in val]
def to_camel(val: str) -> str:
return "".join([k.capitalize() for k in val.split('_')])
def load_template(name: str) -> str:
with open(f"{tempPath}/{name}", "r", encoding="utf-8") as fp:
return fp.read()
def load_conf(): def load_conf():
conf_path = f"{sysPath}/structure/generate/tem.yaml" conf_path = f"{tempPath}/tem.yaml"
with open(conf_path, 'r', encoding='utf-8') as f: with open(conf_path, 'r', encoding='utf-8') as f:
cfg = f.read() cfg = f.read()
cfg = yaml.load(cfg) cfg = yaml.load(cfg)
return cfg cfg_camel = {}
for key, val in cfg.items():
cfg_camel[key] = [to_camel(v) for v in val]
print(cfg_camel)
return cfg, cfg_camel
def set_structure_template(conf: dict): # 生成常量
def set_structure_const_template(conf: dict):
tem_text = load_template("const.template")
keys = conf.keys() keys = conf.keys()
key_map = [] key_map = []
val_set = [] val_set = []
for k, v in conf.items(): for k, v in conf.items():
key_map.append(KeyMap(key=k, val=v)) key_map.append(KeyMap(key=k, val=v))
for val in v: for val in v:
val_set.append(val.upper() + "_COMM") val_set.append(val.upper())
template = Template(tem_text) template = Template(tem_text)
text = template.render(keys=keys, key_maps=key_map, sets=val_set) text = template.render(keys=keys, key_maps=key_map, sets=val_set)
text.replace("\n\n", "\n")
temp_path = f"{sysPath}/structure/generate/structure.gen.go"
temp_path = f"{tempPath}/structure.gen.go"
with open(temp_path, 'w', encoding='utf-8') as f: with open(temp_path, 'w', encoding='utf-8') as f:
f.write(text) f.write(text)
# 生成接口
def set_structure_interface(conf):
print(conf)
# class KeyInterFace
with open(f"{structurePath}/interface.go") as fp:
interfaceText = fp.read()
for key, item in conf.items():
interfaceKey = "".join([k.capitalize() for k in key.split('_')])
interfaceTitle = "type "
if __name__ == "__main__": if __name__ == "__main__":
conf = load_conf() conf, cfg_camel = load_conf()
set_structure_template(conf) set_structure_const_template(conf)
set_structure_interface(conf)