Read in docstrings from lang-specific docstring dictionary. Transfer docstrings, translated to lang, from a dictionary-file to the methods of classes Screen and Turtle and - in revised form - to the corresponding functions.
(lang)
| 3870 | f.close() |
| 3871 | |
| 3872 | def read_docstrings(lang): |
| 3873 | """Read in docstrings from lang-specific docstring dictionary. |
| 3874 | |
| 3875 | Transfer docstrings, translated to lang, from a dictionary-file |
| 3876 | to the methods of classes Screen and Turtle and - in revised form - |
| 3877 | to the corresponding functions. |
| 3878 | """ |
| 3879 | modname = "turtle_docstringdict_%(language)s" % {'language':lang.lower()} |
| 3880 | module = __import__(modname) |
| 3881 | docsdict = module.docsdict |
| 3882 | for key in docsdict: |
| 3883 | try: |
| 3884 | # eval(key).im_func.__doc__ = docsdict[key] |
| 3885 | eval(key).__doc__ = docsdict[key] |
| 3886 | except Exception: |
| 3887 | print("Bad docstring-entry: %s" % key) |
| 3888 | |
| 3889 | _LANGUAGE = _CFG["language"] |
| 3890 |
no test coverage detected