mdbq 3.7.19__py3-none-any.whl → 3.7.21__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.
@@ -22,7 +22,7 @@ import sys
22
22
 
23
23
  """
24
24
 
25
- content = config.read_config(file_path=os.path.join(os.path.realpath(os.path.dirname(sys.argv[0])), 'spd.cnf'))
25
+ content = config.read_config(file_path=os.path.join(os.path.realpath(os.path.dirname(sys.argv[0])), 'spd.ini'))
26
26
  username, password, host, port = content['username'], content['password'], content['host'], content['port']
27
27
  m_engine = mysql.MysqlUpload(username=username, password=password, host=host, port=port, charset='utf8mb4')
28
28
 
mdbq/config/config.py CHANGED
@@ -8,7 +8,7 @@ def read_config(file_path):
8
8
  print(f'配置文件不存在: {file_path}')
9
9
  return
10
10
  config = {}
11
- with open(file_path, 'r') as file:
11
+ with open(file_path, 'r', encoding='utf-8') as file:
12
12
  for line in file:
13
13
  stripped_line = line.strip()
14
14
  # 跳过空行和注释行(以 # 或 // 开头)
@@ -31,14 +31,14 @@ def write_config(file_path, rewrite):
31
31
  """
32
32
  更新配置文件中的键值对,保留注释和其他内容,修复等号空格问题
33
33
  示例:
34
- write_config('spd.cnf', {'is_spider': True})
34
+ write_config('spd.ini', {'is_spider': True})
35
35
  """
36
36
  # 读取所有行到内存
37
37
  try:
38
- with open(file_path, 'r') as file:
38
+ with open(file_path, 'r', encoding='utf-8') as file:
39
39
  lines = file.readlines()
40
40
  except FileNotFoundError:
41
- with open(file_path, 'w') as file:
41
+ with open(file_path, 'w', encoding='utf-8') as file:
42
42
  lines = []
43
43
 
44
44
  new_lines = []
@@ -84,12 +84,12 @@ def write_config(file_path, rewrite):
84
84
  new_lines.append(f"{key} = {rewrite[key]}\n")
85
85
 
86
86
  # 写入文件
87
- with open(file_path, 'w') as file:
87
+ with open(file_path, 'w', encoding='utf-8') as file:
88
88
  file.writelines(new_lines)
89
89
 
90
90
 
91
91
  if __name__ == '__main__':
92
- res = read_config('/Users/xigua/数据中心2/spider/spd.cnf')
92
+ res = read_config('/Users/xigua/数据中心2/spider/spd.ini')
93
93
  print(res)
94
- # write_config('spd.cnf', {'is_spider': False})
94
+ # write_config('spd.ini', {'is_spider': False})
95
95
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mdbq
3
- Version: 3.7.19
3
+ Version: 3.7.21
4
4
  Home-page: https://pypi.org/project/mdbq
5
5
  Author: xigua,
6
6
  Author-email: 2587125111@qq.com
@@ -2,11 +2,11 @@ mdbq/__init__.py,sha256=Il5Q9ATdX8yXqVxtP_nYqUhExzxPC_qk_WXQ_4h0exg,16
2
2
  mdbq/__version__.py,sha256=y9Mp_8x0BCZSHsdLT_q5tX9wZwd5QgqrSIENLrb6vXA,62
3
3
  mdbq/aggregation/__init__.py,sha256=EeDqX2Aml6SPx8363J-v1lz0EcZtgwIBYyCJV6CcEDU,40
4
4
  mdbq/aggregation/optimize_data_bak.py,sha256=wB7prQdZAHyjzXH9V8g8X_JBMdvCCUITN1hVwK72Tdg,952
5
- mdbq/aggregation/query_data.py,sha256=qA-JsYwbK7aRDdwUATPBTbKdR_64jsB20edr8MMGvPk,174306
5
+ mdbq/aggregation/query_data.py,sha256=D05M1-l4b41AzGLT32svOhCjcPGlIm3n2NTh0nTzHGU,174306
6
6
  mdbq/bdup/__init__.py,sha256=AkhsGk81SkG1c8FqDH5tRq-8MZmFobVbN60DTyukYTY,28
7
7
  mdbq/bdup/bdup.py,sha256=hJs815hGFwm_X5bP2i9XugG2w2ZY_F0n3-Q0hVpIPPw,4892
8
8
  mdbq/config/__init__.py,sha256=jso1oHcy6cJEfa7udS_9uO5X6kZLoPBF8l3wCYmr5dM,18
9
- mdbq/config/config.py,sha256=TdSGY8-lS-dJiH51mi3QAPRs6ZvvW1Q4zNiZYwrHiiY,3098
9
+ mdbq/config/config.py,sha256=bBlol__JA6VK-dEGEwOBTX1F3XqHgOff96W4hfbzVUE,3170
10
10
  mdbq/config/default_bak.py,sha256=pOBmlxmGzmK8XYstv_qwE4vDwJmytEmVIYE0bDnCXOs,2143
11
11
  mdbq/config/myconfig_bak.py,sha256=5gg3B8fnDx2_a5I3kfPLXx7xePqZwfb3ohj6iMVhplc,1022
12
12
  mdbq/config/products_bak.py,sha256=kWN3NWp9uT6D0M4Vw33yqOo9Tb98hEO8-X-llRjoY8M,5731
@@ -34,7 +34,7 @@ mdbq/redis/__init__.py,sha256=YtgBlVSMDphtpwYX248wGge1x-Ex_mMufz4-8W0XRmA,12
34
34
  mdbq/redis/getredis.py,sha256=1pTga2iINx0NV2ffl0D-aspZhrZMDQR8SpohAv1acoo,24076
35
35
  mdbq/spider/__init__.py,sha256=RBMFXGy_jd1HXZhngB2T2XTvJqki8P_Fr-pBcwijnew,18
36
36
  mdbq/spider/aikucun.py,sha256=o_QwFWbD6O2F56k6bwnpVV55EcdFCyes05ON7iu9TrA,21882
37
- mdbq-3.7.19.dist-info/METADATA,sha256=R-8wefH_irfcE7wlkHhT9dahjDVCG7BzrXwimDO1YO0,244
38
- mdbq-3.7.19.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
39
- mdbq-3.7.19.dist-info/top_level.txt,sha256=2FQ-uLnCSB-OwFiWntzmwosW3X2Xqsg0ewh1axsaylA,5
40
- mdbq-3.7.19.dist-info/RECORD,,
37
+ mdbq-3.7.21.dist-info/METADATA,sha256=djMBfPKhIng7q9z0YfYiUwAtXxsblvuMfY4eThgreV4,244
38
+ mdbq-3.7.21.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
39
+ mdbq-3.7.21.dist-info/top_level.txt,sha256=2FQ-uLnCSB-OwFiWntzmwosW3X2Xqsg0ewh1axsaylA,5
40
+ mdbq-3.7.21.dist-info/RECORD,,
File without changes