Missing `pelican` executable
egberts opened this issue · 1 comments
- I have read the Filing Issues and subsequent “How to Get Help” sections of the documentation.
- I have searched the issues (including closed ones) and believe that this is not a duplicate.
Issue
The pelican
executable is missing.
Often times, development works entails testing Pelican as NOT BEING INSTALLED (also no virtual environment too). Having to supply the missing pelican
executable becomes a necessary step. Many development works are done without the installation effort as part of the rapid but streamlined prototyping effort:
- Edit the Python/CSS/HTML or document file
- Run
pelican
- Repeat
Notice no installation (nor invoke build
) required.
This is most useful and ideal scenario in many IDE platforms. Also, it would make plugin development easier from the command line (CLI).
Suggested pelican
Python file:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import sys
import logging
from pelican.__main__ import main
class StdinFilter(logging.Filter):
def filter(self, rec):
return rec.levelno in (logging.DEBUG, logging.INFO)
class StderrFilter(logging.Filter):
def filter(self, rec):
return rec.levelno in (logging.WARNING, logging.FATAL, logging.CRITICAL)
logger = logging.getLogger("__name__")
logger.setLevel(logging.DEBUG)
h1 = logging.StreamHandler(sys.stdout)
h1.setLevel(logging.DEBUG)
h1.addFilter(StdinFilter())
h2 = logging.StreamHandler(sys.stderr)
h2.addFilter(StderrFilter())
h2.setLevel(logging.WARNING)
logger.addHandler(h1) # DEBUG/INFO
logger.addHandler(h2) # WARNING/FATAL/CRITICAL
if __name__ == "__main__":
sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
sys.exit(main())
Platform Used
- OS version and name: Linux 6.1.0-21-amd64 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 GNU/Linux
- Python version: 3.11.2
- Pelican version: HEAD (513abbf)
- Link to theme: m.css
- Links to plugins: pelican-plugins
- Link to your site: n/a
- Link to your source: n/a
If not installed, but testing... the following log message in server.py
is also invalid because the pelican
executable is .... not yet installed (evaluation mode as often done by newcomers willing to try Pelican).
logger.warning(
"'python -m pelican.server' is deprecated.\nThe "
"Pelican development server should be run via "
"'pelican --listen' or 'pelican -l'.\nThis can be combined "
"with regeneration as 'pelican -lr'.\nRerun 'pelican-"
"quickstart' to get new Makefile and tasks.py files."
)