read the api spec file, and scratch the md5sum value of every api's docstring. Args: path: the api spec file. ATTENTION the path relative Returns: api_md5(dict): key is the api's real fullname, value is the md5sum.
(path)
| 328 | |
| 329 | |
| 330 | def get_api_md5(path): |
| 331 | """ |
| 332 | read the api spec file, and scratch the md5sum value of every api's docstring. |
| 333 | |
| 334 | Args: |
| 335 | path: the api spec file. ATTENTION the path relative |
| 336 | |
| 337 | Returns: |
| 338 | api_md5(dict): key is the api's real fullname, value is the md5sum. |
| 339 | """ |
| 340 | api_md5 = {} |
| 341 | API_spec = os.path.abspath(os.path.join(os.getcwd(), "..", path)) |
| 342 | if not os.path.isfile(API_spec): |
| 343 | return api_md5 |
| 344 | |
| 345 | with open(API_spec) as f: |
| 346 | for line in f: |
| 347 | mo = PAT_API_SPEC_MEMBER.search(line) |
| 348 | |
| 349 | if mo: |
| 350 | api_md5[mo.group(1)] = mo.group(2) |
| 351 | else: |
| 352 | mo = PAT_API_SPEC_SIGNATURE.search(line) |
| 353 | api_md5[mo.group(1)] = f'{mo.group(2)}, {mo.group(3)}' |
| 354 | |
| 355 | return api_md5 |
| 356 | |
| 357 | |
| 358 | def get_incrementapi( |