Exemplo n.º 1
0
 def parse_into_pages(self, raw):
     """Extend to add empty pages to the front if there are less than three.
     """
     pages = DynamicResource.parse_into_pages(self, raw)
     while len(pages) < 3:
         pages = [''] + pages
     return pages
Exemplo n.º 2
0
 def parse_into_pages(self, raw):
     """Extend to add empty pages to the front if there are less than three.
     """
     pages = DynamicResource.parse_into_pages(self, raw)
     while len(pages) < 3:
         pages = [''] + pages
     return pages
Exemplo n.º 3
0
def test_compute_paddings_computes_paddings_for_empty_list():
    actual = DynamicResource._compute_paddings([])
    assert actual == [], actual
Exemplo n.º 4
0
def test_compute_paddings_computes_paddings():
    actual = DynamicResource._compute_paddings(['\n\n\n', '\n'])
    assert actual == ['', '\n\n\n'], actual
 def __init__(self, *a, **kw):
     self.renderers = {}         # mapping of media type to render function
     self.available_types = []   # ordered sequence of media types
     DynamicResource.__init__(self, *a, **kw)
Exemplo n.º 6
0
 def parse_into_pages(self, raw):
     """Extend to add empty pages to the front if there are less than three.
     """
     pages = DynamicResource.parse_into_pages(self, raw)
     self._prepend_empty_pages(pages, 3)
     return pages
Exemplo n.º 7
0
 def parse_into_pages(self, raw):
     """Extend to add empty pages to the front if there are less than three.
     """
     pages = DynamicResource.parse_into_pages(self, raw)
     self._prepend_empty_pages(pages, 3)
     return pages
Exemplo n.º 8
0
def test_compute_paddings_computes_paddings_for_empty_list():
    actual = DynamicResource._compute_paddings([])
    assert actual == [], actual
Exemplo n.º 9
0
def test_compute_paddings_computes_paddings():
    actual = DynamicResource._compute_paddings(['\n\n\n', '\n'])
    assert actual == ['', '\n\n\n'], actual
Exemplo n.º 10
0
 def __init__(self, *a, **kw):
     self.renderers = {}         # mapping of media type to render function
     self.available_types = []   # ordered sequence of media types
     DynamicResource.__init__(self, *a, **kw)