forked from github/pelican
Merge pull request #2582 from timgates42/feature/python_main_support
Support for python -m pelican
This commit is contained in:
commit
577d18a778
3 changed files with 18 additions and 1 deletions
10
pelican/__main__.py
Normal file
10
pelican/__main__.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
"""
|
||||
python -m pelican module entry point to run via python -m
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
from . import main
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
@ -263,3 +263,10 @@ class TestPelican(LoggedTestCase):
|
|||
count=1,
|
||||
msg="Could not process .*parse_error.rst",
|
||||
level=logging.ERROR)
|
||||
|
||||
def test_module_load(self):
|
||||
"""Test loading via python -m pelican --help displays the help"""
|
||||
output = subprocess.check_output([
|
||||
sys.executable, '-m', 'pelican', '--help'
|
||||
]).decode('ascii', 'replace')
|
||||
assert 'usage:' in output
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -12,7 +12,7 @@ requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', 'docutils',
|
|||
|
||||
entry_points = {
|
||||
'console_scripts': [
|
||||
'pelican = pelican:main',
|
||||
'pelican = pelican.__main__:main',
|
||||
'pelican-import = pelican.tools.pelican_import:main',
|
||||
'pelican-quickstart = pelican.tools.pelican_quickstart:main',
|
||||
'pelican-themes = pelican.tools.pelican_themes:main'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue