Bulk creation of .metadata files for Zope skins resources
Project description
Main idea
Old Zope2 products were heavily based on skins resources. A lot of additional information for those resources are taken from .metadata file, so commonly if you have a:
my_icon.gif
…you will want to have also a:
my_icon.gif.metadata
In old Zope/Plone installation (let me say “before Varnish begin to be a Plone standard”) you can use those metadata for performing associations with HttpCache objects, making the user browser to perform some cache of resources:
[default] title=my_icon.gif cache=HTTPCache
zopemetadatamaker
This product will install for you a new executable: zopemetadatamaker. Using this you can automatically create your .metadata files. when you have a lot of static images, css and javascript files this can save you some times, for example: you downloaded a big Javascript library with a lot of sub-directories inside and other related resources.
How to use
The basic use of the command is something like this:
zopemetadatamaker *.gif
This will create for you all “.metadata” related to all gif file found in the current directory. You need to know that:
you must provide at least one filter patters
the directory where files are searched is the current working directory (but you can customize this, see below).
Complete list of options
Here the full documentation:
Usage: zopemetadatamaker [options] pattern [patterns] Bulk creation of .metadata files for Zope skins resources Options: --version show program's version number and exit -h, --help show this help message and exit -c METADATA, --content=METADATA choose a metadata text different from default; use quoting for multiline input -d, --default print default metadata (if --content is not provided), then exit -p PATHS, --path=PATHS directories path where to look for metadata. You can use this multiple times. Default is the current working directory --dry-run dry run, simply print what I would like to do -f, --force force .metadata creation; if another one exists it will be replaced -r, --recursive search and create recursively inside subdirs
What to put in the .metadata content
The default metadata content is like this:
[default] title=%(filename)s cache=HTTPCache
The %(filename)s section will be replaced with the original file name. You can use this, or omit it, when defining you custom .metadata.
I use this default content because it is the minimal “cache” information for Plone CMS static resouces.
Changelog
0.1.0 (2011-04-04)
Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file zopemetadatamaker-0.1.0.tar.gz
.
File metadata
- Download URL: zopemetadatamaker-0.1.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8be1c14098ad569d6ce72c7c66dc7020cf7ce55a7aaf6873abc4a22c2321a60f |
|
MD5 | 00ce8bf4ba0d5ef01296fd6859f7f215 |
|
BLAKE2b-256 | f67b3124d559c109b6e3c1b1927bd333bbad47d20e8a9aed3ceffc3318698a32 |