Changeset 181:ee6d102df99c
- Timestamp:
- 2007-08-04 16:44:03
(1 year ago)
- Author:
- Stefan Schwarzer <sschwarzer@sschwarzer.net>
- branch:
- default
- Message:
Renamed `pygments_finder` to `pygmentsfinder` in code.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r166 |
r181 |
|
| 272 | 272 | print ("Type http://%s:%d/ into the address field of your " \ |
|---|
| 273 | 273 | "browser.") % (config.http_host, config.http_port) |
|---|
| 274 | | if pygments_finder.found_pygments: |
|---|
| | 274 | if pygmentsfinder.found_pygments: |
|---|
| 275 | 275 | print "Using Pygments library for syntax highlighting." |
|---|
| 276 | 276 | else: |
|---|
| r166 |
r181 |
|
| 189 | 189 | guess the MIME type, which is used for coloring source code. |
|---|
| 190 | 190 | """ |
|---|
| 191 | | if not pygments_finder.found_pygments: |
|---|
| | 191 | if not pygmentsfinder.found_pygments: |
|---|
| 192 | 192 | return dumb_text_to_html(text) |
|---|
| 193 | 193 | try: |
|---|
| … | … | |
| 196 | 196 | if os.path.islink(path): |
|---|
| 197 | 197 | path = os.path.abspath(os.readlink(path)) |
|---|
| 198 | | lexer = pygments_finder.lexers.guess_lexer_for_filename(path, text) |
|---|
| 199 | | except pygments_finder.lexers.ClassNotFound: |
|---|
| | 198 | lexer = pygmentsfinder.lexers.guess_lexer_for_filename(path, text) |
|---|
| | 199 | except pygmentsfinder.lexers.ClassNotFound: |
|---|
| 200 | 200 | # files with many extensions are actually XML files, so |
|---|
| 201 | 201 | # test explicitly for them |
|---|
| 202 | 202 | if text.lstrip().startswith(u'<?xml '): |
|---|
| 203 | | lexer = pygments_finder.lexers.XmlLexer() |
|---|
| 204 | | else: |
|---|
| 205 | | lexer = pygments_finder.lexers.TextLexer() |
|---|
| 206 | | formatter = pygments_finder.formatters.HtmlFormatter( |
|---|
| | 203 | lexer = pygmentsfinder.lexers.XmlLexer() |
|---|
| | 204 | else: |
|---|
| | 205 | lexer = pygmentsfinder.lexers.TextLexer() |
|---|
| | 206 | formatter = pygmentsfinder.formatters.HtmlFormatter( |
|---|
| 207 | 207 | linenos=config.line_numbers) |
|---|
| 208 | | return pygments_finder.pygments.highlight(text, lexer, formatter) |
|---|
| | 208 | return pygmentsfinder.pygments.highlight(text, lexer, formatter) |
|---|
| 209 | 209 | |
|---|
| 210 | 210 | def image_to_html(url): |
|---|