Commit graph

9 commits

Author SHA1 Message Date
77d43aebad Add type annotations from monkeytype + jw-devops/test
Add type annotations as generated by monkeytype and jw-devops/test, plus some
hand editing to satisfy both monkeytype and mypy.

Signed-off-by: Jan Lindemann <jan@janware.com>
2020-04-10 17:55:36 +02:00
952bf4a4e1 Fix Python errors reported by mypy
This commit fixes Python errors and warnings reported by static type checking
with mypy.

Signed-off-by: Jan Lindemann <jan@janware.com>
2020-04-10 14:17:15 +02:00
47f4de938f jwutils.misc: Add commit_tmpfile()
commit_tmpfile() is a better os.rename which doesn't do anything if
source and target files are equal, and logs if does something.

Signed-off-by: Jan Lindemann <jan@janware.com>
2020-04-08 08:50:54 +02:00
6d6c48e6b8 jwutils.misc: Add get_derived_classes()
get_derived_classes(mod, baseclass) returns a list of class
definitions from a module which are subclasses of baseclass.

Signed-off-by: Jan Lindemann <jan@janware.com>
2020-04-05 16:53:12 +02:00
ddfb500fa2 Add misc.object_builtin_name()
object_builtin_name() is meant to derive an object name from its
class name. Doesn't work well, but adding the code nonetheless for
improving it later.

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-10-24 18:45:05 +02:00
ef79027b06 misc.py: Make process cleanup more robust
Eliminate a far chance of an exception thrown during process cleanup.

Signed-off-by: Jan Lindemann <jan@janware.com>
2017-11-22 09:52:22 +01:00
4a200c8851 misc.py: Add atomic_store()
Signed-off-by: Jan Lindemann <jan@janware.com>
2017-11-22 09:33:18 +01:00
8c5934725c grammar.py: Add support for --irrelevant-symbols
Arguments to --irrelevant-symbols are not meant to be represented in the
AST resulting from parsing.

Also, add pad() to misc.py.

Signed-off-by: Jan Lindemann <jan@janware.com>
2017-10-30 10:00:25 +01:00
f6e5d25df7 Add misc.py
Signed-off-by: Jan Lindemann <jan@janware.com>
2017-07-25 17:06:03 +02:00