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

zopefoundation / Products.PythonScripts / 16550913706

17 Mar 2025 07:48AM UTC coverage: 86.279%. Remained the same
16550913706

push

github

web-flow
Update Python version support. (#68)

* Drop support for Python 3.8.

* Configuring for zope-product

* Update Python version support.

84 of 144 branches covered (58.33%)

Branch coverage included in aggregate %.

941 of 1044 relevant lines covered (90.13%)

0.9 hits per line

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

31.03
/src/Products/PythonScripts/__init__.py
1
##############################################################################
2
#
3
# Copyright (c) 2002 Zope Foundation and Contributors.
4
#
5
# This software is subject to the provisions of the Zope Public License,
6
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
7
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
8
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
9
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
10
# FOR A PARTICULAR PURPOSE
11
#
12
##############################################################################
13

14
from Shared.DC import Scripts
1✔
15

16
# To register helper functions at AccessControl and security declaration in the
17
# module itself:
18
from . import PythonScript
1✔
19
from . import standard  # noqa
1✔
20

21

22
__module_aliases__ = (
1✔
23
    ('Products.PythonScripts.Script', Scripts.Script),
24
    ('Products.PythonScripts.Bindings', Scripts.Bindings),
25
    ('Products.PythonScripts.BindingsUI', Scripts.BindingsUI))
26

27
__roles__ = None
1✔
28
__allow_access_to_unprotected_subobjects__ = 1
1✔
29

30
zodbupdate_decode_dict = {
1✔
31
    'Products.PythonScripts.PythonScript PythonScript Python_magic': 'binary',
32
    'Products.PythonScripts.PythonScript PythonScript _body': 'utf-8',
33
    'Products.PythonScripts.PythonScript PythonScript _code': 'binary',
34
}
35

36

37
def initialize(context):
1✔
38
    context.registerClass(
×
39
        PythonScript.PythonScript,
40
        permission='Add Python Scripts',
41
        constructors=(PythonScript.manage_addPythonScriptForm,
42
                      PythonScript.manage_addPythonScript),
43
        icon='www/pyscript.gif',
44
    )
45

46
    global _m
47
    _m['recompile'] = recompile
×
48
    _m['recompile__roles__'] = ('Manager',)
×
49

50

51
def recompile(self):
1✔
52
    """Recompile all Python Scripts"""
53
    base = self.this()
×
54
    scripts = base.ZopeFind(base, obj_metatypes=('Script (Python)',),
×
55
                            search_sub=1)
56
    names = []
×
57
    for name, ob in scripts:
×
58
        if ob._v_change:
×
59
            names.append(name)
×
60
            ob._compile()
×
61
            ob._p_changed = 1
×
62

63
    if names:
×
64
        return 'The following Scripts were recompiled:\n' + '\n'.join(names)
×
65
    return 'No Scripts were found that required recompilation.'
×
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