zotonic/zotonic — pull request #672 by mawuli-ypa (2013-10-08 01:16:23+00:00)
Title: Zotonic modules

This pull request is in line with my GSoC work on the Zotonic Module Repository Integration.

## Changes:
* Rename `zotonic-installmodule` to `zotonic-module` since the script now does more than just install modules
* Add more module management methods (can be seen at the top of the script)
* Add test fixtures to test the module manager. This test fixture creates a site, and run some commands in there, and deletes the site when it is done.
* Perhaps the `coolest` change, is the ability to directly install from a given url. It currently works with Bitbucket(Mercurial), Github(Git) and GoogleCode(Mercurial) url specifications.

## Note:
* Currently, the module manager does not support module version/namespacing and dependencies.
This is because, the Zotonic Module repository server does not return these as part of it's JSON data. I have made some minor changes to the ZMR, but to effectively handle module dependencies, we can do the following:
* Ask module publishers to declare their module versions or dependencies when submitting a module
* Allow module publishers to issue a command such as `bin/zotonic modules publish` in the root directory of their module. This `publish` subcommand will then extract the necessary information and submit them to ZMR. This extracted metadata will then be returned as part of the response from ZMR.
* The web admin module manager is hosted at https://github.com/mawuli-ypa/mod_zmm
* To run the tests, do `bin/zotonic` modules test. The only test that has been disabled for now is the module search since it requires some of the changes on my fork of `mod_zmr` - https://github.com/mawuli-ypa/mod_zmr/tree/gsoc2013. I will send a pull request to mod_zmr too.

## Known issues:
* There are currently 8 pep8 warnings. PEP8 is basically the Python coding convention guide. The warnings displayed are all on lines that exceed 79 characters. These lines are `compromises` I have had to maintain since breaking them unto new lines also `breaks` Python's indentation and some string related operations. I could be wrong here.

I still think the code can be further refactored.

Thank You!