openubmc-bingo 0.5.254__py3-none-any.whl → 0.5.257__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of openubmc-bingo might be problematic. Click here for more details.

bmcgo/__init__.py CHANGED
@@ -9,4 +9,4 @@
9
9
  # MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10
10
  # See the Mulan PSL v2 for more details.
11
11
 
12
- __version__ = '0.5.254'
12
+ __version__ = '0.5.257'
@@ -96,3 +96,4 @@ class ClientLuaUtils(Base, Utils, MdbRegister):
96
96
  return f"path_params and ({path_with_params}) or '{path}'"
97
97
 
98
98
  Factory().register("client.lua.mako", ClientLuaUtils)
99
+ Factory().register("v1/templates/apps/client.lua.mako", ClientLuaUtils)
@@ -279,6 +279,24 @@ class Utils:
279
279
  if "tableName" in class_data and class_data.get("tableLocation") != "Local":
280
280
  return True
281
281
  return False
282
+
283
+ @staticmethod
284
+ def has_db(root: dict):
285
+ return Utils.check_need_mem_db(root) or Utils.check_local_poweroff_db(root) or \
286
+ Utils.check_local_reset_db(root) or Utils.check_local_temporary_db(root)
287
+
288
+ @staticmethod
289
+ def get_db_types(root: dict):
290
+ db_types = '{'
291
+ if Utils.check_need_mem_db(root):
292
+ db_types += "'memory', "
293
+ if Utils.check_local_poweroff_db(root):
294
+ db_types += "'local_poweroff', "
295
+ if Utils.check_local_reset_db(root):
296
+ db_types += "'local_reset', "
297
+ if Utils.check_local_temporary_db(root):
298
+ db_types += "'local_temporary', "
299
+ return db_types + '}'
282
300
 
283
301
  @staticmethod
284
302
  def check_need_mem_db(root: dict):
@@ -248,8 +248,13 @@ feature:
248
248
  impl_feature:
249
249
  endif
250
250
 
251
+ ifeq ($(MAJOR_VERSION_EQ_1), true)
252
+ orm_classes:
253
+ else
251
254
  orm_classes: ${PROTO_OUT_DIR}/db_json.json
252
255
  python3 ${TEMPLATE_BIN} -d ${PROTO_DIR} -j ${PROTO_OUT_DIR}/ -n ${PROJECT_NAME} -i ${PROTO_OUT_DIR}/db_json.json -f ${LUA_FORMATER} -t orm_classes.lua.mako -o ${GEN_OUT_DIR}/orm_classes.lua
256
+ endif
257
+
253
258
  else
254
259
  schema:
255
260
  model:
@@ -276,9 +281,15 @@ client_messages: client_messages_json
276
281
  -i ${PROTO_OUT_DIR}/json_types/$x -f ${LUA_FORMATER} -t message.lua.mako \
277
282
  -o $(call proto_json_to_lua, ${GEN_OUT_DIR}/json_types/$x);) \
278
283
 
284
+ ifeq ($(MAJOR_VERSION_EQ_1), true)
285
+ ${GEN_OUT_DIR}/client.lua : ${PROTO_OUT_DIR}/client.json ${TEMPLATE_BIN} \
286
+ ${MAJOR_VERIONS_DIR}/v1/templates/apps/client.lua.mako utils/validate.mako utils/imports.mako client_messages message
287
+ python3 ${TEMPLATE_BIN} -d ${PROTO_DIR} -v ${VERSION} -j ${PROTO_OUT_DIR}/json_types/ -n ${PROJECT_NAME} -i ${PROTO_OUT_DIR}/client.json -f ${LUA_FORMATER} -t v1/templates/apps/client.lua.mako -o $@
288
+ else
279
289
  ${GEN_OUT_DIR}/client.lua : ${PROTO_OUT_DIR}/client.json ${TEMPLATE_BIN} \
280
290
  client.lua.mako utils/validate.mako utils/imports.mako client_messages message
281
291
  python3 ${TEMPLATE_BIN} -d ${PROTO_DIR} -v ${VERSION} -j ${PROTO_OUT_DIR}/json_types/ -n ${PROJECT_NAME} -i ${PROTO_OUT_DIR}/client.json -f ${LUA_FORMATER} -t client.lua.mako -o $@
292
+ endif
282
293
 
283
294
  client: ${GEN_OUT_DIR}/client.lua
284
295
 
@@ -22,6 +22,10 @@ BASE_TYPE = "baseType"
22
22
  ITEMS = "items"
23
23
  NON_CONVERT_ITEMS = ["validator", "req_type", "rsp_type", "feature", "default_value", "read", "write"]
24
24
  FILTERED_ITEMS = ["description", "$ref", "default", "items", "req", "rsp", "featureTag", "privilege"]
25
+ PERSIST_TYPES = {
26
+ "PermanentPer", "PoweroffPer", "ResetPer", "TemporaryPer", "PoweroffPerRetain",
27
+ "ResetPerRetain", "TemporaryPerRetain", "Memory"
28
+ }
25
29
  OBJECT_PROPERTIES_INTERFACE = "bmc.kepler.Object.Properties"
26
30
 
27
31
 
@@ -67,6 +71,10 @@ class ConsistencyModelLuaUtils(Base, Utils):
67
71
  def combine_privileges(privileges):
68
72
  prefix = "privilege."
69
73
  return prefix + (" | " + prefix).join(sorted(privileges))
74
+
75
+ @staticmethod
76
+ def prop_contains_persist_type(prop_config: dict):
77
+ return bool(set(prop_config.get("usage", [])) & PERSIST_TYPES)
70
78
 
71
79
  def class_has_block_io(self, msg):
72
80
  if self.has_path(msg):
@@ -175,6 +183,27 @@ class ConsistencyModelLuaUtils(Base, Utils):
175
183
  return msg['path']
176
184
  return msg['path'].replace(':parent/', self.get_path(root, root[msg['parent']]) + ':parent/')
177
185
 
186
+ def is_enable_orm(self, msg):
187
+ if "tableName" not in msg:
188
+ return False
189
+
190
+ if "tableLocation" in msg and msg["tableLocation"] == "Local":
191
+ return False
192
+
193
+ if "tableType" in msg:
194
+ return True
195
+
196
+ for _, prop_config in msg.get('properties', {}).items():
197
+ if self.prop_contains_persist_type(prop_config):
198
+ return True
199
+
200
+ for intf_data in msg.get('interfaces', {}).values():
201
+ for _, prop_config in intf_data.get('properties', {}).items():
202
+ if self.prop_contains_persist_type(prop_config):
203
+ return True
204
+
205
+ return False
206
+
178
207
  def convert_dynamic_params(self, msg):
179
208
  match_obj = re.search("\$\{(.+?)\}", msg)
180
209
  if match_obj is None:
