Skip to content
Permalink
Browse files

genrest: De-spam docs by skipping direct deps. in more places

Similar deal to commit cc14c40 ("kconfiglib: Unclutter symbol
strings, avoid redundant writes, misc.").

Hide the direct dependencies in the defaults, selects, and implies
sections. Do the same in menuconfig/guiconfig as well.

This uses a new Kconfiglib API, so update Kconfiglib to upstream
revision 164ef007a8. This also includes some minor optimizations and
cleanups.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
  • Loading branch information...
ulfalizer authored and andrewboie committed Jun 24, 2019
1 parent 465b2cf commit a570b40252cd7b03392a450a8762fdbede6a6ec6
Showing with 271 additions and 225 deletions.
  1. +5 −5 doc/scripts/genrest.py
  2. +5 −7 scripts/kconfig/guiconfig.py
  3. +166 −125 scripts/kconfig/kconfiglib.py
  4. +95 −88 scripts/kconfig/menuconfig.py
@@ -211,7 +211,7 @@ def direct_deps_rst(sc):
return "Direct dependencies\n" \
"===================\n\n" \
"{}\n\n" \
"*(Includes any dependencies from if's and menus.)*\n\n" \
"*(Includes any dependencies from ifs and menus.)*\n\n" \
.format(expr_str(sc.direct_dep))


@@ -228,7 +228,7 @@ def defaults_rst(sc):
"========\n\n"

if sc.defaults:
for value, cond in sc.defaults:
for value, cond in sc.orig_defaults:
rst += "- " + expr_str(value)
if cond is not sc.kconfig.y:
rst += " if " + expr_str(cond)
@@ -289,8 +289,8 @@ def add_select_imply_rst(type_str, lst):

rst += "\n"

add_select_imply_rst("selected", sym.selects)
add_select_imply_rst("implied", sym.implies)
add_select_imply_rst("selected", sym.orig_selects)
add_select_imply_rst("implied", sym.orig_implies)

return rst

@@ -389,7 +389,7 @@ def menu_path(node):
rst += "\n\n----"

rst += "\n\n*(The 'depends on' condition includes propagated " \
"dependencies from if's and menus.)*"
"dependencies from ifs and menus.)*"

return rst

@@ -1308,15 +1308,13 @@ def _check_valid(dialog, entry, sym, s):

for low_sym, high_sym, cond in sym.ranges:
if expr_value(cond):
low = int(low_sym.str_value, base)
val = int(s, base)
high = int(high_sym.str_value, base)
low_s = low_sym.str_value
high_s = high_sym.str_value

if not low <= val <= high:
if not int(low_s, base) <= int(s, base) <= int(high_s, base):
messagebox.showerror(
"Value out of range",
"{} is outside the range {}-{}".format(
s, low_sym.str_value, high_sym.str_value),
"{} is outside the range {}-{}".format(s, low_s, high_s),
parent=dialog)
entry.focus_set()
return False
@@ -2123,7 +2121,7 @@ def _defaults_info(sc):

s = "Defaults:\n"

for val, cond in sc.defaults:
for val, cond in sc.orig_defaults:
s += " - "
if isinstance(sc, Symbol):
s += _expr_str(val)

0 comments on commit a570b40

Please sign in to comment.
You can’t perform that action at this time.