errbot.rendering.ansiext module

class errbot.rendering.ansiext.AnsiExtension(**kwargs)[source]

Bases: Extension

(kinda hackish) This is just a private extension to postprocess the html text to ansi text

extendMarkdown(md)[source]

Add the various processors and patterns to the Markdown Instance.

This method must be overridden by every extension.

Keyword arguments:

  • md: The Markdown instance.

class errbot.rendering.ansiext.AnsiPostprocessor(md=None)[source]

Bases: Postprocessor

Markdown generates html entities, this reputs them back to their unicode equivalent

run(text)[source]

Subclasses of Postprocessor should implement a run method, which takes the html document as a single text string and returns a (possibly modified) string.

class errbot.rendering.ansiext.AnsiPreprocessor(md, config)[source]

Bases: FencedBlockPreprocessor

run(lines)[source]

Match and store Fenced Code Blocks in the HtmlStash.

class errbot.rendering.ansiext.BorderlessTable(chr_table)[source]

Bases: object

__init__(chr_table)[source]
add_col()[source]
add_header()[source]
begin_headers()[source]
end_headers()[source]
next_row()[source]
write(text)[source]
class errbot.rendering.ansiext.CharacterTable(fg_black, fg_red, fg_green, fg_yellow, fg_blue, fg_magenta, fg_cyan, fg_white, fg_default, bg_black, bg_red, bg_green, bg_yellow, bg_blue, bg_magenta, bg_cyan, bg_white, bg_default, fx_reset, fx_bold, fx_italic, fx_underline, fx_not_italic, fx_not_underline, fx_normal, fixed_width, end_fixed_width, inline_code, end_inline_code)

Bases: tuple

bg_black

Alias for field number 9

bg_blue

Alias for field number 13

bg_cyan

Alias for field number 15

bg_default

Alias for field number 17

bg_green

Alias for field number 11

bg_magenta

Alias for field number 14

bg_red

Alias for field number 10

bg_white

Alias for field number 16

bg_yellow

Alias for field number 12

end_fixed_width

Alias for field number 26

end_inline_code

Alias for field number 28

fg_black

Alias for field number 0

fg_blue

Alias for field number 4

fg_cyan

Alias for field number 6

fg_default

Alias for field number 8

fg_green

Alias for field number 2

fg_magenta

Alias for field number 5

fg_red

Alias for field number 1

fg_white

Alias for field number 7

fg_yellow

Alias for field number 3

fixed_width

Alias for field number 25

fx_bold

Alias for field number 19

fx_italic

Alias for field number 20

fx_normal

Alias for field number 24

fx_not_italic

Alias for field number 22

fx_not_underline

Alias for field number 23

fx_reset

Alias for field number 18

fx_underline

Alias for field number 21

inline_code

Alias for field number 27

class errbot.rendering.ansiext.NSC(s)[source]

Bases: object

__init__(s)[source]
class errbot.rendering.ansiext.Table(chr_table)[source]

Bases: object

__init__(chr_table)[source]
add_col()[source]
add_header()[source]
begin_headers()[source]
end_headers()[source]
next_row()[source]
write(text)[source]
errbot.rendering.ansiext.enable_format(name, chr_table, borders=True)[source]
errbot.rendering.ansiext.recurse(write, chr_table, element, table=None, borders=True)[source]
errbot.rendering.ansiext.translate(element, chr_table=(<ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, <ansi.colour.base.Graphic object>, '', '', '', ''), borders=True)[source]