hooray epilog replace. boltons now advertises its stats (might need to find a better place for them tho)

This commit is contained in:
Mahmoud Hashemi 2015-04-07 02:39:47 -07:00
parent 9145a4fb92
commit d5733ed9e8
2 changed files with 17 additions and 3 deletions

View File

@ -28,8 +28,9 @@ sys.path.insert(0, PACKAGE_PATH)
def get_mod_stats():
# TODO: docstring percentage.
import pkgutil
from boltons.funcutils import get_module_defs
from boltons.funcutils import get_module_callables
mod_count = 0
tot_type_count = 0
@ -39,7 +40,7 @@ def get_mod_stats():
if not mod_name.endswith('utils'):
continue
mod = __import__(mod_name)
types, funcs, others = get_module_defs(mod, ignore=ignore)
types, funcs = get_module_callables(mod, ignore=ignore)
if not len(types) and not len(funcs):
continue
mod_count += 1
@ -50,7 +51,15 @@ def get_mod_stats():
print ('==== %s modules ==== %s types ==== %s funcs ====' % ret)
return ret
get_mod_stats()
B_MOD_COUNT, B_TYPE_COUNT, B_FUNC_COUNT = get_mod_stats()
rst_epilog = """
.. |b_mod_count| replace:: {mod_count}
.. |b_type_count| replace:: {type_count}
.. |b_func_count| replace:: {func_count}
""".format(mod_count=B_MOD_COUNT,
type_count=B_TYPE_COUNT,
func_count=B_FUNC_COUNT)
# -- General configuration ------------------------------------------------

View File

@ -45,6 +45,11 @@ great! Built-in support for imaginary numbers for goodness sake!
Gaps
----
.. appx 50, 75, and 20, respectively
Boltons is |b_type_count| types and |b_func_count| functions spread
across |b_mod_count| modules. Gaps are bound to be found.
Found something missing in the standard library that should be in
``boltons``? First, take a moment to read the very brief
:doc:`architecture` statement to make sure the functionality would be