gomyck-tools 1.5.1__py3-none-any.whl → 1.5.2__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.
ctools/cjson.py CHANGED
@@ -1,4 +1,7 @@
1
+ import decimal
2
+
1
3
  import jsonpickle
4
+ from jsonpickle.handlers import BaseHandler
2
5
 
3
6
  # 需要转换成str的属性
4
7
  str_value_keys = []
@@ -6,6 +9,11 @@ jsonpickle.set_preferred_backend('json')
6
9
  jsonpickle.set_encoder_options('json', ensure_ascii=False)
7
10
  jsonpickle.set_decoder_options('json')
8
11
 
12
+ class DecimalHandler(BaseHandler):
13
+ def flatten(self, obj, data):
14
+ return float(obj) if obj is not None else 0
15
+
16
+ jsonpickle.handlers.register(decimal.Decimal, DecimalHandler)
9
17
 
10
18
  def dumps(obj, **kwargs) -> str:
11
19
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gomyck-tools
3
- Version: 1.5.1
3
+ Version: 1.5.2
4
4
  Summary: A tools collection for python development by hao474798383
5
5
  Author-email: gomyck <hao474798383@163.com>
6
6
  License-Expression: Apache-2.0
@@ -5,7 +5,7 @@ ctools/call.py,sha256=TFFC8PqvCu0PS0XelmV4QXdXezQiUsEacxg3RgKvdwE,1572
5
5
  ctools/cdate.py,sha256=OhKAaQfo2Rxd3Jx3g9AfPsaISRoLkstqZdaGT4ZZr_I,3096
6
6
  ctools/cdebug.py,sha256=_mihZRCEx_bi7Kv_QPjP4MPLNFrl-GR1Y_irTgOP7OU,4021
7
7
  ctools/cid.py,sha256=utxK9u6Df1HuMaiQztqnJ5EENYaJHzZ0pCIuXpveckA,401
8
- ctools/cjson.py,sha256=XloZIRnc8Wd8OsTAqDRvhmkqbj97KtyzXTDWJm-unZk,1370
8
+ ctools/cjson.py,sha256=A6jRvXUR75LaHCW02OnCraELAwwDv1dXnayCj1PXJSw,1608
9
9
  ctools/cron_lite.py,sha256=rVu9S2oouaw_XZ5RMDJidCNepg5yoEJwLcfcaGTuJRA,8235
10
10
  ctools/dict_wrapper.py,sha256=0NRtHUX7MVjfIyms_gJiofGcD-x4lBCnaSpkk5yDdjE,461
11
11
  ctools/ex.py,sha256=9npepunW0G1obXqjnvUEiNAjQ5XDazZvEtlF5ceFRCM,869
@@ -81,8 +81,8 @@ ctools/web/ctoken.py,sha256=WaB29kqGlKAh21aUw5avl2h8AgLD1aESw8KCpqaN5nM,2539
81
81
  ctools/web/download_util.py,sha256=v0JTXiED1bvoWFfwfd-LD5s7_aoRQ0lCkaGwSnSp7WI,1954
82
82
  ctools/web/params_util.py,sha256=eJDV3PSq-ZHb8UZf6xqs8kOhbyZzits1H9yPoUBIDXg,828
83
83
  ctools/web/upload_util.py,sha256=z1QQCi4SFx08jrAQH5-Y_ShiM4MghuD_5Qz6V9KK_4U,1076
84
- gomyck_tools-1.5.1.dist-info/licenses/LICENSE,sha256=X25ypfH9E6VTht2hcO8k7LCSdHUcoG_ALQt80jdYZfY,547
85
- gomyck_tools-1.5.1.dist-info/METADATA,sha256=pblfOhcxA0hRXLOhZAJczlFu3Y9gfwaifo08RyxJJiA,1826
86
- gomyck_tools-1.5.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
87
- gomyck_tools-1.5.1.dist-info/top_level.txt,sha256=-MiIH9FYRVKp1i5_SVRkaI-71WmF1sZSRrNWFU9ls3s,7
88
- gomyck_tools-1.5.1.dist-info/RECORD,,
84
+ gomyck_tools-1.5.2.dist-info/licenses/LICENSE,sha256=X25ypfH9E6VTht2hcO8k7LCSdHUcoG_ALQt80jdYZfY,547
85
+ gomyck_tools-1.5.2.dist-info/METADATA,sha256=g3hKnHGV8s5DRPzimxL0XBhLbvHelBTKi0fAhN_iwto,1826
86
+ gomyck_tools-1.5.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
87
+ gomyck_tools-1.5.2.dist-info/top_level.txt,sha256=-MiIH9FYRVKp1i5_SVRkaI-71WmF1sZSRrNWFU9ls3s,7
88
+ gomyck_tools-1.5.2.dist-info/RECORD,,