summaryrefslogtreecommitdiff
path: root/pygments/util.py
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2007-02-12 23:38:46 +0100
committergbrandl <devnull@localhost>2007-02-12 23:38:46 +0100
commit8ac95bf314343f8db0ec8123296b60aefda8b02f (patch)
tree7813371046f03132d690b8556c857fc453e6c9b6 /pygments/util.py
parent16b1f0bb0fbc6ea7aab974cb220406632de4c7c0 (diff)
downloadpygments-8ac95bf314343f8db0ec8123296b60aefda8b02f.tar.gz
[svn] Quite a few things:
- new pygmentize options, -F for filters and -H for detail help. - an automatically-created formatter map - better HTML formatter subclassing
Diffstat (limited to 'pygments/util.py')
-rw-r--r--pygments/util.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/pygments/util.py b/pygments/util.py
index bf9f1a26..79fa250e 100644
--- a/pygments/util.py
+++ b/pygments/util.py
@@ -23,6 +23,12 @@ doctype_lookup_re = re.compile(r'''(?smx)
tag_re = re.compile(r'<(.+?)(\s.*?)?>.*?</\1>(?uism)')
+class ClassNotFound(ValueError):
+ """
+ If one of the get_*_by_* functions didn't find a matching class.
+ """
+
+
class OptionError(Exception):
pass
@@ -63,6 +69,18 @@ def get_list_opt(options, optname, default=None):
val, optname))
+def docstring_headline(obj):
+ if not obj.__doc__:
+ return ''
+ res = []
+ for line in obj.__doc__.strip().splitlines():
+ if line.strip():
+ res.append(" " + line.strip())
+ else:
+ break
+ return ''.join(res).lstrip()
+
+
def make_analysator(f):
"""
Return a static text analysation function that