diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-08-01 19:08:35 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-08-01 19:08:35 +0100 |
| commit | 718bb4be605da81893daec32c63987e8a546b30c (patch) | |
| tree | e2454fb59280467ad2e47834ea8ba85e13bcc8d8 /mammoth/writers/abc.py | |
| parent | 522c3a75bae2b75a1462652c629e5ecee5931a1a (diff) | |
Add ABC for writers
Diffstat (limited to 'mammoth/writers/abc.py')
| -rw-r--r-- | mammoth/writers/abc.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mammoth/writers/abc.py b/mammoth/writers/abc.py new file mode 100644 index 0000000..a4a648b --- /dev/null +++ b/mammoth/writers/abc.py @@ -0,0 +1,31 @@ +from __future__ import absolute_import + +import abc + + +class Writer(object): + __metaclass__ = abc.ABCMeta + + @abc.abstractmethod + def text(self, text): + pass + + @abc.abstractmethod + def start(self, name, attributes=None): + pass + + @abc.abstractmethod + def end(self, name): + pass + + @abc.abstractmethod + def self_closing(self, name, attributes=None): + pass + + @abc.abstractmethod + def append(self, html): + pass + + @abc.abstractmethod + def as_string(self): + pass |
