• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zopefoundation / z3c.rml / 16098868126

14 Apr 2025 06:50AM UTC coverage: 87.385%. Remained the same
16098868126

push

github

icemac
Back to development: 5.1

561 of 792 branches covered (70.83%)

Branch coverage included in aggregate %.

3990 of 4416 relevant lines covered (90.35%)

0.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

58.33
/src/z3c/rml/pagetemplate.py
1
##############################################################################
2
#
3
# Copyright (c) 2007 Zope Foundation and Contributors.
4
# All Rights Reserved.
5
#
6
# This software is subject to the provisions of the Zope Public License,
7
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
8
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11
# FOR A PARTICULAR PURPOSE.
12
#
13
##############################################################################
14
"""Page Template Support
15
"""
16
import zope
1✔
17

18
from z3c.rml import rml2pdf
1✔
19

20

21
try:
1✔
22
    import zope.pagetemplate.pagetemplatefile
1✔
23
except ImportError:
24
    raise
25
    # zope.pagetemplate package has not been installed, uncomment this to mock
26
    # import types
27
    # zope.pagetemplate = types.ModuleType('pagetemplate')
28
    # zope.pagetemplate.pagetemplatefile = types.ModuleType('pagetemplatefile')
29
    # zope.pagetemplate.pagetemplatefile.PageTemplateFile = object
30

31

32
class RMLPageTemplateFile(zope.pagetemplate.pagetemplatefile.PageTemplateFile):
1✔
33

34
    def pt_getContext(self, args=(), options=None, **ignore):
1✔
35
        rval = {'template': self,
×
36
                'args': args,
37
                'nothing': None,
38
                'context': options
39
                }
40
        rval.update(self.pt_getEngine().getBaseNames())
×
41
        return rval
×
42

43
    def __call__(self, *args, **kwargs):
1✔
44
        rml = super().__call__(*args, **kwargs)
×
45

46
        return rml2pdf.parseString(
×
47
            rml, filename=self.pt_source_file()).getvalue()
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc