summaryrefslogtreecommitdiffstats
path: root/scripts/get_lexer_list.py
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-03-28 00:40:33 +0100
committerFlorian Pritz <bluewind@xinu.at>2015-04-01 19:12:09 +0200
commit71f0d462f2d695acb4126adfd50f92c8b3ab8bc2 (patch)
treef8c55f2dcb5cb868d12126a1ea27b2ef39d00751 /scripts/get_lexer_list.py
parentb58d6d44bda3b229c4f0a32f5147f44b0c9ec446 (diff)
Refactor \libraries\Pygments::get_lexers
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'scripts/get_lexer_list.py')
-rwxr-xr-xscripts/get_lexer_list.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/scripts/get_lexer_list.py b/scripts/get_lexer_list.py
index 31e8e3650..0ef6fe97a 100755
--- a/scripts/get_lexer_list.py
+++ b/scripts/get_lexer_list.py
@@ -1,7 +1,15 @@
#!/usr/bin/python
import pygments.lexers
+import json
-for fullname, names, exts, _ in pygments.lexers.get_all_lexers():
- for name in names:
- print(("%s|%s") % (name, fullname))
+ret = []
+
+for fullname, names, exts, mimetypes in pygments.lexers.get_all_lexers():
+ ret.append({
+ 'fullname': fullname,
+ 'names': names,
+ 'extentions': exts,
+ 'mimetypes': mimetypes,
+ })
+print(json.dumps(ret))