py2docfx 0.1.9.dev1927042__py3-none-any.whl → 0.1.9.dev1927662__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.
py2docfx/__main__.py CHANGED
@@ -362,7 +362,7 @@ def main(argv) -> int:
362
362
  warning_count, error_count = get_warning_error_count()
363
363
  output_log_by_log_level()
364
364
  print(f"Warning count: {warning_count}, Error count: {error_count}")
365
-
365
+ logging.shutdown()
366
366
  return 0
367
367
 
368
368
  if __name__ == "__main__":
@@ -1,7 +1,6 @@
1
1
  import os
2
2
  import logging
3
3
  import subprocess
4
- import shutil
5
4
 
6
5
  def get_log_level():
7
6
  if os.environ.get('LOG_LEVEL') == 'WARNING':
@@ -24,7 +23,7 @@ def check_log_file_exists(log_file_path):
24
23
  def setup_log_handlers(logger, log_file_name):
25
24
  check_log_file_exists(log_file_name)
26
25
  file_handler = logging.FileHandler(filename=log_file_name, mode='a')
27
- file_handler.setFormatter(logging.Formatter('%(name)s - %(levelname)s - %(message)s'))
26
+ file_handler.setFormatter(logging.Formatter('%(levelname)s - %(name)s - %(message)s'))
28
27
 
29
28
  logger.addHandler(file_handler)
30
29
 
