Codebase list cherrypy3 / bce9beb
Import cherrypy3_8.9.1.orig.tar.gz Stephan Sürken 6 years ago
16 changed file(s) with 125 addition(s) and 31 deletion(s). Raw diff Collapse all Expand all
2222
2323 # Ignore useless OS X's dirs:
2424 .DS_Store
25
26 # Py.test
27 /.cache/
44 - 3.3
55 - 3.4
66 - 3.5
7 - 3.6-dev
7 - 3.6
88 - pypy
99 - pypy3
1010 - nightly
2020 include:
2121 - python: 3.5
2222 env: TOXENV=pre-commit
23 include:
2423 - python: 3.5
2524 env: TOXENV=dist-check
2625
2827
2928 install: pip install tox
3029 script: tox
30
31 after_failure: >
32 if [[ "$TOXENV" != "pre-commit" ]]
33 then
34 echo Dumping logs, because tests failed to succeed
35 for log in `ls cherrypy/test/*.log`
36 do
37 echo Outputting $log
38 cat $log
39 done
40 fi
3141
3242 deploy:
3343 provider: pypi
0 v8.9.1
1 -----
2
3 * #1537: Restore dependency on pywin32 for Python 3.6.
4
5 v8.9.0
6 -----
7
8 * #1547: Replaced ``cherryd`` distutils script with a setuptools
9 console entry point.
10
11 When running CherryPy in daemon mode, the forked process no
12 longer changes directory to ``/``. If that behavior is something
13 on which your application relied and should rely, please file
14 a ticket with the project.
15
016 v8.8.0
117 -----
218
00 Metadata-Version: 1.1
11 Name: CherryPy
2 Version: 8.8.0
2 Version: 8.9.1
33 Summary: Object-Oriented HTTP framework
44 Home-page: http://www.cherrypy.org
55 Author: CherryPy Team
1111 .. image:: https://readthedocs.org/projects/cherrypy/badge/?version=latest
1212 :target: http://docs.cherrypy.org/en/latest/?badge=latest
1313
14 .. image:: https://img.shields.io/travis/cherrypy/cherrypy/master.svg?label=*NIX%20build%20%40%20Travis%20CI
14 .. image:: https://img.shields.io/travis/cherrypy/cherrypy/master.svg?label=Linux%20build%20%40%20Travis%20CI
1515 :target: http://travis-ci.org/cherrypy/cherrypy
1616
17 .. image:: https://img.shields.io/appveyor/ci/jaraco/cherrypy.svg?label=Windows%20build%20%40%20Travis%20CI
18 :target: https://ci.appveyor.com/project/jaraco/cherrypy
17 .. image:: https://img.shields.io/appveyor/ci/jaraco/cherrypy/master.svg?label=Windows%20build%20%40%20Appveyor
18 :target: https://ci.appveyor.com/project/jaraco/cherrypy/branch/master
1919
2020 .. image:: https://img.shields.io/pypi/pyversions/cherrypy.svg
2121
1212 CherryPy.egg-info/PKG-INFO
1313 CherryPy.egg-info/SOURCES.txt
1414 CherryPy.egg-info/dependency_links.txt
15 CherryPy.egg-info/entry_points.txt
1516 CherryPy.egg-info/requires.txt
1617 CherryPy.egg-info/top_level.txt
1718 cherrypy/__init__.py
3233 cherrypy/_cpwsgi.py
3334 cherrypy/_cpwsgi_server.py
3435 cherrypy/_helper.py
35 cherrypy/cherryd
3636 cherrypy/daemon.py
3737 cherrypy/favicon.ico
3838 cherrypy/lib/__init__.py
0 [console_scripts]
1 cherryd = cherrypy.__main__:run
2
00 six
11
2 [:sys_platform == "win32" and python_version != "3.6"]
2 [:sys_platform == "win32"]
33 pypiwin32
44
55 [doc]
00 Metadata-Version: 1.1
11 Name: CherryPy
2 Version: 8.8.0
2 Version: 8.9.1
33 Summary: Object-Oriented HTTP framework
44 Home-page: http://www.cherrypy.org
55 Author: CherryPy Team
1111 .. image:: https://readthedocs.org/projects/cherrypy/badge/?version=latest
1212 :target: http://docs.cherrypy.org/en/latest/?badge=latest
1313
14 .. image:: https://img.shields.io/travis/cherrypy/cherrypy/master.svg?label=*NIX%20build%20%40%20Travis%20CI
14 .. image:: https://img.shields.io/travis/cherrypy/cherrypy/master.svg?label=Linux%20build%20%40%20Travis%20CI
1515 :target: http://travis-ci.org/cherrypy/cherrypy
1616
17 .. image:: https://img.shields.io/appveyor/ci/jaraco/cherrypy.svg?label=Windows%20build%20%40%20Travis%20CI
18 :target: https://ci.appveyor.com/project/jaraco/cherrypy
17 .. image:: https://img.shields.io/appveyor/ci/jaraco/cherrypy/master.svg?label=Windows%20build%20%40%20Appveyor
18 :target: https://ci.appveyor.com/project/jaraco/cherrypy/branch/master
1919
2020 .. image:: https://img.shields.io/pypi/pyversions/cherrypy.svg
2121
33 .. image:: https://readthedocs.org/projects/cherrypy/badge/?version=latest
44 :target: http://docs.cherrypy.org/en/latest/?badge=latest
55
6 .. image:: https://img.shields.io/travis/cherrypy/cherrypy/master.svg?label=*NIX%20build%20%40%20Travis%20CI
6 .. image:: https://img.shields.io/travis/cherrypy/cherrypy/master.svg?label=Linux%20build%20%40%20Travis%20CI
77 :target: http://travis-ci.org/cherrypy/cherrypy
88
9 .. image:: https://img.shields.io/appveyor/ci/jaraco/cherrypy.svg?label=Windows%20build%20%40%20Travis%20CI
10 :target: https://ci.appveyor.com/project/jaraco/cherrypy
9 .. image:: https://img.shields.io/appveyor/ci/jaraco/cherrypy/master.svg?label=Windows%20build%20%40%20Appveyor
10 :target: https://ci.appveyor.com/project/jaraco/cherrypy/branch/master
1111
1212 .. image:: https://img.shields.io/pypi/pyversions/cherrypy.svg
1313
0 import cherrypy.daemon
0 from cherrypy.daemon import run
1
12
23 if __name__ == '__main__':
3 cherrypy.daemon.run()
4 run()
+0
-6
cherrypy/cherryd less more
0 #! /usr/bin/env python
1
2 import cherrypy.daemon
3
4 if __name__ == '__main__':
5 cherrypy.daemon.run()
408408 sys.exit('%s: fork #2 failed: (%d) %s\n'
409409 % (sys.argv[0], exc.errno, exc.strerror))
410410
411 os.chdir('/')
412411 os.umask(0)
413412
414413 si = open(self.stdin, 'r')
446446 argc = ctypes.c_int()
447447
448448 ctypes.pythonapi.Py_GetArgcArgv(ctypes.byref(argc), ctypes.byref(argv))
449
450 _argv = argv[:argc.value]
451
452 # The code below is trying to correctly handle special cases.
453 # `-c`'s argument interpreted by Python itself becomes `-c` as
454 # well. Same applies to `-m`. This snippet is trying to survive
455 # at least the case with `-m`
456 # Ref: https://github.com/cherrypy/cherrypy/issues/1545
457 # Ref: python/cpython@418baf9
458 argv_len, is_command, is_module = len(_argv), False, False
459
460 try:
461 m_ind = _argv.index('-m')
462 if m_ind < argv_len - 1 and _argv[m_ind + 1] in ('-c', '-m'):
463 """
464 In some older Python versions `-m`'s argument may be
465 substituted with `-c`, not `-m`
466 """
467 is_module = True
468 except (IndexError, ValueError):
469 m_ind = None
470
471 try:
472 c_ind = _argv.index('-c')
473 if m_ind < argv_len - 1 and _argv[c_ind + 1] == '-c':
474 is_command = True
475 except (IndexError, ValueError):
476 c_ind = None
477
478 if is_module:
479 """It's containing `-m -m` sequence of arguments"""
480 if is_command and c_ind < m_ind:
481 """There's `-c -c` before `-m`"""
482 raise RuntimeError(
483 "Cannot reconstruct command from '-c'. Ref: "
484 'https://github.com/cherrypy/cherrypy/issues/1545')
485 # Survive module argument here
486 original_module = sys.argv[0]
487 if not os.access(original_module, os.R_OK):
488 """There's no such module exist"""
489 raise AttributeError(
490 "{} doesn't seem to be a module "
491 "accessible by current user".format(original_module))
492 del _argv[m_ind:m_ind + 2] # remove `-m -m`
493 # ... and substitute it with the original module path:
494 _argv.insert(m_ind, original_module)
495 elif is_command:
496 """It's containing just `-c -c` sequence of arguments"""
497 raise RuntimeError(
498 "Cannot reconstruct command from '-c'. "
499 'Ref: https://github.com/cherrypy/cherrypy/issues/1545')
449500 except AttributeError:
450501 """It looks Py_GetArgcArgv is completely absent in some environments
451502
458509 """
459510 raise NotImplementedError
460511 else:
461 return argv[:argc.value]
512 return _argv
462513
463514 @staticmethod
464515 def _extend_pythonpath(env):
77 Even before any tweaking, this should serve a few demonstration pages.
88 Change to this directory and run:
99
10 ../cherryd -c site.conf
10 cherryd -c site.conf
1111
1212 """
1313
472472 cherrypy._cpserver.wait_for_free_port(self.host, self.port)
473473
474474 args = [
475 os.path.join(thisdir, '..', 'cherryd'),
475 '-m',
476 'cherrypy.__main__', # __main__ is needed for `-m` in Python 2.6
476477 '-c', self.config_file,
477478 '-p', self.pid_file,
478479 ]
480 """
481 Command for running cherryd server with autoreload enabled
482
483 Using
484
485 ```
486 ['-c',
487 "__requires__ = 'CherryPy'; \
488 import pkg_resources, re, sys; \
489 sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]); \
490 sys.exit(\
491 pkg_resources.load_entry_point(\
492 'CherryPy', 'console_scripts', 'cherryd')())"]
493 ```
494
495 doesn't work as it's impossible to reconstruct the `-c`'s contents.
496 Ref: https://github.com/cherrypy/cherrypy/issues/1545
497 """
479498
480499 if not isinstance(imports, (list, tuple)):
481500 imports = [imports]
5858 'cherrypy.scaffold',
5959 'cherrypy.wsgiserver',
6060 ]
61 scripts = ['cherrypy/cherryd']
6261
6362 install_requires = [
6463 'six',
8685 'xcgi': ['flup'],
8786
8887 # http://docs.cherrypy.org/en/latest/advanced.html?highlight=windows#windows-console-events
89 # disabled on Python 3.6 due to #1537
90 ':sys_platform == "win32" and python_version != "3.6"': ['pypiwin32'],
88 ':sys_platform == "win32"': ['pypiwin32'],
9189 }
9290 """Feature flags end-users can use in dependencies"""
9391
106104 url=url,
107105 license=cp_license,
108106 packages=packages,
109 scripts=scripts,
107 entry_points={"console_scripts": ["cherryd = cherrypy.__main__:run"]},
110108 include_package_data=True,
111109 install_requires=install_requires,
112110 extras_require=extras_require,