aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mlog.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-04-11 16:41:56 +0300
committerGitHub <noreply@github.com>2017-04-11 16:41:56 +0300
commit42d1661bd9d4a29d8780e77127542120624d3729 (patch)
treef40d39bf9418499d2296e8c227c00f015bc9bf2b /mesonbuild/mlog.py
parent371e3d3e87bff5413554bbfc01250a899288400c (diff)
parent1fbf6300c5d38b12a4347a9327e54a9a315ef8de (diff)
downloadmeson-42d1661bd9d4a29d8780e77127542120624d3729.zip
meson-42d1661bd9d4a29d8780e77127542120624d3729.tar.gz
meson-42d1661bd9d4a29d8780e77127542120624d3729.tar.bz2
Merge pull request #1588 from absmall/method
Add an option to dependencies called 'method'.
Diffstat (limited to 'mesonbuild/mlog.py')
-rw-r--r--mesonbuild/mlog.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py
index bad756a..82ee6ba 100644
--- a/mesonbuild/mlog.py
+++ b/mesonbuild/mlog.py
@@ -99,3 +99,16 @@ def log(*args, **kwargs):
def warning(*args, **kwargs):
log(yellow('WARNING:'), *args, **kwargs)
+
+# Format a list for logging purposes as a string. It separates
+# all but the last item with commas, and the last with 'and'.
+def format_list(list):
+ l = len(list)
+ if l > 2:
+ return ' and '.join([', '.join(list[:-1]), list[-1]])
+ elif l == 2:
+ return ' and '.join(list)
+ elif l == 1:
+ return list[0]
+ else:
+ return ''