aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--makefile1
-rw-r--r--mammoth/__init__.py1
-rw-r--r--mammoth/conversion.py1
-rw-r--r--mammoth/docx/__init__.py1
-rw-r--r--mammoth/docx/document_xml.py4
-rw-r--r--mammoth/style_reader/__init__.py3
-rw-r--r--test-requirements.txt1
-rw-r--r--tests/docx/content_types_xml_tests.py2
-rw-r--r--tests/docx/relationships_xml_tests.py2
9 files changed, 9 insertions, 7 deletions
diff --git a/makefile b/makefile
index 431a1cc..11e80ed 100644
--- a/makefile
+++ b/makefile
@@ -1,6 +1,7 @@
.PHONY: test upload clean bootstrap setup
test:
+ _virtualenv/bin/pyflakes mammoth tests
sh -c '. _virtualenv/bin/activate; nosetests tests'
upload: setup assert-converted-readme
diff --git a/mammoth/__init__.py b/mammoth/__init__.py
index 4a3643c..889cdd5 100644
--- a/mammoth/__init__.py
+++ b/mammoth/__init__.py
@@ -1,4 +1,3 @@
-from .results import Result
from . import docx, conversion, options, documents, images
__all__ = ["convert_to_html", "extract_raw_text", "images"]
diff --git a/mammoth/conversion.py b/mammoth/conversion.py
index 715e5e0..a9fba51 100644
--- a/mammoth/conversion.py
+++ b/mammoth/conversion.py
@@ -1,5 +1,4 @@
import base64
-import io
from . import documents, results, html_paths, images
from .html_generation import HtmlGenerator, satisfy_html_path
diff --git a/mammoth/docx/__init__.py b/mammoth/docx/__init__.py
index c0a7ea3..df3071d 100644
--- a/mammoth/docx/__init__.py
+++ b/mammoth/docx/__init__.py
@@ -1,7 +1,6 @@
import zipfile
import contextlib
-from ..results import Result
from .xmlparser import parse_xml
from .document_xml import read_document_xml_element
from .content_types_xml import read_content_types_xml_element
diff --git a/mammoth/docx/document_xml.py b/mammoth/docx/document_xml.py
index 83ddcdd..75d21fb 100644
--- a/mammoth/docx/document_xml.py
+++ b/mammoth/docx/document_xml.py
@@ -129,13 +129,13 @@ def _create_reader(numbering, content_types, relationships, styles, docx_file):
@handler("w:tr")
- def table(element):
+ def table_row(element):
return _read_xml_elements(element.children) \
.map(documents.table_row)
@handler("w:tc")
- def table(element):
+ def table_cell(element):
return _read_xml_elements(element.children) \
.map(documents.table_cell)
diff --git a/mammoth/style_reader/__init__.py b/mammoth/style_reader/__init__.py
index 41dcffa..28281a8 100644
--- a/mammoth/style_reader/__init__.py
+++ b/mammoth/style_reader/__init__.py
@@ -5,6 +5,9 @@ from .document_matcher_reader import read_document_matcher, grammar_text as docu
from ..styles import Style
+__all__ = ["read_style", "read_html_path", "read_document_matcher"]
+
+
def read_style(string):
style_node = _grammar.parse(string)
return _read_style_node(style_node)
diff --git a/test-requirements.txt b/test-requirements.txt
index 2fdf3a6..667e2b1 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -2,3 +2,4 @@ nose>=1.2.1,<2.0
funk>=0.3.1,<0.4
spur.local>=0.3.7,<0.4
tempman>=0.1.2,<0.2
+pyflakes>=0.8.1,<0.9
diff --git a/tests/docx/content_types_xml_tests.py b/tests/docx/content_types_xml_tests.py
index 1c26b34..9df8569 100644
--- a/tests/docx/content_types_xml_tests.py
+++ b/tests/docx/content_types_xml_tests.py
@@ -20,7 +20,7 @@ def content_type_is_based_on_default_for_extension_if_there_is_no_override():
@istest
-def content_type_is_based_on_default_for_extension_if_there_is_no_override():
+def content_type_is_based_on_override_if_present():
element = xml_element("content-types:Types", {}, [
xml_element("content-types:Default", {
"Extension": "png",
diff --git a/tests/docx/relationships_xml_tests.py b/tests/docx/relationships_xml_tests.py
index 7e24491..f2280d9 100644
--- a/tests/docx/relationships_xml_tests.py
+++ b/tests/docx/relationships_xml_tests.py
@@ -2,7 +2,7 @@ from nose.tools import istest, assert_equal
from mammoth.docx.xmlparser import element as xml_element
from mammoth.docx.relationships_xml import \
- read_relationships_xml_element, Relationships, Relationship
+ read_relationships_xml_element, Relationship
@istest