@@ -67,12 +66,7 @@ def log_subprocess_ouput(subprocess_out: subprocess.CompletedProcess, logger: lo
67
66
  for msg in msgs:
68
67
  if msg is None or msg == "":
69
68
  continue
70
- if "WARNING:" in msg:
71
- logger.warning(msg)
72
- elif "ERROR:" in msg:
73
- logger.error(msg)
74
- else:
75
- logger.info(msg)
69
+ logger.warning(msg)
76
70
  if subprocess_out.returncode != 0:
77
71
  logger.error(f"Subprocess failed with return code {subprocess_out.returncode}")
78
72
  raise RuntimeError()
@@ -83,9 +77,9 @@ def counts_errors_warnings(log_file_path):
83
77
  with open(log_file_path, 'r', encoding='utf-8') as f:
84
78
  lines = f.readlines()
85
79
  for line in lines:
86
- if "- ERROR -" in line:
80
+ if line.startswith("ERROR -"):
87
81
  error_count += 1
88
- elif "- WARNING -" in line:
82
+ elif line.startswith("WARNING -"):
89
83
  warning_count += 1
90
84
  return warning_count, error_count
91
85
 
@@ -109,18 +103,18 @@ def parse_log(log_file_path):
109
103
  with open(log_file_path, 'r', encoding='utf-8') as f:
110
104
  lines = f.readlines()
111
105
  for line in lines:
112
- if "- ERROR -" in line:
106
+ if line.startswith("ERROR -"):
113
107
  level = logging.INFO
114
- elif "- WARNING -" in line:
108
+ elif line.startswith("WARNING -"):
115
109
  level = logging.WARNING
116
- elif "- INFO -" in line:
110
+ elif line.startswith("INFO -"):
117
111
  level = logging.INFO
118
112
  else:
119
113
  # put everything to the previous message
120
114
  log_list[-1]['message'] += line
121
115
  continue
122
116
  temp_info = line.split(" - ")
123
- logger_name = temp_info[0]
117
+ logger_name = temp_info[1]
124
118
  message = temp_info[2]
125
119
  log_list.append({'name': logger_name, 'level': level, 'message': message})
126
120
  return log_list
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py2docfx
3
- Version: 0.1.9.dev1927042
3
+ Version: 0.1.9.dev1927662
4
4
  Summary: A package built based on Sphinx which download source code package and generate yaml files supported by docfx.
5
5
  Author: Microsoft Corporation
6
6
  License: MIT License
@@ -1,5 +1,5 @@
1
1
  py2docfx/__init__.py,sha256=kPRhPGPC1JknDotkksG428c1iIgfFr_4_7Jm-llrowY,72
2
- py2docfx/__main__.py,sha256=FPlWF4X6lM6xoDh3m0KKg1mQ6JbGd2fnnkAmB-yJ1Kk,14438
2
+ py2docfx/__main__.py,sha256=UvFVxhJNQCn9EHyDfHPwDqJrlqGpoadFVIvDavaYpiI,14456
3
3
  py2docfx/convert_prepare/__init__.py,sha256=XxtxrP0kmW3ZBHIAoxsPDEHzcgeC0WSnole8Lk6CjKs,11
4
4
  py2docfx/convert_prepare/constants.py,sha256=RC5DqNkqWvx4hb91FrajZ1R9dBFLxcPyoEJ43jdm36E,102
5
5
  py2docfx/convert_prepare/environment.py,sha256=7EmlodXVG0S5wnn0_VFPwPJ_3OHfJfGpN33SUL3HSRI,7233
@@ -63,7 +63,7 @@ py2docfx/docfx_yaml/convert_enum.py,sha256=QH0OkZq8pFi_nAXem6ddkO_7TSsoY2tz7_wxI
63
63
  py2docfx/docfx_yaml/convert_module.py,sha256=GptO1MRwaQ2Qbu724F0kCDDQQTZe7mWOtrOp3Rzgl-I,2259
64
64
  py2docfx/docfx_yaml/convert_package.py,sha256=Ep7PmvoLInDvY6OU5dveR6iVwyzGRkW3q6lX7yGJ0JE,2109
65
65
  py2docfx/docfx_yaml/directives.py,sha256=zVVuNM_6AU9G6sbqL1UAyHHgPe7bkBWbthXI-PO5ez0,879
66
- py2docfx/docfx_yaml/logger.py,sha256=gkyJtJcllbyItIH8OCy4Klmr4HBojZUjLIEVYQDJ1f4,5092
66
+ py2docfx/docfx_yaml/logger.py,sha256=_XZRN43HfFhoi-1Kk0VztAUlzKRe-wuT4W85GAERRnE,4950
67
67
  py2docfx/docfx_yaml/miss_reference.py,sha256=Btoj9wAvA4u_wU7JHH0Cei3910N8a7MS34OUqJvXAd4,2443
68
68
  py2docfx/docfx_yaml/nodes.py,sha256=tBDi35jLJArlobl07DKOkmH2qz7dudXLp_kTUfR_r2w,412
69
69
  py2docfx/docfx_yaml/parameter_utils.py,sha256=zGSIQrUfbXf9PUK-W_1K83Uo5Zk797Zlze6aMurbHIA,8706
@@ -4176,7 +4176,7 @@ py2docfx/venv/venv1/Lib/site-packages/win32comext/taskscheduler/test/test_addtas
4176
4176
  py2docfx/venv/venv1/Lib/site-packages/win32comext/taskscheduler/test/test_localsystem.py,sha256=08ojAS48W6RLsUbRD45j0SJhg_Y2NFHZT6qjT4Vrig0,75
4177
4177
  py2docfx/venv/venv1/Scripts/pywin32_postinstall.py,sha256=u95n7QQUxpCjrZistYE-3gN451zXzopuJna8cXRQ4Jw,28115
4178
4178
  py2docfx/venv/venv1/Scripts/pywin32_testall.py,sha256=-6yvZmd2lPQc4e8i6PgLsr_totF6mScvoq0Jqr0V2fM,3844
4179
- py2docfx-0.1.9.dev1927042.dist-info/METADATA,sha256=sxPzk_6S7qwW1qZjvoPrJlmvILtYmy8PaBgt_FiAHxA,600
4180
- py2docfx-0.1.9.dev1927042.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
4181
- py2docfx-0.1.9.dev1927042.dist-info/top_level.txt,sha256=5dH2uP81dczt_qQJ38wiZ-gzoVWasfiJALWRSjdbnYU,9
4182
- py2docfx-0.1.9.dev1927042.dist-info/RECORD,,
4179
+ py2docfx-0.1.9.dev1927662.dist-info/METADATA,sha256=P_XMnj_2hUmGQfQ2Q0YaydAkyKbWiJR-ADOLE67CEdA,600
4180
+ py2docfx-0.1.9.dev1927662.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
4181
+ py2docfx-0.1.9.dev1927662.dist-info/top_level.txt,sha256=5dH2uP81dczt_qQJ38wiZ-gzoVWasfiJALWRSjdbnYU,9
4182
+ py2docfx-0.1.9.dev1927662.dist-info/RECORD,,