<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Kconfiglib.git/examples/Kmenuconfig, branch v7.0.0</title>
<subtitle>Fork of https://github.com/zephyrproject-rtos/Kconfiglib.git</subtitle>
<id>https://git.mcdonnell.dev/Kconfiglib.git/atom?h=v7.0.0</id>
<link rel='self' href='https://git.mcdonnell.dev/Kconfiglib.git/atom?h=v7.0.0'/>
<link rel='alternate' type='text/html' href='https://git.mcdonnell.dev/Kconfiglib.git/'/>
<updated>2017-11-04T05:43:43Z</updated>
<entry>
<title>Add menuconfig example/proof of concept</title>
<updated>2017-11-04T05:43:43Z</updated>
<author>
<name>Ulf Magnusson</name>
<email>ulfalizer@gmail.com</email>
</author>
<published>2017-11-04T05:28:24Z</published>
<link rel='alternate' type='text/html' href='https://git.mcdonnell.dev/Kconfiglib.git/commit/?id=b3a9656937b18fae57a5ed53c8528bd1339cfd8d'/>
<id>urn:sha1:b3a9656937b18fae57a5ed53c8528bd1339cfd8d</id>
<content type='text'>
Still needs documentation and some cleanup.

Interface deliberately kept super simple/clunky to focus on the
concepts. Not something you'd actually want to use.

Sample session:

  $ python Kconfiglib/examples/menuconfig.py Kconfiglib/examples/Kmenuconfig

  ======== Example Kconfig configuration ========

  [*] Enable loadable module support (MODULES)
      Bool and tristate symbols
          [*] Bool symbol (BOOL)
                  [ ] Dependent bool symbol (BOOL_DEP)
                  &lt; &gt; Dependent tristate symbol (TRI_DEP)
                  [ ] First prompt (TWO_MENU_NODES)
          &lt; &gt; Tristate symbol (TRI)
          [ ] Second prompt (TWO_MENU_NODES)
              *** These are selected by TRI_DEP ***
          &lt; &gt; Tristate selected by TRI_DEP (SELECTED_BY_TRI_DEP)
          &lt; &gt; Tristate implied by TRI_DEP (IMPLIED_BY_TRI_DEP)
      String, int, and hex symbols
          (foo) String symbol (STRING)
          (747) Int symbol (INT)
          (0xABC) Hex symbol (HEX)
      Various choices
          -*- Bool choice (BOOL_CHOICE)
                  --&gt; Bool choice sym 1 (BOOL_CHOICE_SYM_1)
                      Bool choice sym 2 (BOOL_CHOICE_SYM_2)
          {M} Tristate choice (TRI_CHOICE)
                  &lt; &gt; Tristate choice sym 1 (TRI_CHOICE_SYM_1)
                  &lt; &gt; Tristate choice sym 2 (TRI_CHOICE_SYM_2)
          [ ] Optional bool choice (OPT_BOOL_CHOICE)

  Enter a symbol/choice name, "load_config", or "write_config" (or press CTRL+D to exit): BOOL
  Value for BOOL (available: n, y): n

  ======== Example Kconfig configuration ========

  [*] Enable loadable module support (MODULES)
      Bool and tristate symbols
          [ ] Bool symbol (BOOL)
          &lt; &gt; Tristate symbol (TRI)
          [ ] Second prompt (TWO_MENU_NODES)
              *** These are selected by TRI_DEP ***
          &lt; &gt; Tristate selected by TRI_DEP (SELECTED_BY_TRI_DEP)
          &lt; &gt; Tristate implied by TRI_DEP (IMPLIED_BY_TRI_DEP)
      String, int, and hex symbols
          (foo) String symbol (STRING)
          (747) Int symbol (INT)
          (0xABC) Hex symbol (HEX)
      Various choices
          -*- Bool choice (BOOL_CHOICE)
                  --&gt; Bool choice sym 1 (BOOL_CHOICE_SYM_1)
                      Bool choice sym 2 (BOOL_CHOICE_SYM_2)
          {M} Tristate choice (TRI_CHOICE)
                  &lt; &gt; Tristate choice sym 1 (TRI_CHOICE_SYM_1)
                  &lt; &gt; Tristate choice sym 2 (TRI_CHOICE_SYM_2)
          [ ] Optional bool choice (OPT_BOOL_CHOICE)

  Enter a symbol/choice name, "load_config", or "write_config" (or press CTRL+D to exit): MODULES
  Value for MODULES (available: n, y): n

  ======== Example Kconfig configuration ========

  [ ] Enable loadable module support (MODULES)
      Bool and tristate symbols
          [ ] Bool symbol (BOOL)
          [ ] Tristate symbol (TRI)
          [ ] Second prompt (TWO_MENU_NODES)
              *** These are selected by TRI_DEP ***
          [ ] Tristate selected by TRI_DEP (SELECTED_BY_TRI_DEP)
          [ ] Tristate implied by TRI_DEP (IMPLIED_BY_TRI_DEP)
      String, int, and hex symbols
          (foo) String symbol (STRING)
          (747) Int symbol (INT)
          (0xABC) Hex symbol (HEX)
      Various choices
          -*- Bool choice (BOOL_CHOICE)
                  --&gt; Bool choice sym 1 (BOOL_CHOICE_SYM_1)
                      Bool choice sym 2 (BOOL_CHOICE_SYM_2)
          -*- Tristate choice (TRI_CHOICE)
                  --&gt; Tristate choice sym 1 (TRI_CHOICE_SYM_1)
                      Tristate choice sym 2 (TRI_CHOICE_SYM_2)
          [ ] Optional bool choice (OPT_BOOL_CHOICE)

  Enter a symbol/choice name, "load_config", or "write_config" (or press CTRL+D to exit): ^D

Unsetting modules demonstrates one reason why it makes sense to have
.type be magic and change from TRISTATE to BOOL without modules
(&lt;&gt; = tristate, [] = bool). The C implementation uses the same trick.
(The original type is still available in .orig_type though.)

Piggyback printing of tristates as n, m, y in the warning for invalid
values in set_value().
</content>
</entry>
</feed>
