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

zopefoundation / Zope / 3956162881

pending completion
3956162881

push

github

Michael Howitz
Update to deprecation warning free releases.

4401 of 7036 branches covered (62.55%)

Branch coverage included in aggregate %.

27161 of 31488 relevant lines covered (86.26%)

0.86 hits per line

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

0.0
/src/Zope2/utilities/finder.py
1
##############################################################################
2
#
3
# Copyright (c) 2010 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
import os
×
15

16

17
class ZopeFinder:
×
18

19
    def __init__(self, argv):
×
20
        self.cmd = argv[0]
×
21

22
    def filter_warnings(self):
×
23
        import warnings
×
24
        warnings.simplefilter('ignore', Warning, append=True)
×
25

26
    def get_app(self, config_file=None):
×
27
        # given a config file, return a Zope application object
28
        if config_file is None:
×
29
            config_file = self.get_zope_conf()
×
30
        import App.config
×
31
        import Zope2
×
32
        from Zope2.Startup import handlers
×
33
        from Zope2.Startup import options
×
34
        opts = options.ZopeWSGIOptions(configfile=config_file)()
×
35
        handlers.handleWSGIConfig(opts.configroot, opts.confighandlers)
×
36
        App.config.setConfiguration(opts.configroot)
×
37
        app = Zope2.app()
×
38
        return app
×
39

40
    def get_zope_conf(self):
×
41
        # the default config file path is assumed to live in
42
        # $instance_home/etc/zope.conf, and the console scripts that use this
43
        # are assumed to live in $instance_home/bin; override if the
44
        # environ contains "ZOPE_CONF".
45
        ihome = os.path.dirname(os.path.abspath(os.path.dirname(self.cmd)))
×
46
        default_config_file = os.path.join(ihome, 'etc', 'zope.conf')
×
47
        zope_conf = os.environ.get('ZOPE_CONF', default_config_file)
×
48
        return zope_conf
×
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