lbkit 0.5.7__tar.gz → 0.5.8__tar.gz

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.
Files changed (50) hide show
  1. {lbkit-0.5.7/lbkit.egg-info → lbkit-0.5.8}/PKG-INFO +1 -1
  2. lbkit-0.5.8/lbkit/__init__.py +2 -0
  3. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/codegen/template/client.c.mako +17 -2
  4. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/codegen/template/client.h.mako +12 -4
  5. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/codegen/template/public.c.mako +17 -3
  6. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/codegen/template/public.h.mako +10 -2
  7. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/codegen/template/server.c.mako +9 -2
  8. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/codegen/template/server.h.mako +5 -1
  9. {lbkit-0.5.7 → lbkit-0.5.8/lbkit.egg-info}/PKG-INFO +1 -1
  10. lbkit-0.5.7/lbkit/__init__.py +0 -2
  11. {lbkit-0.5.7 → lbkit-0.5.8}/AUTHORS +0 -0
  12. {lbkit-0.5.7 → lbkit-0.5.8}/LICENSE +0 -0
  13. {lbkit-0.5.7 → lbkit-0.5.8}/MANIFEST.in +0 -0
  14. {lbkit-0.5.7 → lbkit-0.5.8}/README.md +0 -0
  15. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/ci_robot/__init__.py +0 -0
  16. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/ci_robot/gitee.py +0 -0
  17. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/cli.py +0 -0
  18. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/codegen/__init__.py +0 -0
  19. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/codegen/codegen.py +0 -0
  20. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/codegen/ctype_defination.py +0 -0
  21. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/codegen/idf_interface.py +0 -0
  22. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/codegen/renderer.py +0 -0
  23. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/codegen/template/interface.c.mako +0 -0
  24. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/codegen/template/interface.introspect.xml.mako +0 -0
  25. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/component/__init__.py +0 -0
  26. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/component/arg_parser.py +0 -0
  27. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/component/build.py +0 -0
  28. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/component/template/conanbase.mako +0 -0
  29. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/component/template/deploy.mako +0 -0
  30. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/component/test.py +0 -0
  31. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/errors.py +0 -0
  32. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/helper.py +0 -0
  33. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/integration/__init__.py +0 -0
  34. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/integration/build_manifest.py +0 -0
  35. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/integration/build_prepare.py +0 -0
  36. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/integration/build_rootfs.py +0 -0
  37. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/integration/config.py +0 -0
  38. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/integration/task.py +0 -0
  39. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/integration/template/conanfile.py.mako +0 -0
  40. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/lbkit.py +0 -0
  41. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/log.py +0 -0
  42. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/misc.py +0 -0
  43. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit/tools.py +0 -0
  44. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit.egg-info/SOURCES.txt +0 -0
  45. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit.egg-info/dependency_links.txt +0 -0
  46. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit.egg-info/entry_points.txt +0 -0
  47. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit.egg-info/requires.txt +0 -0
  48. {lbkit-0.5.7 → lbkit-0.5.8}/lbkit.egg-info/top_level.txt +0 -0
  49. {lbkit-0.5.7 → lbkit-0.5.8}/setup.cfg +0 -0
  50. {lbkit-0.5.7 → lbkit-0.5.8}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lbkit
3
- Version: 0.5.7
3
+ Version: 0.5.8
4
4
  Summary: Tools provided by litebmc.com
5
5
  Home-page: https://www.litebmc.com
6
6
  Author: xuhj@litebmc.com