@@ -0,0 +1,229 @@
1
+ ## 生成所有rpc接口
2
+ <%def name="get_obj(rpc)">
3
+ % if rpc['path'] != '*': ## 非虚方法和收集类方法,直接远程调用
4
+ % if 'paths' in rpc and not rpc['virtual']:
5
+ %if not rpc['retry']:
6
+ mdb.get_object(self:get_bus(), ${render_utils.make_path_with_params(rpc['full_path'])}, '${rpc['interface']}')
7
+ %else:
8
+ mdb.try_get_object(self:get_bus(), ${render_utils.get_object_path(rpc['full_path'])}, '${rpc['interface']}')
9
+ %endif
10
+ % else:
11
+ self:Get${rpc['class']}${rpc['intf_class']}Object(${render_utils.get_path_arg(rpc["full_path"], False)})
12
+ % endif
13
+ % elif not rpc['virtual']:
14
+ mdb.get_object(self:get_bus(), ${render_utils.make_path_with_params(rpc['full_path'])}, "${rpc['interface']}")
15
+ % else :
16
+ self:Get${rpc['intf_class']}Object()
17
+ % endif
18
+ </%def>
19
+ ${make_header('lua')}
20
+ <% has_signal = root['signals']%>
21
+ <% has_interface = root['interfaces']%>
22
+ <% has_definite_path = any((rpc['path'] != '*') for rpc in root['interfaces'])%>
23
+ <% has_virtual = any((rpc['path'] == '*' and rpc['virtual']) for rpc in root['interfaces'])%>
24
+ <% has_implement = any((rpc['implement'] != '') for rpc in root['interfaces'])%>
25
+ <% has_non_virtual = any(((rpc['path'] == '*' or ((render_utils.get_path_params(rpc["full_path"]) or 'paths' in rpc))) and not rpc['virtual'] and rpc['implement'] == '') for rpc in root['interfaces'])%>
26
+ % if has_definite_path or has_implement:
27
+ local mdb = require 'mc.mdb'
28
+ % endif
29
+ local class = require 'mc.class'
30
+ local app_base = require 'mc.client_app_base'
31
+ % if has_signal or has_non_virtual:
32
+ local mdb_service = require 'mc.mdb.mdb_service'
33
+ % endif
34
+ % if has_interface:
35
+ local subscribe_signal = require 'mc.mdb.subscribe_signal'
36
+ % endif
37
+ % if has_signal:
38
+ local org_freedesktop_dbus = require 'sd_bus.org_freedesktop_dbus'
39
+ % endif
40
+
41
+ % if has_signal:
42
+ local match_rule = org_freedesktop_dbus.MatchRule
43
+ % endif
44
+ % if has_virtual:
45
+ local get_virtual_interface_object = mdb_service.get_virtual_interface_object
46
+ % endif
47
+ % if has_non_virtual:
48
+ local get_non_virtual_interface_objects = mdb_service.get_non_virtual_interface_objects
49
+ local foreach_non_virtual_interface_objects = mdb_service.foreach_non_virtual_interface_objects
50
+ % endif
51
+
52
+ ## 生成对接口的依赖
53
+ % for intf, intf_data in root['intf_imports'].items():
54
+ % if intf_data['interface'].startswith('bmc.dev.'):
55
+ local ${intf} = require '${project_name}.device_types.${intf}'
56
+ %else:
57
+ local ${intf} = require '${project_name}.json_types.${intf}'
58
+ % endif
59
+ % endfor
60
+
61
+ <%namespace name="default_intf" file="../../../templates/apps/utils/default_intf.lua.mako"/>
62
+ <%namespace name="imports" file="../../../templates/apps/utils/imports.mako"/>
63
+ ${imports.render(root)}
64
+
65
+ <%
66
+ ClassName = root['package'] + '_client'
67
+ %>
68
+ ---@class ${ClassName}: BasicClient
69
+ local ${ClassName} = class(app_base.Client)
70
+
71
+ % if has_implement:
72
+ ${default_intf.add_subs(ClassName)}
73
+ % endif
74
+ ## 收集复写类方法订阅接口
75
+ % for rpc in root['interfaces']:
76
+ % if rpc['path'] == '*' and rpc['virtual']:
77
+
78
+ function ${ClassName}:Get${rpc['intf_class']}Object()
79
+ return get_virtual_interface_object(self:get_bus(), '${rpc['interface']}')
80
+ end
81
+ % endif
82
+ %endfor
83
+ ## 生成收集类client订阅接口
84
+ % for rpc in root['interfaces']:
85
+ %if rpc['path'] == '*' and not rpc['virtual'] and rpc['implement'] == '':
86
+
87
+ function ${ClassName}:Get${rpc['intf_class']}Objects()
88
+ return get_non_virtual_interface_objects(self:get_bus(), '${rpc['interface']}', ${'true' if rpc['retry'] else 'false'})
89
+ end
90
+
91
+ function ${ClassName}:Foreach${rpc['intf_class']}Objects(cb)
92
+ return foreach_non_virtual_interface_objects(self:get_bus(), '${rpc['interface']}', cb, ${'true' if rpc['retry'] else 'false'})
93
+ end
94
+ % endif
95
+ %endfor
96
+
97
+ ## 生成默认对象的订阅和访问接口
98
+ % for rpc in root['interfaces']:
99
+ %if rpc['implement'] != '' :
100
+ <% default_path = ClassName +'.'+ rpc['intf_class'] +"_default" %>
101
+ ${default_intf.render(default_path, ClassName, rpc['intf_class'], rpc['interface'])}
102
+ % endif
103
+ %endfor
104
+
105
+ % for rpc in root['interfaces']:
106
+ % if 'paths' in rpc and not rpc['virtual']:
107
+ function ${ClassName}:MutipleGet${rpc['intf_class']}Objects()
108
+ return get_non_virtual_interface_objects(self:get_bus(), '${rpc['interface']}', ${'true' if rpc['retry'] else 'false'}, ${render_utils.get_path_patterns(rpc["paths"])})
109
+ end
110
+
111
+ function ${ClassName}:MutipleForeach${rpc['intf_class']}Objects(cb)
112
+ return foreach_non_virtual_interface_objects(self:get_bus(), '${rpc['interface']}', cb, ${'true' if rpc['retry'] else 'false'}, ${render_utils.get_path_patterns(rpc["paths"])})
113
+ end
114
+
115
+ % if rpc['dep_properties']:
116
+ function ${ClassName}:MutipleOn${rpc['intf_class']}PropertiesChanged(cb)
117
+ self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_properties_changed(self:get_bus(), ${render_utils.get_path_patterns(rpc["paths"])}, cb, '${rpc['interface']}'${render_utils.get_dep_properties(rpc["dep_properties"])})
118
+ end
119
+ %endif
120
+
121
+ function ${ClassName}:MutipleOn${rpc['intf_class']}InterfacesAdded(cb)
122
+ self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), ${render_utils.get_path_patterns(rpc["paths"])}, cb, '${rpc['interface']}')
123
+ end
124
+
125
+ function ${ClassName}:MutipleOn${rpc['intf_class']}InterfacesRemoved(cb)
126
+ self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), ${render_utils.get_path_patterns(rpc["paths"])}, cb, '${rpc['interface']}')
127
+ end
128
+
129
+ <% continue %>
130
+ % endif
131
+ % if rpc['path'] != '*':
132
+ function ${ClassName}:Get${rpc['name']}Object(${render_utils.get_path_arg(rpc["full_path"], False)})
133
+ %if not rpc['retry']:
134
+ return mdb.get_object(self:get_bus(), ${render_utils.make_path_with_params(rpc['full_path'])}, '${rpc['interface']}')
135
+ %else:
136
+ return mdb.try_get_object(self:get_bus(), ${render_utils.get_object_path(rpc['full_path'])}, '${rpc['interface']}')
137
+ %endif
138
+ end
139
+
140
+ % if render_utils.get_path_params(rpc["full_path"]):
141
+ function ${ClassName}:Get${rpc['intf_class']}Objects()
142
+ return get_non_virtual_interface_objects(self:get_bus(), '${rpc['interface']}', ${'true' if rpc['retry'] else 'false'}, ${render_utils.get_path_patterns([rpc["full_path"]])})
143
+ end
144
+
145
+ function ${ClassName}:Foreach${rpc['intf_class']}Objects(cb)
146
+ return foreach_non_virtual_interface_objects(self:get_bus(), '${rpc['interface']}', cb, ${'true' if rpc['retry'] else 'false'}, ${render_utils.get_path_patterns([rpc["full_path"]])})
147
+ end
148
+ %endif
149
+
150
+ % if rpc['dep_properties']:
151
+ function ${ClassName}:On${rpc['intf_class']}PropertiesChanged(cb${render_utils.get_path_arg(rpc["full_path"])})
152
+ local path_namespace = ${render_utils.get_path_namespace(rpc['full_path'])}
153
+ self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_properties_changed(self:get_bus(), path_namespace, cb, '${rpc['interface']}'${render_utils.get_dep_properties(rpc["dep_properties"])})
154
+ end
155
+ %endif
156
+
157
+ function ${ClassName}:On${rpc['intf_class']}InterfacesAdded(cb${render_utils.get_path_arg(rpc["full_path"])})
158
+ local path_namespace = ${render_utils.get_path_namespace(rpc['full_path'])}
159
+ self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), path_namespace, cb, '${rpc['interface']}')
160
+ end
161
+
162
+ function ${ClassName}:On${rpc['intf_class']}InterfacesRemoved(cb${render_utils.get_path_arg(rpc["full_path"])})
163
+ local path_namespace = ${render_utils.get_path_namespace(rpc['full_path'])}
164
+ self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), path_namespace, cb, '${rpc['interface']}')
165
+ end
166
+
167
+ % else :
168
+ % if rpc['dep_properties']:
169
+ function ${ClassName}:On${rpc['intf_class']}PropertiesChanged(cb)
170
+ self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_properties_changed(self:get_bus(), '/bmc', cb, '${rpc['interface']}'${render_utils.get_dep_properties(rpc["dep_properties"])})
171
+ end
172
+ %endif
173
+
174
+ function ${ClassName}:On${rpc['intf_class']}InterfacesAdded(cb)
175
+ self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb, '${rpc['interface']}')
176
+ end
177
+
178
+ function ${ClassName}:On${rpc['intf_class']}InterfacesRemoved(cb)
179
+ self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb, '${rpc['interface']}')
180
+ end
181
+
182
+ % endif
183
+ %endfor
184
+ % for rpc in root['methods']:
185
+ %if rpc['path'] == '*' and not rpc['virtual']:
186
+ <% continue %>
187
+ % endif
188
+ % for p in render_utils.props(rpc['req']): ## 生成参数注释
189
+ ---@param ${p['name']} ${utils_py.do_type_to_lua(p['type'], p['repeated'])}
190
+ % endfor
191
+ % if render_utils.rsp_message(rpc) != 'nil': ## 生成返回值注释
192
+ ---@return ${render_utils.rsp_message(rpc)}
193
+ % endif
194
+ % if len(render_utils.params(rpc['req'])) == 0: ## 区分参数个数生成参数, 没有参数的b
195
+ function ${ClassName}:${rpc['name']}(ctx${render_utils.get_path_arg(rpc["full_path"])})
196
+ local obj = ${get_obj(rpc)}
197
+ return ${render_utils.rsp_message(rpc)}.new(obj:${rpc['func_name']}(ctx))
198
+ end
199
+
200
+ function ${ClassName}:P${rpc['name']}(ctx${render_utils.get_path_arg(rpc["full_path"])})
201
+ return pcall(self.${rpc['name']}, self, ctx${render_utils.get_path_arg(rpc["full_path"])})
202
+ end
203
+
204
+ % else: ## 有参数的
205
+ function ${ClassName}:${rpc['name']}(ctx${render_utils.get_path_arg(rpc["full_path"])}, ${render_utils.params(rpc['req'])})
206
+ local req = ${render_utils.req_message(rpc)}.new(${render_utils.params(rpc['req'])}):validate()
207
+ local obj = ${get_obj(rpc)}return ${render_utils.rsp_message(rpc)}.new(obj:${rpc['func_name']}(ctx, req:unpack(true)))
208
+ end
209
+
210
+ function ${ClassName}:P${rpc['name']}(ctx${render_utils.get_path_arg(rpc["full_path"])}, ${render_utils.params(rpc['req'])})
211
+ return pcall(self.${rpc['name']}, self, ctx${render_utils.get_path_arg(rpc["full_path"])}, ${render_utils.params(rpc['req'])})
212
+ end
213
+
214
+ % endif
215
+ % endfor
216
+ ## 生成信号订阅接口
217
+ % for signal in root['signals']:
218
+ function ${ClassName}:Subscribe${signal['name']}(cb)
219
+ local sig = match_rule.signal('${signal['signal_name']}', '${signal['interface']}')${'' if signal['path'] == '*' else (':with_path("' +signal['path']+'")')}
220
+ self.signal_slots[#self.signal_slots+1] = subscribe_signal.subscribe(self:get_bus(), sig, cb)
221
+ end
222
+
223
+ % endfor
224
+ function ${ClassName}:ctor()
225
+ self.signal_slots = {}
226
+ end
227
+
228
+ ---@type ${ClassName}
229
+ return ${ClassName}.new('${root['package']}')
@@ -17,6 +17,9 @@ classes.${class_name} = {
17
17
  % if render_utils.has_table_name(msg):
18
18
  ['table_name'] = '${msg['tableName']}',
19
19
  % endif
20
+ % if render_utils.is_enable_orm(msg):
21
+ ['enable_orm'] = true,
22
+ % endif
20
23
  % if render_utils.has_alias(msg):
21
24
  ['alias_map'] = ${render_utils.get_alias_map(msg)},
22
25
  % endif
@@ -13,33 +13,18 @@ local ipmi = require 'ipmi'
13
13
  % if has_default or has_mdb:
14
14
  local mdb = require 'mc.mdb'
15
15
  % endif
16
- % if utils_py.check_local_reset_db(root) or utils_py.check_local_temporary_db(root):
17
- local skynet = require 'skynet'
18
- % endif
19
16
  local class = require 'mc.class'
20
17
  % if has_signal:
21
18
  local context = require 'mc.context'
22
19
  % endif
23
20
  local c = require 'mc.class_mgnt'
24
- % if utils_py.check_need_mem_db(root):
25
- local open_db = require '${project_name}.db'
26
- % endif
27
21
  local bootstrap = require 'mc.bootstrap'
28
- % if utils_py.check_local_poweroff_db(root) or utils_py.check_local_reset_db(root) or utils_py.check_local_temporary_db(root):
29
- local open_local_db = require '${project_name}.local_db'
30
- % endif
31
22
  % if (root['path_level'] == 2 and utils_py.check_db_open(root['package']) and utils_py.check_remote_per(root)) or root['class_require']:
32
23
  local object_manage = require 'mc.mdb.object_manage'
33
24
  % endif
34
25
  % if root['path_level'] == 2 and utils_py.check_db_open(root['package']) and utils_py.check_remote_per(root):
35
26
  local persist_client = require 'persistence.persist_client_lib'
36
27
  % endif
37
- % if utils_py.check_need_mem_db(root) or utils_py.check_need_local_db(root):
38
- local ok, datas = pcall(require, '${project_name}.datas')
39
- if not ok then
40
- datas = nil -- 如果没有datas配置,证明当前组件不需要datas,仅打开数据库
41
- end
42
- % endif
43
28
 
44
29
  % for intf, intf_data in root['intf_imports'].items():
45
30
  local ${intf}Types = require '${project_name}.json_types.${intf}'
@@ -135,32 +120,10 @@ end
135
120
  % endif
136
121
 
137
122
  function ${ClassName}:ctor(${"" if root['path_level'] == 2 else "bus"})
138
- self.name = '${project_name}'
139
- % if utils_py.check_need_mem_db(root):
140
- self.db = open_db(':memory:', datas)
141
- % endif
142
- % if root['path_level'] == 2:
143
- % if utils_py.check_local_poweroff_db(root):
144
- self.local_db = open_local_db(bootstrap.Service:get_local_db_path(self.name) .. '/${project_name}.db', datas, 'poweroff')
145
- % endif
146
- % endif
147
- % if utils_py.check_local_reset_db(root) or utils_py.check_local_temporary_db(root):
148
- if skynet.getenv('TEST_DATA_DIR') then
149
- % if utils_py.check_local_reset_db(root):
150
- self.reset_local_db = open_local_db(skynet.getenv('TEST_DATA_DIR')..'/${project_name}_reset.db', datas, "reset")
151
- % endif
152
- % if utils_py.check_local_temporary_db(root):
153
- self.temporary_local_db = open_local_db(skynet.getenv('TEST_DATA_DIR')..'/${project_name}_temp.db', datas, "temporary")
154
- % endif
155
- else
156
- % if utils_py.check_local_reset_db(root):
157
- self.reset_local_db = open_local_db('/opt/bmc/pram/persistence.local/${project_name}.db', datas, "reset")
158
- % endif
159
- % if utils_py.check_local_temporary_db(root):
160
- self.temporary_local_db = open_local_db('/dev/shm/persistence.local/${project_name}.db', datas, "temporary")
161
- % endif
162
- end
123
+ % if utils_py.has_db(root):
124
+ self.db_types = ${utils_py.get_db_types(root)}
163
125
  % endif
126
+ self.name = '${project_name}'
164
127
  end
165
128
 
166
129
  % if root['path_level'] == 2:
@@ -168,7 +131,6 @@ function ${ClassName}:pre_init()
168
131
  ${ClassName}.super.pre_init(self)
169
132
  % if utils_py.check_remote_per(root):
170
133
  self.persist = persist_client.new(self.bus, self.db, self, ${render_utils.get_not_recover_tables(root)})
171
- object_manage.set_persist_client(self.persist)
172
134
  % endif
173
135
  end
174
136
  % endif
@@ -140,16 +140,16 @@ class IncrementalCov(object):
140
140
  temp_uncovers = []
141
141
  temp_changes = []
142
142
  filters = filter_lines[file]
143
- if file not in cov_lines or file not in filter_lines:
144
- continue
143
+ if file not in cov_lines:
144
+ cov = []
145
145
  else:
146
146
  cov = cov_lines[file]
147
147
 
148
148
  for change in change_lines:
149
- if filters[change] == 0:
149
+ if filters[change - 1] == 0:
150
150
  continue
151
151
  temp_changes.append(change)
152
- if not cov or not cov[change]:
152
+ if not cov or not cov[change - 1]:
153
153
  temp_uncovers.append(change)
154
154
  lua_changes[file] = temp_changes
155
155
  uncovers[file] = temp_uncovers
@@ -277,7 +277,7 @@ class TaskClass(Task):
277
277
  soft_sr_file_path = os.path.join(sr_dir, soft_sr_file_name)
278
278
  if not os.path.exists(soft_sr_file_path):
279
279
  return
280
- soft_sr_dir_permission = self.tools.get_file_permission(sr_dir)
280
+ soft_sr_file_permission = self.tools.get_file_permission(soft_sr_file_path)
281
281
  self.run_command(f"chmod 777 {soft_sr_file_path}", sudo=True, command_echo=False)
282
282
  with open(soft_sr_file_path, "r") as fp:
283
283
  soft_sr_data = json.load(fp)
@@ -288,7 +288,7 @@ class TaskClass(Task):
288
288
  if key in soft_sr_data['Objects']:
289
289
  sr_data['Objects'][key] = {**value, **soft_sr_data['Objects'][key]}
290
290
  sr_data['Objects'] = {**soft_sr_data['Objects'], **sr_data['Objects']}
291
- self.run_command(f"chmod {soft_sr_dir_permission} {soft_sr_file_path}", sudo=True, command_echo=False)
291
+ self.run_command(f"chmod {soft_sr_file_permission} {soft_sr_file_path}", sudo=True, command_echo=False)
292
292
  except Exception as e:
293
293
  raise Exception(f"{sr_file.path} 文件合并失败: {e}") from e
294
294
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openubmc-bingo
3
- Version: 0.5.254
3
+ Version: 0.5.257
4
4
  Summary: Tools provided by openubmc
5
5
  Home-page: https://openubmc.cn
6
6
  Classifier: Programming Language :: Python :: 3
@@ -1,4 +1,4 @@
1
- bmcgo/__init__.py,sha256=raLp35VhtW_V2qbfKmaKKWBtbrpksL9JqqOSEC_mO-A,563
1
+ bmcgo/__init__.py,sha256=oOiYC4HhyEc04hPvHnSvRMftVurE7Vb5YK9aRTdtk2Y,563
2
2
  bmcgo/bmcgo.py,sha256=uD4TsfjrFB5aQPIS6WRUVc9ShXX-dSImY9ezkB13g1w,685
3
3
  bmcgo/bmcgo_config.py,sha256=zPghH-W8vNK1bAc5PjfwnWzkHYT499PlGbhUWhPKT5U,10888
4
4
  bmcgo/errors.py,sha256=QW1ndrJcJ2Ws7riOznPKVvZsNlrYk73eZol7w8gJTPU,3076
@@ -63,7 +63,7 @@ bmcgo/codegen/lua/script/redfish_source_tree.py,sha256=HzTGY4PViZXLQLOt_U7-YMqE5
63
63
  bmcgo/codegen/lua/script/sep_ipmi_message_cmds.py,sha256=dQZog5e7Eo8Z7xSrp9sUri8vg-VtEj_Sll_E_OhnBw4,8209
64
64
  bmcgo/codegen/lua/script/template.py,sha256=kJ5vQcHKY5OKUkYrSObFjx6WLVopveasjbr0HWgrMZM,6711
65
65
  bmcgo/codegen/lua/script/types_pb2.py,sha256=uiRP_JPK9EF57RUZuomx1K1M9_jZFZgsHXcatFrhzow,23074
66
- bmcgo/codegen/lua/script/utils.py,sha256=8iM-PS0sckMuY81QT0Va_s76m7NkhK6MaY1ctLJXzUU,23894
66
+ bmcgo/codegen/lua/script/utils.py,sha256=weOOTRmrBOy1IT53bHEqR0or2ElugwghdBkQs9nafE0,24583
67
67
  bmcgo/codegen/lua/script/validate.py,sha256=_RHZBSDZklmcjETD8zRmnhz4DABzKoL-fNl1I9L4Ofs,2096
68
68
  bmcgo/codegen/lua/script/yaml_to_json.py,sha256=31J1qJPIAJrx9Cq6bNZks3QCZ754spI5mjZNlshkcJ4,2291
69
69
  bmcgo/codegen/lua/script/dto/__init__.py,sha256=nSBpsAbZ7UGd0a25ys_LLEpi3juPtUhVMy_tgGuZsNY,560
@@ -79,7 +79,7 @@ bmcgo/codegen/lua/script/loader/kepler_abstract_collect.py,sha256=5NIR71Bt5EPcUE
79
79
  bmcgo/codegen/lua/script/loader/kepler_abstract_loader.py,sha256=wQBYQyKhBOeoUn0d1YnYFtOzWPLNZVf7QmUvjLwTMT4,1977
80
80
  bmcgo/codegen/lua/script/loader/redfish_loader.py,sha256=k7SUKN0I4Fc6uTugeOsPP0ceRM_tVEBTbQdNl_kDav4,5944
81
81
  bmcgo/codegen/lua/script/render_utils/__init__.py,sha256=TQLS6LwBbDdGw_nKfdfWGAP6TbaXPJ4wr_kMV2JJCS8,2014
82
- bmcgo/codegen/lua/script/render_utils/client_lua.py,sha256=rSNIjIgLjNRKNCMjbaNconBQ7Ysr1mkSLR-S3H6U3sw,3507
82
+ bmcgo/codegen/lua/script/render_utils/client_lua.py,sha256=xhdLvbtH-UD2QkQggQHfTHKQvBx0HjjpQO_u5TqdMKk,3579
83
83
  bmcgo/codegen/lua/script/render_utils/controller_lua.py,sha256=bgMXd6beOiL0Xm4rK3x09_GjaJJcDBMkt8ya0gHIqz0,2352
84
84
  bmcgo/codegen/lua/script/render_utils/db_lua.py,sha256=SHhuoIMvN0dPplUODfvu3qCDBtgP9QmnUvjLPQEjoTk,7865
85
85
  bmcgo/codegen/lua/script/render_utils/error_lua.py,sha256=CW9g-HPADf42zfzLSA6PW-0O_IchDKMyjztANGiIHC8,5928
@@ -100,7 +100,7 @@ bmcgo/codegen/lua/script/render_utils/validate_lua.py,sha256=NVjMWZwMxwUj9kdTaCR
100
100
  bmcgo/codegen/lua/templates/Makefile,sha256=-br3qnXM_73_nJhYVgF7TsNtVxt_p_h4l5TYPjWqQIs,4044
101
101
  bmcgo/codegen/lua/templates/errors.lua.mako,sha256=T93tESJl0K3r5izufq6NsqqCptQbVslpsTEjkQdDq0U,1536
102
102
  bmcgo/codegen/lua/templates/messages.lua.mako,sha256=GfWjgRy0is3d-U8-Wq-i_oWguFi5d1VHQKv0pJhV9cE,1074
103
- bmcgo/codegen/lua/templates/apps/Makefile,sha256=OFyiSw8HV9MrwZGuaMkx0yUyAeJ7GFNV7qIl83UsKko,15461
103
+ bmcgo/codegen/lua/templates/apps/Makefile,sha256=RdITTL802KYOeHjBvokhejOeO976Ni1SjEf_dKvjOuc,15963
104
104
  bmcgo/codegen/lua/templates/apps/Makefile.mdb.mk,sha256=Qmd-n_YsQbfnpED_6PIp_6pL13w6UCCGgBoBA4h6r_0,3296
105
105
  bmcgo/codegen/lua/templates/apps/app.lua.mako,sha256=Y_aZCPyNgeqfa39_RWxV-_m3out1p4vTTWnzqXtPV7E,276
106
106
  bmcgo/codegen/lua/templates/apps/class.lua.mako,sha256=FZsGAZeiytVwihxyyjhw6Hvv4V01Lhtz8Q9FPZYieZw,1208
@@ -154,9 +154,10 @@ bmcgo/codegen/lua/templates/new_app/test/unit/test.lua.mako,sha256=3UleW8XN8VEF7
154
154
  bmcgo/codegen/lua/templates/new_app/user_conf/rootfs/etc/systemd/system/${project_name}.service.mako,sha256=b6wu4leCGtNlXJ_kmEjtJkQqIBSkYz6EfWViZGneCqY,400
155
155
  bmcgo/codegen/lua/templates/new_app/user_conf/rootfs/etc/systemd/system/multi-user.target.wants/${project_name}.service.link,sha256=NJ6AGF9O0FGEM5dwb62LS2_KO7T3A2_lcHYFlY-KR0k,26
156
156
  bmcgo/codegen/lua/v1/script/gen_schema.py,sha256=LtSswrIqjgk3PuGSlzKSB5Cw5OeSafYkm7PdLQ7Mrao,11717
157
- bmcgo/codegen/lua/v1/script/render_utils/model_lua.py,sha256=zIcWxspjnfF-r9MZEXM9i5IUr0zNPEIOnMAk1DN5l7g,18059
158
- bmcgo/codegen/lua/v1/templates/apps/model.lua.mako,sha256=ORS8i3cDaP7rqEa1W3yI7DmD1X3wUeIZKj42I70AmS8,1979
159
- bmcgo/codegen/lua/v1/templates/apps/service.lua.mako,sha256=52zAvt7tqgeSsBleaiOtpbUoTv0WUJd0mqzRXc8iNO4,7477
157
+ bmcgo/codegen/lua/v1/script/render_utils/model_lua.py,sha256=NTB1RYxjqBypm5KeRKpJSige6HtaZl_EI9mHJ5HZ9Ss,19024
158
+ bmcgo/codegen/lua/v1/templates/apps/client.lua.mako,sha256=9zxmgtIefq25_BJmSkaprLVMtoBgFhWVu0hB1a-vFz0,10270
159
+ bmcgo/codegen/lua/v1/templates/apps/model.lua.mako,sha256=EmHD62fk0QetQUO0DPz2BEc2NZmbq39pozqm4-ngYEY,2056
160
+ bmcgo/codegen/lua/v1/templates/apps/service.lua.mako,sha256=9LJ-G_FXNSohkAlJZ0aPLn3e4F3tWYIWDbVx6T6geWM,5648
160
161
  bmcgo/component/__init__.py,sha256=BDXz8BcSlCkfo5UYt6j2rm89-HiYA1ZzfpFhy99MH-0,538
161
162
  bmcgo/component/build.py,sha256=S0borHjBQfb0EWQ6uqKWUJGImkzHpb2x5qqz-qnzsHI,8959
162
163
  bmcgo/component/component_dt_version_parse.py,sha256=KyrfyjbrszU-hhG1Hr6TzKuSabmGIK51b_3KuVBv5-g,14139
@@ -177,7 +178,7 @@ bmcgo/component/analysis/smc_dfx_whitelist.json,sha256=dy_6-FddhG6UY7D1KUCW3Vme2
177
178
  bmcgo/component/analysis/sr_validation.py,sha256=i1mlJb_D7RqE510LSAcCW81K1VUmZ7oSmLiMfUgdSJI,15598
178
179
  bmcgo/component/coverage/__init__.py,sha256=ZgUEyI86FTlOdBzcuTzz7UqTtfWcz416Gx4BCqcQlhA,557
179
180
  bmcgo/component/coverage/c_incremental_cov_report.template,sha256=FPhK1DZtmWsjDxa32R1ViH3IGCtNHcx0zFfgRo0s2nI,1576
180
- bmcgo/component/coverage/incremental_cov.py,sha256=JFmlJONo0eVGu39Es5BmYyKVh-PuSOPqi4FqwqrcGfE,16823
181
+ bmcgo/component/coverage/incremental_cov.py,sha256=tkeGpWfXXkipeDTEB9bS_p2S60rL_Eh0AWQbnSwHlK0,16803
181
182
  bmcgo/component/template/conanbase.py.mako,sha256=MMZezCl5oFucRraOJt1WjmPL2S7wa4Hzfc7yDfTkW7Q,10949
182
183
  bmcgo/component/template/conanfile.deploy.py.mako,sha256=zpxluBjUFmJHfFrnBknxZ3cv3cxcqzJuGh2eN0uMXZA,889
183
184
  bmcgo/functional/__init__.py,sha256=BDXz8BcSlCkfo5UYt6j2rm89-HiYA1ZzfpFhy99MH-0,538
@@ -212,7 +213,7 @@ bmcgo/tasks/download_buildtools_hm.py,sha256=f4UxStARc8Z8DnT_5O6ONajQ7P0sKyJ8bri
212
213
  bmcgo/tasks/misc.py,sha256=GK_bSDLGZW0FxywB2ICG1iIEz2y2QoCb1YQQk8SYOIA,711
213
214
  bmcgo/tasks/task.py,sha256=n7EhquD3FQeT8LHk0tREKOG9t1BcbMge_TY6ekGFydk,17064
214
215
  bmcgo/tasks/task_build_conan.py,sha256=nQt4VyK4QHh2u4JbM8kfK9WBVIMGKI18S2NPg9orlvQ,32962
215
- bmcgo/tasks/task_build_rootfs_img.py,sha256=uFrMfrpaAHB_2QQdEo46P8TgFrGMTG-xfZUlxzJLSQ0,30443
216
+ bmcgo/tasks/task_build_rootfs_img.py,sha256=0SF_3EAA1SNY1s7YyMBadHrJTp7A2mBD0r3te-231wQ,30456
216
217
  bmcgo/tasks/task_build_wbd_up.py,sha256=X9-0Qqad-s3mGfJBMeBQvfZ99KlWcgaMluDr_zv6Z-o,3122
217
218
  bmcgo/tasks/task_buildgppbin.py,sha256=Xjfw6j8OsyS_XRiOt4vqIK1rDQ4sNKG__eurDu-M9bo,6341
218
219
  bmcgo/tasks/task_buildhpm_ext4.py,sha256=DBZnmU_eb14J0CW_wVoCc9VKnssFF1vXmRhLJQ6kR28,3482
@@ -245,8 +246,8 @@ bmcgo/utils/installations/version_util.py,sha256=dOwvLZ7iOmnzSeyD6_pRm7NS7I13Um5
245
246
  bmcgo/utils/installations/install_plans/bingo.yml,sha256=Zw1HnAyNJdEwkE3fnd-_GCe9bwv1m6bmMlaQTJXaFa8,210
246
247
  bmcgo/utils/installations/installers/apt_installer.py,sha256=nPaCb4cobSi9InN_aHsEPtQ0k4FgsCUWE5_VgBPvcRE,3769
247
248
  bmcgo/utils/installations/installers/pip_installer.py,sha256=dDdios1EQ7fzt90r02pZeoM3jCmjslLzkSvzd2hgRVM,3241
248
- openubmc_bingo-0.5.254.dist-info/METADATA,sha256=8j5YISPGw7_HqnCHCbsotTo030S0JKPoYYE9dLw5-qU,925
249
- openubmc_bingo-0.5.254.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
250
- openubmc_bingo-0.5.254.dist-info/entry_points.txt,sha256=UUoUP-vAWTgg9vEYbRwYqOBHgpRtkngdzMPb-ocz90g,42
251
- openubmc_bingo-0.5.254.dist-info/top_level.txt,sha256=9AcvCAt1nZcOgMsGt6T07mg2Bgtdet-3mHTwg91axgI,6
252
- openubmc_bingo-0.5.254.dist-info/RECORD,,
249
+ openubmc_bingo-0.5.257.dist-info/METADATA,sha256=pBgExKV-sTCM87lJyeEWK-2F7YEf0s4NAZGlVBFGBR0,925
250
+ openubmc_bingo-0.5.257.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
251
+ openubmc_bingo-0.5.257.dist-info/entry_points.txt,sha256=UUoUP-vAWTgg9vEYbRwYqOBHgpRtkngdzMPb-ocz90g,42
252
+ openubmc_bingo-0.5.257.dist-info/top_level.txt,sha256=9AcvCAt1nZcOgMsGt6T07mg2Bgtdet-3mHTwg91axgI,6
253
+ openubmc_bingo-0.5.257.dist-info/RECORD,,