Export the API items into form for use in another script.
()
| 71 | |
| 72 | |
| 73 | def exportItems(): |
| 74 | """Export the API items into form for use in another script.""" |
| 75 | with open(api_item_filename, 'w', encoding='utf-8') as infile: |
| 76 | # write function lead in |
| 77 | infile.write("# Auto-generated file (see get_api_items.py)\n\ndef get_mapped_items():\n mapped_wiki_inline_code = dict()\n") |
| 78 | |
| 79 | for key, value in sorted(api_reference_items.items()): |
| 80 | # Write out each API item to add |
| 81 | infile.write(" mapped_wiki_inline_code['%s'] = '%s'\n" % (key, value)) |
| 82 | |
| 83 | # write the return function |
| 84 | infile.write(" return mapped_wiki_inline_code\n") |
| 85 | |
| 86 | |
| 87 | def main(): |