summaryrefslogtreecommitdiff
path: root/kconfiglib.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-12-15 14:03:14 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2018-12-15 14:03:14 +0100
commita88302bcfbf73f9b8b50bea593beb82534bfcc63 (patch)
treeb2d61c96ee6a920ac15c1d637acc14eb8e348f8f /kconfiglib.py
parent02669243c44615852ab8b87c62ff0bdfd0e666dd (diff)
Fix user-defined preprocessor function example code
The functions must be defined before they can be put into 'functions'.
Diffstat (limited to 'kconfiglib.py')
-rw-r--r--kconfiglib.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index ee78e5e..f3c51b1 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -456,14 +456,8 @@ module being run by default, as well as installation directories.
If the KCONFIG_FUNCTIONS environment variable is set, it gives a different
module name to use instead of 'kconfigfunctions'.
-The imported module is expected to define a dictionary named 'functions', with
-the following format:
-
- functions = {
- "my-fn": (my_fn, <min.args>, <max.args>/None),
- "my-other-fn": (my_other_fn, <min.args>, <max.args>/None),
- ...
- }
+The imported module is expected to define a global dictionary named 'functions'
+that maps function names to Python functions, as follows:
def my_fn(kconf, name, arg_1, arg_2, ...):
# kconf:
@@ -482,6 +476,12 @@ the following format:
def my_other_fn(kconf, name, arg_1, arg_2, ...):
...
+ functions = {
+ "my-fn": (my_fn, <min.args>, <max.args>/None),
+ "my-other-fn": (my_other_fn, <min.args>, <max.args>/None),
+ ...
+ }
+
...
<min.args> and <max.args> are the minimum and maximum number of arguments