aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-04-22 18:55:30 +0300
committerGitHub <noreply@github.com>2018-04-22 18:55:30 +0300
commit04952fe220c260399d420334ccc4f64189d72609 (patch)
tree2771c12d03ce0e9243b977005a6d06f0e3cdd88f /docs/markdown
parenta5b99dce5dbe5d9e681fef59c4efebe2c80c5ce5 (diff)
parent709e2bd70dbf9557fc6c408f36aa43029cf99e54 (diff)
downloadmeson-04952fe220c260399d420334ccc4f64189d72609.zip
meson-04952fe220c260399d420334ccc4f64189d72609.tar.gz
meson-04952fe220c260399d420334ccc4f64189d72609.tar.bz2
Merge pull request #3446 from MathieuDuponchelle/python_module_with_doc
modules/python: add some more options around path and config_vars
Diffstat (limited to 'docs/markdown')
-rw-r--r--docs/markdown/Python-module.md40
1 files changed, 33 insertions, 7 deletions
diff --git a/docs/markdown/Python-module.md b/docs/markdown/Python-module.md
index cad74c9..51721f0 100644
--- a/docs/markdown/Python-module.md
+++ b/docs/markdown/Python-module.md
@@ -142,7 +142,7 @@ This function expects no arguments or keyword arguments.
#### `get_path()`
``` meson
-string py_installation.get_path(path_name)
+string py_installation.get_path(path_name, fallback)
```
Get a path as defined by the `sysconfig` module.
@@ -153,15 +153,28 @@ For example:
purelib = py_installation.get_path('purelib')
```
-This function accepts a single argument, `path_name`, which is expected to
-be a non-empty string.
+This function requires at least one argument, `path_name`,
+which is expected to be a non-empty string.
+
+If `fallback` is specified, it will be returned if no path
+with the given name exists. Otherwise, attempting to read
+a non-existing path will cause a fatal error.
**Returns**: A string
+#### `has_path()`
+
+``` meson
+ bool py_installation.has_path(path_name)
+```
+
+**Returns**: true if a path named `path_name` can be retrieved with
+[][`get_path()`], false otherwise.
+
#### `get_variable()`
``` meson
-string py_installation.get_variable(variable_name)
+string py_installation.get_variable(variable_name, fallback)
```
Get a variable as defined by the `sysconfig` module.
@@ -169,14 +182,27 @@ Get a variable as defined by the `sysconfig` module.
For example:
``` meson
-py_bindir = py_installation.get_variable('BINDIR')
+py_bindir = py_installation.get_variable('BINDIR', '')
```
-This function accepts a single argument, `variable_name`, which is expected to
-be a non-empty string.
+This function requires at least one argument, `variable_name`,
+which is expected to be a non-empty string.
+
+If `fallback` is specified, it will be returned if no variable
+with the given name exists. Otherwise, attempting to read
+a non-existing variable will cause a fatal error.
**Returns**: A string
+#### `has_variable()`
+
+``` meson
+ bool py_installation.has_variable(variable_name)
+```
+
+**Returns**: true if a variable named `variable_name` can be retrieved with
+[][`get_variable()`], false otherwise.
+
## `python_dependency` object
This [dependency object] subclass will try various methods to obtain the