@@ -0,0 +1,2 @@
1
+
2
+ __version__ = '0.5.8'
@@ -45,6 +45,14 @@ gint ${class_name}_get_${prop.name}(const ${class_name} *object, GVariant **valu
45
45
  % endfor
46
46
 
47
47
  % for method in intf.methods:
48
+ <% RSP_PARA = f'' %>\
49
+ <% REQ_PARA = f'' %>\
50
+ % if len(method.returns.parameters) > 0:
51
+ <% RSP_PARA = f'{intf.alias}_{method.name}_Rsp **rsp, ' %>\
52
+ % endif
53
+ % if len(method.parameters.parameters) > 0:
54
+ <% REQ_PARA = f'const {intf.alias}_{method.name}_Req *req, ' %>\
55
+ % endif
48
56
  /*
49
57
  * ${method.description}
50
58
  *
@@ -56,8 +64,9 @@ gint ${class_name}_get_${prop.name}(const ${class_name} *object, GVariant **valu
56
64
  * @out_${arg.name}: ${arg.description}, signature: ${arg.signature}
57
65
  % endfor
58
66
  */
59
- int ${class_name}_Call_${method.name}(const ${class_name} *object, const ${intf.alias}_${method.name}_Req *req,
60
- ${intf.alias}_${method.name}_Rsp **rsp, gint timeout, GError **error)
67
+ int ${class_name}_Call_${method.name}(const ${class_name} *object,
68
+ ${REQ_PARA}${RSP_PARA}gint timeout,
69
+ GError **error)
61
70
  {
62
71
  if (error == NULL) {
63
72
  log_error("Emit method ${method.name} with parameter error, error is NULL");
@@ -67,6 +76,12 @@ int ${class_name}_Call_${method.name}(const ${class_name} *object, const ${intf.
67
76
  *error = g_error_new(G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "Call method ${method.name} with parameter error, object is NULL");
68
77
  return -1;
69
78
  }
79
+ % if len(method.returns.parameters) == 0:
80
+ void **rsp = NULL;
81
+ % endif
82
+ % if len(method.parameters.parameters) == 0:
83
+ void *req = NULL;
84
+ % endif
70
85
  return gcl_impl.call_method((GclObject *)object, (const GclMethod *)&${method_processer}->${method.name},
71
86
  (void *)req, (void **)rsp, timeout, error);
72
87
  }
@@ -29,15 +29,23 @@ gint ${class_name}_get_${prop.name}(const ${class_name} *object, GVariant **valu
29
29
  % endfor
30
30
 
31
31
  % for method in intf.methods:
32
+ <% RSP_PARA = f'' %>\
33
+ <% REQ_PARA = f'' %>\
34
+ % if len(method.returns.parameters) > 0:
35
+ <% RSP_PARA = f'{intf.alias}_{method.name}_Rsp **rsp, ' %>\
36
+ % endif
37
+ % if len(method.parameters.parameters) > 0:
38
+ <% REQ_PARA = f'const {intf.alias}_{method.name}_Req *req, ' %>\
39
+ % endif
32
40
  /* method.description */
33
41
  % if method.deprecated:
34
42
  __attribute__((__deprecated__)) int ${class_name}_Call_${method.name}(const ${class_name} *object,
35
- const ${intf.alias}_${method.name}_Req *req, ${intf.alias}_${method.name}_Rsp **rsp,
36
- gint timeout, GError **error);
43
+ ${REQ_PARA}${RSP_PARA}gint timeout,
44
+ GError **error);
37
45
  % else:
38
46
  int ${class_name}_Call_${method.name}(const ${class_name} *object,
39
- const ${intf.alias}_${method.name}_Req *req, ${intf.alias}_${method.name}_Rsp **rsp,
40
- gint timeout, GError **error);
47
+ ${REQ_PARA}${RSP_PARA}gint timeout,
48
+ GError **error);
41
49
  % endif
42
50
  % endfor
43
51
 
@@ -1028,16 +1028,30 @@ void ${class_name}_${action.name}_unregister(${class_name}_${action.name}_action
1028
1028
  g_mutex_unlock(&_${class_name}_${action.name}_lock);
1029
1029
  }
1030
1030
 
1031
- int ${class_name}_${action.name}_run(const ${class_name} *object, const ${class_name}_${action.name}_Req *req, ${class_name}_${action.name}_Rsp **rsp)
1031
+ <% RSP_PARA = f'' %>\
1032
+ <% REQ_PARA = f'' %>\
1033
+ <% REQ_NAME = f'' %>\
1034
+ % if len(action.returns.parameters) > 0:
1035
+ <% RSP_PARA = f', {class_name}_{action.name}_Rsp **rsp' %>\
1036
+ % endif
1037
+ % if len(action.parameters.parameters) > 0:
1038
+ <% REQ_PARA = f', const {class_name}_{action.name}_Req *req' %>\
1039
+ <% REQ_NAME = f', req' %>\
1040
+ % endif
1041
+ int ${class_name}_${action.name}_run(const ${class_name} *object${REQ_PARA}${RSP_PARA})
1032
1042
  {
1033
1043
  gint result = 0;
1034
1044
  g_mutex_lock(&_${class_name}_${action.name}_lock);
1035
1045
  for (GSList *item = _${class_name}_${action.name}_actions; item; item = item->next) {
1046
+ _${class_name}_${action.name}_PluginAction *handler = (_${class_name}_${action.name}_PluginAction *)item->data;
1047
+ % if len(action.returns.parameters) > 0:
1036
1048
  if (rsp && *rsp) {
1037
1049
  ${class_name}_${action.name}_Rsp_free(rsp);
1038
1050
  }
1039
- _${class_name}_${action.name}_PluginAction *handler = (_${class_name}_${action.name}_PluginAction *)item->data;
1040
- gint ret = handler->action(object, req, rsp, handler->user_data);
1051
+ gint ret = handler->action(object${REQ_NAME}, rsp, handler->user_data);
1052
+ % else:
1053
+ gint ret = handler->action(object${REQ_NAME}, handler->user_data);
1054
+ % endif
1041
1055
  if (ret != 0)
1042
1056
  result = ret;
1043
1057
  % if action.policy == "return_any_success":
@@ -176,13 +176,21 @@ typedef struct {
176
176
 
177
177
  % if len(intf.plugin.actions) > 0:
178
178
  % for action in intf.plugin.actions:
179
- typedef int (*${class_name}_${action.name}_action)(const ${class_name} *object, const ${class_name}_${action.name}_Req *req, ${class_name}_${action.name}_Rsp **rsp, gpointer user_data);
179
+ <% RSP_PARA = f'' %>\
180
+ <% REQ_PARA = f'' %>\
181
+ % if len(action.returns.parameters) > 0:
182
+ <% RSP_PARA = f', {class_name}_{action.name}_Rsq **rsp' %>\
183
+ % endif
184
+ % if len(action.parameters.parameters) > 0:
185
+ <% REQ_PARA = f', const {class_name}_{action.name}_Req *req' %>\
186
+ % endif
187
+ typedef int (*${class_name}_${action.name}_action)(const ${class_name} *object${REQ_PARA}${RSP_PARA}, gpointer user_data);
180
188
 
181
189
  /* Register a new plugin action, can't register repeated with same action and user_data */
182
190
  int ${class_name}_${action.name}_register(const gchar *req_signature, const gchar *rsp_signature,
183
191
  ${class_name}_${action.name}_action action, gpointer user_data);
184
192
  void ${class_name}_${action.name}_unregister(${class_name}_${action.name}_action action);
185
- int ${class_name}_${action.name}_run(const ${class_name} *object, const ${class_name}_${action.name}_Req *req, ${class_name}_${action.name}_Rsp **rsp);
193
+ int ${class_name}_${action.name}_run(const ${class_name} *object${REQ_PARA}${RSP_PARA});
186
194
 
187
195
  % endfor
188
196
  % endif
@@ -213,12 +213,16 @@ void ${class_name}_set_${prop.name}(const ${class_name} *object,
213
213
  * Signal: ${signal.name}
214
214
  * ${signal.description}
215
215
  */
216
+ <% REQ_PARA = f'' %>\
217
+ % if len(signal.properties.parameters) > 0:
218
+ <% REQ_PARA = f'const {class_name}_{signal.name}_Msg *msg, ' %>\
219
+ % endif
216
220
  % if signal.deprecated:
217
221
  __attribute__((__deprecated__)) gboolean ${class_name}_${signal.name}_Signal(const ${class_name} *object,
218
- const gchar *destination, const ${class_name}_${signal.name}_Msg *msg, GError **error)
222
+ const gchar *destination, ${REQ_PARA}GError **error)
219
223
  % else:
220
224
  gboolean ${class_name}_${signal.name}_Signal(const ${class_name} *object, const gchar *destination,
221
- const ${class_name}_${signal.name}_Msg *msg, GError **error)
225
+ ${REQ_PARA}GError **error)
222
226
  % endif
223
227
  {
224
228
  if (error == NULL) {
@@ -229,6 +233,9 @@ gboolean ${class_name}_${signal.name}_Signal(const ${class_name} *object, const
229
233
  *error = g_error_new(G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "Emit ${signal.name} with parameter error, object is NULL");
230
234
  return FALSE;
231
235
  }
236
+ % if len(signal.properties.parameters) == 0:
237
+ void *msg = NULL;
238
+ % endif
232
239
  return gcl_impl.emit_signal((GclObject *)object, destination,
233
240
  (const GclSignal *)&${signal_processer}->${signal.name}, msg, error);
234
241
  }
@@ -26,7 +26,11 @@ void ${class_name}_set_${prop.name}(const ${class_name} *object,
26
26
  /*
27
27
  * ${signal.description}
28
28
  */
29
- gboolean ${class_name}_${signal.name}_Signal(const ${class_name} *object, const gchar *destination, const ${class_name}_${signal.name}_Msg *req, GError **error);
29
+ % if len(signal.properties.parameters) > 0:
30
+ gboolean ${class_name}_${signal.name}_Signal(const ${class_name} *object, const gchar *destination, const ${class_name}_${signal.name}_Msg *msg, GError **error);
31
+ % else:
32
+ gboolean ${class_name}_${signal.name}_Signal(const ${class_name} *object, const gchar *destination, GError **error);
33
+ % endif
30
34
  % endfor
31
35
 
32
36
  #define ${class_name.upper()}_NAME "${intf.name}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lbkit
3
- Version: 0.5.7
3
+ Version: 0.5.8
4
4
  Summary: Tools provided by litebmc.com
5
5
  Home-page: https://www.litebmc.com
6
6
  Author: xuhj@litebmc.com
@@ -1,2 +0,0 @@
1
-
2
- __version__ = '0.5.7'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes