Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add oldaskconfig the default conf program #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

afbjorklund
Copy link

Closes #133

This is the default option, for kconfig-conf.

Just a small modification to the "oldconfig":

@@ -82,9 +81,7 @@
     if isinstance(node.item, Symbol):
         sym = node.item
 
-        # Skip symbols that already have a user value
-        if sym.user_value is not None:
-            return
+        new = sym.user_value is None
 
         # Skip symbols that can only have a single value, due to selects
         if len(sym.assignable) == 1:
@@ -98,9 +95,9 @@
         # Loop until the user enters a valid value or enters a blank string
         # (for the default value)
         while True:
-            val = input("{} ({}) [{}] ".format(
+            val = input("{} ({}) [{}]{} ".format(
                 node.prompt[0], _name_and_loc_str(sym),
-                _default_value_str(sym)))
+                _default_value_str(sym), _new_value_str(new)))
 
             if val == "?":
                 _print_help(node)
@@ -242,5 +239,11 @@
     return sym.str_value
 
 
+def _new_value_str(new):
+    if new:
+        return " (NEW)"
+    return ""
+
+
 if __name__ == "__main__":
     _main()

@afbjorklund afbjorklund changed the title Add the oldaskconfig the default conf program Add oldaskconfig the default conf program Sep 22, 2023
@afbjorklund afbjorklund force-pushed the oldaskconfig branch 2 times, most recently from b5c2b0a to 246deb1 Compare September 22, 2023 10:15
@jackrosenthal
Copy link

Rather unfortunately, it appears the original author of Kconfiglib disappeared. The Zephyr project has been granted ownership of the PyPI package via PEP-541 request, and I'm going to do a release based on a new repository in the zephyrproject-rtos organization here: https://github.com/zephyrproject-rtos/Kconfiglib

➡️ Action required: @afbjorklund Are you able to re-open your pull request on the new repository?

@afbjorklund
Copy link
Author

Can't make a PR, since you didn't fork the same project. Would have to make a new clone...

@carlescufi
Copy link
Contributor

Can't make a PR, since you didn't fork the same project. Would have to make a new clone...

You can just close this PR and open a new one agains the new repo. We did not make it a fork because we want it to become the new canonical upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The default conf mode seems missing
3 participants