summaryrefslogtreecommitdiffstats
path: root/powerline/lint/selfcheck.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:40:16 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:40:16 +0000
commit3f25952c13d5847d510c0cae22a8ba876638d570 (patch)
tree02f505f016ed5a1029277dcae520d5e2a75906fb /powerline/lint/selfcheck.py
parentInitial commit. (diff)
downloadpowerline-upstream.tar.xz
powerline-upstream.zip
Adding upstream version 2.8.3.upstream/2.8.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'powerline/lint/selfcheck.py')
-rw-r--r--powerline/lint/selfcheck.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/powerline/lint/selfcheck.py b/powerline/lint/selfcheck.py
new file mode 100644
index 0000000..06d1fbe
--- /dev/null
+++ b/powerline/lint/selfcheck.py
@@ -0,0 +1,16 @@
+# vim:fileencoding=utf-8:noet
+from __future__ import (unicode_literals, division, absolute_import, print_function)
+
+from powerline.lib.unicode import unicode
+
+
+def havemarks(*args, **kwargs):
+ origin = kwargs.get('origin', '')
+ for i, v in enumerate(args):
+ if not hasattr(v, 'mark'):
+ raise AssertionError('Value #{0}/{1} ({2!r}) has no attribute `mark`'.format(origin, i, v))
+ if isinstance(v, dict):
+ for key, val in v.items():
+ havemarks(key, val, origin=(origin + '[' + unicode(i) + ']/' + unicode(key)))
+ elif isinstance(v, list):
+ havemarks(*v, origin=(origin + '[' + unicode(i) + ']'))