In terms of the set of command-line tools, what about a "blogofile
plugin search" to go with "blogofile plugin available"?
--
Mike Pirnat
mpi...@gmail.com
http://www.pirnat.com/
I love the idea of a formal plugin system, but have some feedback and questions about this specific proposal.
First, you seem to be defining a lot of requirements/features based on packaging and installation. Why not let Python's normal tools take care of those things? Defining an API for loading and using plugins, but leaving the structure of the source code up to the plugin developer, and the distribution up to normal channels, means fewer details for you to worry about and fewer new details for a plugin developer to have to figure out.
If you base plugins on the pkg_resources feature of setuptools/distribute/distutils2, that would let them be installed system-wide (or in a virtualenv) via pip or easy_install, so you don't have to maintain the manifest and installation data yourself. It would still allow them to be activated/deactivated on a per-user or per-site basis through a configuration file, so installation would not activate a plugin unconditionally.
Code can be loaded with pkg_resources.iter_entry_points(), and that code can be responsible for loading its templates. If blogofile needs to access the templates directly, part of the plugin API can define a function that returns information about them so they can be loaded with pkgutil.get_data() -- that way it doesn't matter where they end up on the filesystem.
I don't understand the idea of the remote plugins on an HTTP server. What is that feature for? Why not install the plugin on the system where you're running blogofile?
Rather than hosting the plugins on blogofile.com, I would ask the pypi.python.org folks for a Trove classifier for Blogofile plugins and then use the search API to get the list. Defining a command line wrapper for listing plugins may still make sense, but why build a new special server to host them when the Python community already has a registration system for packages: PyPI. As a potential plugin author, I would much rather use the tools I'm familiar with for defining and distributing non-Blogofile packages.
Using PyPI also means you don't need "blogofile plugin install" or "blogofile plugin upgrade" commands -- just use pip or easy_install. Alternately, those commands could be re-defined to work only on the plugins actually installed on the current system, and run configuration scripts packaged within the plugins themselves.
$0.02-ly,
Doug
--
You received this message because you are subscribed to the Google Groups "blogofile-discuss" group.
To post to this group, send email to blogofil...@googlegroups.com.
To unsubscribe from this group, send email to blogofile-disc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/blogofile-discuss?hl=en.
Hey Doug,I think you're on to something golden. This is exactly why I wanted to get feedback before I did any work. However, I do have some obstacles in my mind about your proposal that I don't know how to resolve. Most of them can likely be resolved (or compromised satisfactorily) with a bit more thought though:
- Plugins for Blogofile are not necessarily Python source code. The design I've proposed is actually just mini-blogofile sites that layer on top of each other, so a Blogofile plugin could theoretically just be CSS files and images that compose a theme for Blgoofile, or they could just be a collection of templates and/or javascript. Now, obviously these can technically be wrapped in a Python module and installed with setuptools no problem and retrieved with pkgutil as you suggest, but would uploading such a module to PyPI be abusing it, considering it has no actual Python code in it? Is there any precedent for that? Now it's true that not every plugin needs to be in PyPI to work with easy_install, but then that makes the trove classifier idea kind of broken.
- Is there a way for me to query blogofile plugins that are installed on a system without first having to know which modules to query for? I'd still like to be able to maintain the "blogofile plugin list" mechanism without having to require modules imported in _config.py first. To put this in other words: Can a python module do something upon installation to declare itself as a certain type of python module and then later have another script (blogofile) ask which modules of that type exist on the system? Obviously I could hack together some kind of a database myself that modules register themselves into upon installation, but that seems kludgy.
- The blog templates at least will need to be easily modified by the user, if they're tucked away somewhere on sys.path, that's not going to work for some users. I guess the solution there is to have the templates relocatable somewhere in the user's site directory via a configuration setting on the plugin.
- Sites depending on deployment through git post-receive hooks will need to have a smarter build system in place because the controllers are outside the repository now and may not be installed on the host. Not difficult, just something I don't have to deal with today.
- I still think it's useful for Blogofile.com to host a list of plugins, this is so we can create a gallery of all the plugins, links to demo sites, screenshots, provide user ratings and comments etc. Like an app store of sorts. Plus this maintains a minimal amount of control in the bizarre case that someone were to upload something malicious to PyPI.
(BTW, I wasn't proposing any thing like remote plugins, I was merely envisioning a user being able to download a plugin from a remote HTTP server and install it and run it locally. much like "easy_install <URL>")
--
You received this message because you are subscribed to the Google Groups "blogofile-discuss" group.
To post to this group, send email to blogofil...@googlegroups.com.
To unsubscribe from this group, send email to blogofile-disc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/blogofile-discuss?hl=en.