This is me!
Add something like this to your startup script:
eval "$(register-python-argcomplete plonex)"You can initialize a new project with the init command:
$ plonex init foo
INFO Creating foo/tmp
INFO Creating foo/etc
INFO Creating foo/var
INFO Creating foo/var/blobstorage
INFO Creating foo/var/cache
INFO Creating foo/var/filestorage
INFO Creating foo/var/log
INFO Creating foo/etc/plonex.yml
INFO Project initializedYou can describe your project with the describe command:
plonex describeBy default this will create a markdown file in var/plonex_description/index.md and render it on the console.
For the moment this displays only basic information about your project, but in the future it will be extended to include more useful information.
plonex dependenciesAfter initializing your project, you can find an etc/supervisor directory with a couple of example files:
$ ls etc/supervisor
zeoclient.conf.example
zeoserver.conf.exampleYou can use them to decide which services are managed by supervisor.
For example to start the zeoserver service when supervisor starts, you can just copy the example file:
cp etc/supervisor/zeoserver.conf.example etc/supervisor/zeoserver.confIf you want you can modify the file to suit your needs.
All the files with the extension .conf in the etc/supervisor directory will be loaded by supervisor.
Once you are ready, you can start supervisor with:
plonex supervisor startYou can add an admin user with the adduser command, e.g.:
$ plonex adduser admin $ADMIN_PASSWORD
[ale@flo bar]$ plonex adduser admin admin
User admin created.If you want to add a package to your project, you can use the install command:
$ plonex install collective.pdbpp
...If you want to use a custom PyPI repository, you can add in you pyproject.toml file the following snippet:
[tool.uv]
# Add command line parameters to the `pip` command, e.g.:
# index-strategy = "unsafe-best-match"
[[tool.uv.index]]
# You need to have this env variables set if you need to be authenticated:
# export UV_INDEX_PRIVATE_USERNAME=username
# export UV_INDEX_PRIVATE_PASSWORD=password
name = "private"
url = "https://pypi.acme.org/simple"
[[tool.uv.index]]
name = "pypi"
url = "https://pypi.org/simple"--extra-index-url=https://pypi.acme.org/simple
You can set options in multiple ways.
- In the command line (max priority)
- In config files
- In some
etc/plonex.*.ymlfile (if any of them exists, precedence is given by alphabetical order) - In the
etc/plonex.ymlfile - In the class definition options_default (lowest priority)
You can set the log level by setting the log_level variable, e.g.:
log_level: INFOValid values are: DEBUG, INFO, WARNING, ERROR, CRITICAL.
This value is ignored if you pass the -v/--verbose or the -q/--quiet option in the command line.
You can customize the Zope instance configuration by setting some options.
You can set the Zope default zope instance port by setting the http_port variable.
http_port: 8080You can set environment variables for the Zope instances by setting the environment_vars variable.
Note in this example how you can reuse existing variables
environment_vars:
PTS_LANGUAGES: it
TZ: Europe/Rome
zope_i18n_allowed_languages: '{{ environment_vars["PTS_LANGUAGES"] }}'
zope_i18n_compile_mo_files: true
CHAMELEON_CACHE: "{{ var_folder }}/cache/chameleon"
CHAMELEON_RELOAD: true
CHAMELEON_DEBUG: trueAlso note the usage of the undocument (FIXME!!) var_folder variable.
If you want to load additional zcml files, you can set the zcml_additional variable.
zcml_additional:
- etc/extra.zcml
- etc/extra-overrides.zcmlIf the file ends in -overrides.zcml, it will be loaded after the default zcml files and override the existing configuration.
Your extra zcml files will be threated as jinja2 templates, so you can use any variable known to the instance to render them.
You can run a script in the context of a zeo client with the run command:
plonex zeoclient run path/to/script.py [args ...]