Skip to content

Commit

Permalink
CherryPy 8.1.2 - Update and set version
Browse files Browse the repository at this point in the history
  • Loading branch information
Safihre committed Oct 3, 2016
1 parent 6a12224 commit 692ed8f
Show file tree
Hide file tree
Showing 54 changed files with 4,042 additions and 7,890 deletions.
4 changes: 2 additions & 2 deletions SABnzbd.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
sys.exit(1)

import cherrypy
if [int(n) for n in cherrypy.__version__.split('.')] < [6, 0, 2]:
print 'Sorry, requires Python module Cherrypy 6.0.2+ (use the included version)'
if [int(n) for n in cherrypy.__version__.split('.')] < [8, 1, 2]:
print 'Sorry, requires Python module Cherrypy 8.1.0+ (use the included version)'
sys.exit(1)

from cherrypy import _cpserver
Expand Down
50 changes: 25 additions & 25 deletions cherrypy/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
Copyright (c) 2004-2016, CherryPy Team (team@cherrypy.org)
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the CherryPy Team nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 2004-2016, CherryPy Team (team@cherrypy.org)
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the CherryPy Team nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3 changes: 2 additions & 1 deletion cherrypy/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CherryPy 6.0.2 Official distribution: https://pypi.python.org/packages/source/C/CherryPy/CherryPy-6.0.2.tar.gz
CherryPy 8.1.0
Official distribution: https://github.com/cherrypy/cherrypy/releases
The folders 'tutorial', 'test' and 'scaffold' have been removed.
This file has been added.

58 changes: 27 additions & 31 deletions cherrypy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,26 @@
except ImportError:
pass

from cherrypy._cperror import HTTPError, HTTPRedirect, InternalRedirect
from cherrypy._cperror import NotFound, CherryPyException, TimeoutError
from threading import local as _local

from cherrypy import _cpdispatch as dispatch
from cherrypy._cperror import HTTPError, HTTPRedirect, InternalRedirect # noqa
from cherrypy._cperror import NotFound, CherryPyException, TimeoutError # noqa

from cherrypy import _cplogging

from cherrypy import _cpdispatch as dispatch # noqa

from cherrypy import _cptools
tools = _cptools.default_toolbox
Tool = _cptools.Tool
from cherrypy._cptools import default_toolbox as tools, Tool

from cherrypy import _cprequest
from cherrypy.lib import httputil as _httputil

from cherrypy import _cptree
tree = _cptree.Tree()
from cherrypy._cptree import Application
from cherrypy import _cpwsgi as wsgi
from cherrypy._cptree import Application # noqa
from cherrypy import _cpwsgi as wsgi # noqa

from cherrypy import _cpserver
from cherrypy import process
try:
from cherrypy.process import win32
Expand All @@ -88,11 +91,11 @@
engine = process.bus


try:
__version__ = pkg_resources.require('cherrypy')[0].version
except Exception:
__version__ = 'unknown'
__version__ = '6.0.2'
tree = _cptree.Tree()


__version__ = '8.1.2'


# Timeout monitor. We add two channels to the engine
# to which cherrypy.Application will publish.
Expand Down Expand Up @@ -141,20 +144,19 @@ def __init__(self, bus):

def subscribe(self):
"""Add the handlers based on the platform"""
if hasattr(self.bus, "signal_handler"):
if hasattr(self.bus, 'signal_handler'):
self.bus.signal_handler.subscribe()
if hasattr(self.bus, "console_control_handler"):
if hasattr(self.bus, 'console_control_handler'):
self.bus.console_control_handler.subscribe()

engine.signals = _HandleSignalsPlugin(engine)


from cherrypy import _cpserver
server = _cpserver.Server()
server.subscribe()


def quickstart(root=None, script_name="", config=None):
def quickstart(root=None, script_name='', config=None):
"""Mount the given root, start the builtin server (and engine), then block.
root: an instance of a "controller class" (a collection of page handler
Expand All @@ -181,9 +183,6 @@ def quickstart(root=None, script_name="", config=None):
engine.block()


from cherrypy._cpcompat import threadlocal as _local


class _Serving(_local):

"""An interface for registering request and response objects.
Expand All @@ -196,8 +195,8 @@ class _Serving(_local):
thread-safe way.
"""

request = _cprequest.Request(_httputil.Host("127.0.0.1", 80),
_httputil.Host("127.0.0.1", 1111))
request = _cprequest.Request(_httputil.Host('127.0.0.1', 80),
_httputil.Host('127.0.0.1', 1111))
"""
The request object for the current thread. In the main thread,
and any threads which are not receiving HTTP requests, this is None."""
Expand Down Expand Up @@ -230,7 +229,7 @@ def __getattr__(self, name):
return getattr(child, name)

def __setattr__(self, name, value):
if name in ("__attrname__", ):
if name in ('__attrname__', ):
object.__setattr__(self, name, value)
else:
child = getattr(serving, self.__attrname__)
Expand Down Expand Up @@ -306,9 +305,6 @@ def _cherrypy_pydoc_resolve(thing, forceload=0):
pass


from cherrypy import _cplogging


class _GlobalLogManager(_cplogging.LogManager):

"""A site-wide LogManager; routes to app.log or global log as appropriate.
Expand Down Expand Up @@ -352,10 +348,10 @@ def _buslog(msg, level):
log.error(msg, 'ENGINE', severity=level)
engine.subscribe('log', _buslog)

from cherrypy._helper import expose, popargs, url
from cherrypy._helper import expose, popargs, url # noqa

# import _cpconfig last so it can reference other top-level objects
from cherrypy import _cpconfig
from cherrypy import _cpconfig # noqa
# Use _global_conf_alias so quickstart can use 'config' as an arg
# without shadowing cherrypy.config.
config = _global_conf_alias = _cpconfig.Config()
Expand All @@ -365,11 +361,11 @@ def _buslog(msg, level):
'tools.trailing_slash.on': True,
'tools.encode.on': True
}
config.namespaces["log"] = lambda k, v: setattr(log, k, v)
config.namespaces["checker"] = lambda k, v: setattr(checker, k, v)
config.namespaces['log'] = lambda k, v: setattr(log, k, v)
config.namespaces['checker'] = lambda k, v: setattr(checker, k, v)
# Must reset to get our defaults applied.
config.reset()

from cherrypy import _cpchecker
from cherrypy import _cpchecker # noqa
checker = _cpchecker.Checker()
engine.subscribe('start', checker)

0 comments on commit 692ed8f

Please sign in to comment.