Package: leocornus.recipe.wpmw
|travis|_ |pypi-version|_ |pypi-download|_ |pypi-license|_leocornus.recipe.wpmw=====================A buildout recipe trying to provide an easy way to manage WordPress Plugins, themes andMediaWiki Extenstions.Check `package README <leocornus/recipe/wpmw/README.rst>`_ foroptions and samples.License-------`GPLv2 license <LICENSE.GPL>`_.. |travis| image:: https://api.travis-ci.org/leocornus/leocornus.recipe.wpmw.png.. _travis: https://travis-ci.org/leocornus/leocornus.recipe.wpmw.. |pypi-version| image:: http://img.shields.io/pypi/v/leocornus.recipe.wpmw.svg.. _pypi-version: https://pypi.python.org/pypi/leocornus.recipe.wpmw.. |pypi-download| image:: http://img.shields.io/pypi/dm/leocornus.recipe.wpmw.svg.. _pypi-download: https://pypi.python.org/pypi/leocornus.recipe.wpmw.. |pypi-license| image:: http://img.shields.io/pypi/l/leocornus.recipe.wpmw.svg.. _pypi-license: https://pypi.python.org/pypi/leocornus.recipe.wpmwDetailed Documentation**********************This recipe should have 2 major functions: WordPress Plugins andMediaWiki ExtensionsOptions=======The ``leocornus.recipe.wpmw:Plugins`` recipe could be used to download WordPressPlugins package, extract to certain folder, and create the symlink to WordPresswp-content/plugins folder.  It supports the following general options:Options for all recipes:``ignore-existing``Default is true, ignore existing folder.Options for ``deploy`` recipe:``packages``A list of packages id and version at format id=version.e.g. SomeSkin=1.1``packages-repo``The base URL, where we could download the packages.``file-extension``set the file extension for each package. default is **.zip**``separator``set the separator between name and version. default is **.**.``destination``The target folder where the packages are extracted to.``action``There are 2 values for this option: ``symlink`` and ``copy``.Default value is ``symlink``.  This option will beignored for ``symlink`` and ``download`` recipes.Options for ``symlink`` recipe:``target-folder``the target folder, from which we create symlink to the link_name.``link-folder``the link folder will have all the link names.``names``the names used to create the symlink.  The following command will be used:$ ln -s target_folder/name link_folder/namezc.buildout built in a set of easy to use functions to simplfy the testing for buildoutrecipe.  Check http://pypi.python.org/pypi/zc.buildout/1.5.2#testing-support for moredetails.Examples for deploy recipe==========================Prepare the testing server for download>>> import os.path>>> testdir = join(os.path.dirname(__file__), 'testdata')>>> server = start_server(testdir)Get ready the testing folders.>>> dest = tmpdir('dest')>>> mkdir(dest, 'extensions')>>> mkdir(dest, 'plugins')>>> ls(dest)d  extensionsd  pluginstry to crate a symlink in plugins folder to test the unlink function.>>> import os>>> bp = tmpdir('bp-fake')>>> print bp/tmp/.../bp-fake>>> os.symlink(bp, os.path.join(dest, 'plugins', 'buddypress'))>>> ls(dest, 'plugins')d  buddypresscreate a broken symlink, we have to use ``os.path.lexists`` to check the link name exist ornot.>>> bplink = tmpdir('bp-link')>>> os.symlink(bplink, os.path.join(dest, 'plugins', 'buddypress-links'))>>> ls(dest, 'plugins')d  buddypressd  buddypress-links>>> remove(bplink)>>> ls(dest, 'plugins')d  buddypressl  buddypress-linksBuildout file to testing deployment with default symlink action.>>> write(sample_buildout, 'buildout.cfg',... """... [buildout]... parts =...     wpplugins...     mwextensions...... [wpplugins]... recipe = leocornus.recipe.wpmw:deploy... packages =...     buddypress=1.5.1...     bp-moderation=0.1.4...     buddypress-links=0.5... packages-repo = http://downloads.wordpress.org/plugin... destination = %(dest)s/plugins...... [mwextensions]... recipe = leocornus.recipe.wpmw:deploy... packages =...     Cite=r37577...     SemanticForms=1.9.1...     SemanticMediaWiki=1.5.1... packages-repo = %(server)srepos... destination = %(dest)s/extensions... """ % dict(server=server, dest=dest))Run the buildout>>> print system(buildout)Installing wpplugins.Downloading http://downloads.wordpress.org/plugin/buddypress.1.5.1.zipwpplugins: Extracting package to .../sample-buildout/parts/wpplugins/buddypress-1.5.1wpplugins: Create symlink to .../dest/plugins/buddypressDownloading http://downloads.wordpress.org/plugin/bp-moderation.0.1.4.zipwpplugins: Extracting package to .../sample-buildout/parts/wpplugins/bp-moderation-0.1.4wpplugins: Create symlink to .../dest/plugins/bp-moderationDownloading http://downloads.wordpress.org/plugin/buddypress-links.0.5.zipwpplugins: Extracting package to .../sample-buildout/parts/wpplugins/buddypress-links-0.5wpplugins: Create symlink to .../dest/plugins/buddypress-linksInstalling mwextensions.Downloading http://.../repos/Cite.r37577.zipmwextensions: Extracting package to .../sample-buildout/parts/mwextensions/Cite-r37577mwextensions: Create symlink to .../dest/extensions/CiteDownloading http://.../repos/SemanticForms.1.9.1.zipmwextensions: Extracting package to .../sample-buildout/parts/mwextensions/SemanticForms-1.9.1mwextensions: Create symlink to .../dest/extensions/SemanticFormsDownloading http://.../repos/SemanticMediaWiki.1.5.1.zipmwextensions: Extracting package to .../sample-buildout/parts/mwextensions/SemanticMediaWiki-1.5.1mwextensions: Create symlink to .../dest/extensions/SemanticMediaWiki...Check the destnation folder>>> ls(dest, 'plugins')d  bp-moderationd  buddypressd  buddypress-links>>> ls(dest, 'extensions')d  Cited  SemanticFormsd  SemanticMediaWikiNow, let's try the hard copy action.>>> write(sample_buildout, 'buildout.cfg',... """... [buildout]... parts =...     wpplugins...     mwextensions...... [wpplugins]... recipe = leocornus.recipe.wpmw:deploy... action = copy... packages =...     buddypress=1.5.1...     bp-moderation=0.1.4...     buddypress-links=0.5... packages-repo = http://downloads.wordpress.org/plugin... destination = %(dest)s/plugins...... [mwextensions]... recipe = leocornus.recipe.wpmw:deploy... action = copy... packages =...     Cite=r37577...     SemanticForms=1.9.1...     SemanticMediaWiki=1.5.1... packages-repo = %(server)srepos... destination = %(dest)s/extensions... """ % dict(server=server, dest=dest))>>> print system(buildout)Uninstalling mwextensions.Uninstalling wpplugins.Installing wpplugins.wpplugins: Extracting package to .../sample-buildout/parts/wpplugins/buddypress-1.5.1wpplugins: Rename to .../dest/plugins/buddypresswpplugins: Extracting package to .../sample-buildout/parts/wpplugins/bp-moderation-0.1.4wpplugins: Rename to .../dest/plugins/bp-moderationwpplugins: Extracting package to .../sample-buildout/parts/wpplugins/buddypress-links-0.5wpplugins: Rename to .../dest/plugins/buddypress-linksInstalling mwextensions.mwextensions: Extracting package to .../sample-buildout/parts/mwextensions/Cite-r37577mwextensions: Rename to .../dest/extensions/Citemwextensions: Extracting package to .../sample-buildout/parts/mwextensions/SemanticForms-1.9.1mwextensions: Rename to .../dest/extensions/SemanticFormsmwextensions: Extracting package to .../sample-buildout/parts/mwextensions/SemanticMediaWiki-1.5.1mwextensions: Rename to .../dest/extensions/SemanticMediaWiki...>>> ls(dest, 'plugins')d  bp-moderationd  buddypressd  buddypress-links>>> ls(dest, 'extensions')d  Cited  SemanticFormsd  SemanticMediaWikiExamples for symlink recipe===========================preparing the packages.>>> target = tmpdir('target')>>> mkdir(target, 'dirone')>>> mkdir(target, 'dirtwo')>>> write(target, 'one.file',... """... empty file for testing... """)>>> ls(target)d  dironed  dirtwo-  one.file>>> links = tmpdir('links')>>> ls(links)get ready the buildout config for symlink.>>> write(sample_buildout, 'buildout.cfg',... """... [buildout]... parts = symlinks...... [symlinks]... recipe = leocornus.recipe.wpmw:symlinks... target-folder = %(target)s... link-folder = %(link)s... names =...     dirone...     dirtwo...     one.file...     noexit.file... """ % dict(target=target, link=links))Run the buildout>>> print system(buildout)Uninstalling mwextensions.Uninstalling wpplugins.Installing symlinks.symlinks: Create symlink to .../links/dironesymlinks: Create symlink to .../links/dirtwosymlinks: Create symlink to .../links/one.filesymlinks: Target .../target/noexit.file not exist, ignoring...Verify the link folder.>>> ls(links)d  dironed  dirtwol  one.fileChange History**************1.3.1 (2016-02-22)=================- fix some errors in test cases.- adding travis CI.- update document format to rst (re-Structure).1.3.0 (2012-04-05)==================- Using the ``deploy`` recipe to replace both ``plugins`` and``extensions`` recipes.  Both recipes pretty much do the samework.1.2.0 (2012-03-23)==================- Adding the ``action`` option for both ``plugins`` and ``extensions``recipes.  It has ``symlink`` as the default value and ``copy`` todo hardcopy instead.1.1.1 (2012-03-09)==================- Make sure to create symlinks during buildout updating.1.1.0 (2012-03-07)==================- Add the part directory to install result, so buildout will removeit during uninstalling.- New symlinks recipe to create symlinks from target folder to linkfolder for all names.1.0.1 (2012-03-06)==================- Using os.path.lexists instead of os.path.exists to make sure thebroken symlinks got removed.1.0.0 (2012-03-05)==================- Initial releaseDownload***********************