File tree Expand file tree Collapse file tree 3 files changed +3
-42
lines changed
Expand file tree Collapse file tree 3 files changed +3
-42
lines changed Original file line number Diff line number Diff line change 4545# built documents.
4646#
4747# The short X.Y version.
48- version = '1.0.6 '
48+ version = '1.0.7 '
4949# The full version, including alpha/beta/rc tags.
50- release = '1.0.6 '
50+ release = '1.0.7 '
5151
5252# The language for content autogenerated by Sphinx. Refer to documentation
5353# for a list of supported languages.
Original file line number Diff line number Diff line change 1515import python_toolbox .monkeypatch_copyreg
1616import python_toolbox .monkeypatch_envelopes
1717
18- __version__ = '1.0.6 '
18+ __version__ = '1.0.7 '
1919__version_info__ = python_toolbox .version_info .VersionInfo (
2020 * (map (int , __version__ .split ('.' )))
2121)
Original file line number Diff line number Diff line change 1111import pathlib
1212
1313
14- from python_toolbox import package_finder
1514from python_toolbox import caching
1615
1716
1817
19- def import_all (package , exclude = '__init__' , silent_fail = False ):
20- '''
21- Import all the modules and packages that live inside the given package.
22-
23- This is not recursive. Modules and packages defined inside a subpackage
24- will not be imported (of course, that subpackage itself may import them
25- anyway.)
26-
27- You may specify a module/package to exclude, which is by default
28- `__init__`.
29-
30- Returns a list with all the imported modules and packages.
31-
32- todo: only tested with __init__ passed in
33- '''
34-
35- paths = package_finder .get_packages_and_modules_filenames (package )
36-
37- names = {}
38- for path in paths :
39- name = path .stem
40- if name == exclude :
41- continue
42- full_name = package .__name__ + '.' + name
43- names [path ] = full_name
44-
45- d = {}
46-
47- for (path , name ) in names .items ():
48- try :
49- d [name ] = normal_import (name )
50- except Exception :
51- if not silent_fail :
52- raise
53-
54- return d
55-
56-
5718def normal_import (module_name ):
5819 '''
5920 Import a module.
You can’t perform that action at this time.
0 commit comments