summaryrefslogtreecommitdiff
path: root/kconfiglib.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2017-10-30 13:54:29 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2017-10-30 13:54:29 +0100
commit7d21266f42c80915a8df779e479f1114b18cbe6a (patch)
tree13e8e9791990532323ffa1e22f55cc12e4d3ede1 /kconfiglib.py
parent2af7ebfe9b4e4edc5934b22542b2ce242108cfae (diff)
Move __str__() after __repr__()
Diffstat (limited to 'kconfiglib.py')
-rw-r--r--kconfiglib.py44
1 files changed, 22 insertions, 22 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index ab41edb..226ae9f 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -2478,21 +2478,6 @@ class Symbol(object):
self.user_str_value = self.user_tri_value = None
self._rec_invalidate()
- def __str__(self):
- """
- Returns a string representation of the symbol, matching the Kconfig
- format. As a convenience, prompts and help texts are also printed, even
- though they really belong to the symbol's menu nodes and not to the
- symbol itself.
-
- The output is designed so that feeding it back to a Kconfig parser
- redefines the symbol as is. This also works for symbols defined in
- multiple locations, where all the definitions are output.
-
- An empty string is returned for undefined symbols.
- """
- return _sym_choice_str(self)
-
def __repr__(self):
"""
Prints some information about the symbol (including its name, value,
@@ -2546,6 +2531,21 @@ class Symbol(object):
return "<{}>".format(", ".join(fields))
+ def __str__(self):
+ """
+ Returns a string representation of the symbol, matching the Kconfig
+ format. As a convenience, prompts and help texts are also printed, even
+ though they really belong to the symbol's menu nodes and not to the
+ symbol itself.
+
+ The output is designed so that feeding it back to a Kconfig parser
+ redefines the symbol as is. This also works for symbols defined in
+ multiple locations, where all the definitions are output.
+
+ An empty string is returned for undefined symbols.
+ """
+ return _sym_choice_str(self)
+
#
# Private methods
#
@@ -3040,13 +3040,6 @@ class Choice(object):
# Hackish way to invalidate the choice and all the choice symbols
self.syms[0]._rec_invalidate()
- def __str__(self):
- """
- Returns a string containing various information about the choice
- statement.
- """
- return _sym_choice_str(self)
-
def __repr__(self):
"""
TODO
@@ -3088,6 +3081,13 @@ class Choice(object):
return "<{}>".format(", ".join(fields))
+ def __str__(self):
+ """
+ Returns a string containing various information about the choice
+ statement.
+ """
+ return _sym_choice_str(self)
+
#
# Private methods
#