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)
| 3999 | f.close() |
| 4000 | |
| 4001 | def read_docstrings(lang): |
| 4002 | """Read in docstrings from lang-specific docstring dictionary. |
| 4003 | |
| 4004 | Transfer docstrings, translated to lang, from a dictionary-file |
| 4005 | to the methods of classes Screen and Turtle and - in revised form - |
| 4006 | to the corresponding functions. |
| 4007 | """ |
| 4008 | modname = "turtle_docstringdict_%(language)s" % {'language':lang.lower()} |
| 4009 | module = __import__(modname) |
| 4010 | docsdict = module.docsdict |
| 4011 | for key in docsdict: |
| 4012 | try: |
| 4013 | # eval(key).im_func.__doc__ = docsdict[key] |
| 4014 | eval(key).__doc__ = docsdict[key] |
| 4015 | except Exception: |
| 4016 | print("Bad docstring-entry: %s" % key) |
| 4017 | |
| 4018 | _LANGUAGE = _CFG["language"] |
| 4019 |
no test coverage detected
searching dependent graphs…