From 4d8a3cd808a309b250df40f64bb862fdb5ede434 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 19 Nov 2012 12:17:44 -0600 Subject: Suggest checking out the wiki for additional recipes --- docs/source/siteadmin/deploying.rst | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs/source') diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst index a270c723..dc0a4c67 100644 --- a/docs/source/siteadmin/deploying.rst +++ b/docs/source/siteadmin/deploying.rst @@ -32,6 +32,11 @@ GNU/Linux distro. install. If instead you want to join in as a contributor, see our `Hacking HOWTO `_ instead. + There are also many ways to install servers... for the sake of + simplicity, our instructions below describe installing with nginx. + For more recipes, including Apache, see + `our wiki `_. + Prepare System -------------- -- cgit v1.2.3 From 60389b21f5d24acf6faf08c225da16b3f8d7de18 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Tue, 20 Nov 2012 09:25:41 +0100 Subject: Purge routes package from MG (#507) We were not actually using the routes package anymore, but it was still mentioned in the documention. Adapt the plugin documentation to actually represent reality, although I don't like the API design. (but this is for another day) Signed-off-by: Sebastian Spaeth --- docs/source/siteadmin/codebase.rst | 2 -- 1 file changed, 2 deletions(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/codebase.rst b/docs/source/siteadmin/codebase.rst index 3ef91290..22f4e18b 100644 --- a/docs/source/siteadmin/codebase.rst +++ b/docs/source/siteadmin/codebase.rst @@ -68,8 +68,6 @@ Software Stack * `WebOb `_: nice abstraction layer from HTTP requests, responses and WSGI bits - * `Routes `_: for URL routing - * `Beaker `_: for handling sessions and caching -- cgit v1.2.3 From c356dc16351b33cc60cc95d6a5836ffaceffc5eb Mon Sep 17 00:00:00 2001 From: Elrond Date: Tue, 20 Nov 2012 14:32:29 +0100 Subject: Very small typo fix in deploying docs. Thanks to #mediagoblin. --- docs/source/siteadmin/deploying.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst index dc0a4c67..0eb67be4 100644 --- a/docs/source/siteadmin/deploying.rst +++ b/docs/source/siteadmin/deploying.rst @@ -170,7 +170,7 @@ And set up the in-package virtualenv:: If you have problems here, consider trying to install virtualenv with the ``--distribute`` or ``--no-site-packages`` options. If - your system's default Python is in the 3.x series you man need to + your system's default Python is in the 3.x series you may need to run ``virtualenv`` with the ``--python=python2.7`` or ``--python=python2.6`` options. @@ -178,7 +178,7 @@ The above provides an in-package install of ``virtualenv``. While this is counter to the conventional ``virtualenv`` configuration, it is more reliable and considerably easier to configure and illustrate. If you're familiar with Python packaging you may consider deploying with -your preferred the method. +your preferred method. Assuming you are going to deploy with FastCGI, you should also install flup:: -- cgit v1.2.3 From 7989cd6e4961749a39147c9020dbae745b4f23de Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Sat, 1 Dec 2012 20:31:18 +0100 Subject: docs: Add trim_whitespaces plugin to relnotes and documentation Rather than mentioning a hypothetical module restrictfive, we use the existing plugin mediagoblin-licenses that people can install. Also, mention that plugin in the release notes. Signed-off-by: Sebastian Spaeth --- docs/source/siteadmin/plugins.rst | 22 +++++++++++++--------- docs/source/siteadmin/relnotes.rst | 6 ++++++ 2 files changed, 19 insertions(+), 9 deletions(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/plugins.rst b/docs/source/siteadmin/plugins.rst index 75562d4b..baca381d 100644 --- a/docs/source/siteadmin/plugins.rst +++ b/docs/source/siteadmin/plugins.rst @@ -44,29 +44,33 @@ If the plugin is available on the `Python Package Index pip install For example, if we wanted to install the plugin named -"mediagoblin-restrictfive", we would do:: +"mediagoblin-licenses" (which allows you to customize the licenses you +offer for your media), we would do:: - pip install mediagoblin-restrictfive + pip install mediagoblin-licenses .. Note:: If you're using a virtual environment, make sure to activate the - virtual environment before installing with pip. Otherwise the - plugin may get installed in a different environment than the one - MediaGoblin is installed in. + virtual environment before installing with pip. Otherwise the plugin + may get installed in a different environment than the one MediaGoblin + is installed in. Also make sure, you use e.g. pip-2.7 if your default + python (and thus pip) is python 3 (e.g. in Ubuntu). Once you've installed the plugin software, you need to tell MediaGoblin that this is a plugin you want MediaGoblin to use. To do that, you edit the ``mediagoblin.ini`` file and add the plugin as a subsection of the plugin section. -For example, say the "mediagoblin-restrictfive" plugin had the Python -package path ``restrictfive``, then you would add ``restrictfive`` to +For example, say the "mediagoblin-licenses" plugin has the Python +package path ``mediagoblin_licenses``, then you would add ``mediagoblin_licenses`` to the ``plugins`` section as a subsection:: [plugins] - [[restrictfive]] + [[mediagoblin_licenses]] + license_01=abbrev1, name1, http://url1 + license_02=abbrev2, name1, http://url2 Configuring plugins @@ -112,7 +116,7 @@ Removing plugins To remove a plugin, use ``pip uninstall``. For example:: - pip uninstall mediagoblin-restrictfive + pip uninstall mediagoblin-licenses .. Note:: diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst index 1b70b31c..56267eb1 100644 --- a/docs/source/siteadmin/relnotes.rst +++ b/docs/source/siteadmin/relnotes.rst @@ -49,6 +49,12 @@ carefully, or at least skim over it. See :ref:`core-plugin-section` for plugin documentation +* **trim_whitespace** + + We bundle the optional plugin trim_whitespace which reduces the size + of the delivered html output by reducing redundant whitespace. + + See :ref:`core-plugin-section` for plugin documentation 0.3.0 ===== -- cgit v1.2.3 From 9d5cd0b924fe790d27b4941c5d226fc7bde03741 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Fri, 14 Dec 2012 18:29:00 -0600 Subject: Adding info to the docs about running dbupdate Both adding info to run it when adding new media types, and adding info that you might need to stop mediagoblin before you run these commands. --- docs/source/siteadmin/deploying.rst | 6 ++++++ docs/source/siteadmin/media-types.rst | 9 +++++++++ 2 files changed, 15 insertions(+) (limited to 'docs/source') diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst index 0eb67be4..91406f96 100644 --- a/docs/source/siteadmin/deploying.rst +++ b/docs/source/siteadmin/deploying.rst @@ -191,6 +191,12 @@ codebase, you should also run:: ./bin/python setup.py develop --upgrade && ./bin/gmg dbupdate +Note: If you are running an active site, depending on your server +configuration, you may need to stop it first or the dbupdate command +may hang (and it's certainly a good idea to restart it after the +update) + + Deploy MediaGoblin Services --------------------------- diff --git a/docs/source/siteadmin/media-types.rst b/docs/source/siteadmin/media-types.rst index 5653217f..3b46c1b6 100644 --- a/docs/source/siteadmin/media-types.rst +++ b/docs/source/siteadmin/media-types.rst @@ -43,6 +43,15 @@ video media types, then the list would look like this:: media_types = mediagoblin.media_types.image, mediagoblin.media_types.video +Note that after enabling new media types, you must run dbupdate like so:: + + ./bin/gmg dbupdate + +If you are running an active site, depending on your server +configuration, you may need to stop it first (and it's certainly a +good idea to restart it after the update). + + How does MediaGoblin decide which media type to use for a file? =============================================================== -- cgit v1.2.3 From cacb6feae48fd2657f02d85dbe949580d0fa6b5b Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Sat, 15 Dec 2012 21:00:41 +0100 Subject: Release note 0.3.2 blurb On MongoDB... --- docs/source/siteadmin/relnotes.rst | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst index 56267eb1..3e09078e 100644 --- a/docs/source/siteadmin/relnotes.rst +++ b/docs/source/siteadmin/relnotes.rst @@ -19,6 +19,24 @@ This chapter has important information for releases in it. If you're upgrading from a previous release, please read it carefully, or at least skim over it. +0.3.2 +===== + +This will be the last release that is capable of converting from an earlier +MongoDB-based MediaGoblin instance to the newer SQL-based system. + + +**New features** + +* TO BE FILLED IN BEFORE RELEASE :-) + +* **trim_whitespace** + + We bundle the optional plugin trim_whitespace which reduces the size + of the delivered html output by reducing redundant whitespace. + + See :ref:`core-plugin-section` for plugin documentation + 0.3.1 ===== @@ -49,12 +67,6 @@ carefully, or at least skim over it. See :ref:`core-plugin-section` for plugin documentation -* **trim_whitespace** - - We bundle the optional plugin trim_whitespace which reduces the size - of the delivered html output by reducing redundant whitespace. - - See :ref:`core-plugin-section` for plugin documentation 0.3.0 ===== -- cgit v1.2.3 From 5ef7ab084f246b81897e248590be3a61898adc77 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Thu, 20 Dec 2012 08:18:19 -0600 Subject: Added documentation on how to add STL support, and notes on running ./bin/gmg dbupdate --- docs/source/siteadmin/media-types.rst | 36 +++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/media-types.rst b/docs/source/siteadmin/media-types.rst index 3b46c1b6..26852842 100644 --- a/docs/source/siteadmin/media-types.rst +++ b/docs/source/siteadmin/media-types.rst @@ -77,6 +77,12 @@ good/bad/ugly). On Debianoid systems:: gstreamer0.10-ffmpeg +Add ``mediagoblin.media_types.video`` to the ``media_types`` list in your +``mediagoblin_local.ini`` and restart MediaGoblin. + +Run:: + ./bin/gmg dbupdate + Now you should be able to submit videos, and mediagoblin should transcode them. @@ -117,8 +123,12 @@ Then install ``scikits.audiolab`` for the spectrograms:: ./bin/pip install scikits.audiolab Add ``mediagoblin.media_types.audio`` to the ``media_types`` list in your -``mediagoblin_local.ini`` and restart MediaGoblin. You should now be able to -upload and listen to audio files! +``mediagoblin_local.ini`` and restart MediaGoblin. + +Run:: + ./bin/gmg dbupdate + +You should now be able to upload and listen to audio files! Ascii art @@ -140,4 +150,26 @@ the list would look like this:: media_types = mediagoblin.media_types.image, mediagoblin.media_types.ascii +Run:: + ./bin/gmg dbupdate + Now any .txt file you uploaded will be processed as ascii art! + + +STL / 3d model support +====================== + +To enable the "STL" 3d model support plugin, first make sure you have +a recentish `Blender `_ installed and available on +your execution path. This feature has been tested with Blender 2.63. +It may work on some earlier versions, but that is not guaranteed (and +is surely not to work prior to Blender 2.5X). + +Add ``mediagoblin.media_types.stl`` to the ``media_types`` list in your +``mediagoblin_local.ini`` and restart MediaGoblin. + +Run:: + ./bin/gmg dbupdate + +You should now be able to upload .obj and .stl files and MediaGoblin +will be able to present them to your wide audience of admirers! -- cgit v1.2.3 From 3fe3b2229c82fd894bc4d3e8effdf26cfc7780ea Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Thu, 20 Dec 2012 08:22:49 -0600 Subject: Docs fix: Adding proper blank line after the "Run::" --- docs/source/siteadmin/media-types.rst | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs/source') diff --git a/docs/source/siteadmin/media-types.rst b/docs/source/siteadmin/media-types.rst index 26852842..8fbce5e4 100644 --- a/docs/source/siteadmin/media-types.rst +++ b/docs/source/siteadmin/media-types.rst @@ -81,6 +81,7 @@ Add ``mediagoblin.media_types.video`` to the ``media_types`` list in your ``mediagoblin_local.ini`` and restart MediaGoblin. Run:: + ./bin/gmg dbupdate Now you should be able to submit videos, and mediagoblin should @@ -126,6 +127,7 @@ Add ``mediagoblin.media_types.audio`` to the ``media_types`` list in your ``mediagoblin_local.ini`` and restart MediaGoblin. Run:: + ./bin/gmg dbupdate You should now be able to upload and listen to audio files! @@ -151,6 +153,7 @@ the list would look like this:: media_types = mediagoblin.media_types.image, mediagoblin.media_types.ascii Run:: + ./bin/gmg dbupdate Now any .txt file you uploaded will be processed as ascii art! @@ -169,6 +172,7 @@ Add ``mediagoblin.media_types.stl`` to the ``media_types`` list in your ``mediagoblin_local.ini`` and restart MediaGoblin. Run:: + ./bin/gmg dbupdate You should now be able to upload .obj and .stl files and MediaGoblin -- cgit v1.2.3 From 1f01df1dfc891e900e659db84ef840138b60d160 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Thu, 20 Dec 2012 09:48:47 -0600 Subject: 0.3.2 release notes --- docs/source/siteadmin/relnotes.rst | 59 +++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst index 3e09078e..ef164cbb 100644 --- a/docs/source/siteadmin/relnotes.rst +++ b/docs/source/siteadmin/relnotes.rst @@ -25,10 +25,18 @@ carefully, or at least skim over it. This will be the last release that is capable of converting from an earlier MongoDB-based MediaGoblin instance to the newer SQL-based system. +**Do this to upgrade** + +1. Make sure to run ``bin/gmg dbuptdate`` after upgrading. + **New features** -* TO BE FILLED IN BEFORE RELEASE :-) +* **3d model support!** + + You can now upload STL and OBJ files and display them in + MediaGoblin. Requires a recent-ish Blender; for details see: + :ref:`deploying-chapter` * **trim_whitespace** @@ -37,6 +45,55 @@ MongoDB-based MediaGoblin instance to the newer SQL-based system. See :ref:`core-plugin-section` for plugin documentation +* **A new API!** + + It isn't well documented yet but we do have an API. There is an + `android application in progress `_ + which makes use of it, and there are some demo applications between + `automgtic `_, an + automatic media uploader for your desktop + and `OMGMG `_, an example of + a web application hooking up to the API. + + This is a plugin, so you have to enable it in your mediagoblin + config file by adding a section under [plugins] like:: + + [plugins] + [[mediagoblin.plugins.api]] + + Note that the API works but is not nailed down... the way it is + called may change in future releases. + +* **OAuth login support** + + For applications that use OAuth to connect to the API. + + This is a plugin, so you have to enable it in your mediagoblin + config file by adding a section under [plugins] like:: + + [plugins] + [[mediagoblin.plugins.oauth]] + +* **Collections** + + We now have user-curated collections support. These are arbitrary + galleries that are customizable by users. You can add media to + these by clicking on the paperclip icon when logged in and looking + at a media entry. + +* **OpenStreetMap licensing display improvements** + + More accurate display of OSM licensing, and less disruptive: you + click to "expand" the display of said licensing. + + Geolocation is also now on by default. + +* **Miscelaneous visual improvements** + + We've made a number of small visual improvements including newer and + nicer looking thumbnails and improved checkbox placement. + + 0.3.1 ===== -- cgit v1.2.3 From 5c99cd01a70f2d597ac7669e8d944ddf79b05281 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Thu, 20 Dec 2012 13:54:03 -0600 Subject: Fixing tyop'ed "dbupdate" --- docs/source/siteadmin/relnotes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst index ef164cbb..25d4d83f 100644 --- a/docs/source/siteadmin/relnotes.rst +++ b/docs/source/siteadmin/relnotes.rst @@ -27,7 +27,7 @@ MongoDB-based MediaGoblin instance to the newer SQL-based system. **Do this to upgrade** -1. Make sure to run ``bin/gmg dbuptdate`` after upgrading. +1. Make sure to run ``bin/gmg dbupdate`` after upgrading. **New features** -- cgit v1.2.3 From 42ce372e38b28d6e01da76b05d6924d04c2710ae Mon Sep 17 00:00:00 2001 From: Mike Linksvayer Date: Thu, 20 Dec 2012 12:52:31 -0800 Subject: actual upgrade instructions --- docs/source/siteadmin/relnotes.rst | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst index 25d4d83f..55a8279d 100644 --- a/docs/source/siteadmin/relnotes.rst +++ b/docs/source/siteadmin/relnotes.rst @@ -27,7 +27,19 @@ MongoDB-based MediaGoblin instance to the newer SQL-based system. **Do this to upgrade** -1. Make sure to run ``bin/gmg dbupdate`` after upgrading. + # directory of your mediagoblin install + cd /srv/mediagoblin.example.org + + # copy source for this release + git fetch + git checkout tags/v0.3.2 + + # perform any needed database updates + bin/gmg dbupdate + + # restart your servers however you do that, e.g., + sudo service mediagoblin-paster restart + sudo service mediagoblin-celeryd restart **New features** -- cgit v1.2.3 From 53f528cfeaab5fc146844b6d7d85997c92cfd979 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Thu, 15 Nov 2012 16:57:33 +0100 Subject: purge webob from docs and replace with werkzeug --- docs/source/siteadmin/codebase.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/codebase.rst b/docs/source/siteadmin/codebase.rst index 22f4e18b..73e938e7 100644 --- a/docs/source/siteadmin/codebase.rst +++ b/docs/source/siteadmin/codebase.rst @@ -65,7 +65,7 @@ Software Stack `Paste Script `_: we'll use this for configuring and launching the application - * `WebOb `_: nice abstraction layer + * `werkzeug `_: nice abstraction layer from HTTP requests, responses and WSGI bits * `Beaker `_: for handling sessions and -- cgit v1.2.3 From 8d19cb2445e2aa1f53431da26d866bf9b5e25872 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Fri, 16 Nov 2012 11:32:35 +0100 Subject: Don't require webob as dependency It is pushing up the daisies. Also relnote the change. --- docs/source/build/mediagoblin-licenses/PKG-INFO | 11 ++++ docs/source/build/mediagoblin-licenses/README | 15 +++++ .../mediagoblin_licenses/README.rst | 15 +++++ .../mediagoblin_licenses/__init__.py | 69 ++++++++++++++++++++++ .../mediagoblin_licenses/README.rst | 15 +++++ .../mediagoblin_licenses/__init__.py | 69 ++++++++++++++++++++++ .../mediagoblin_licenses.egg-info/PKG-INFO | 11 ++++ .../mediagoblin_licenses.egg-info/SOURCES.txt | 6 ++ .../dependency_links.txt | 1 + .../mediagoblin_licenses.egg-info/top_level.txt | 1 + docs/source/build/mediagoblin-licenses/setup.py | 30 ++++++++++ docs/source/build/pip-delete-this-directory.txt | 5 ++ docs/source/plugindocs/trim_whitespace.rst | 1 + docs/source/siteadmin/relnotes.rst | 9 +++ 14 files changed, 258 insertions(+) create mode 100644 docs/source/build/mediagoblin-licenses/PKG-INFO create mode 100644 docs/source/build/mediagoblin-licenses/README create mode 100644 docs/source/build/mediagoblin-licenses/build/lib.linux-x86_64-2.7/mediagoblin_licenses/README.rst create mode 100644 docs/source/build/mediagoblin-licenses/build/lib.linux-x86_64-2.7/mediagoblin_licenses/__init__.py create mode 100644 docs/source/build/mediagoblin-licenses/mediagoblin_licenses/README.rst create mode 100644 docs/source/build/mediagoblin-licenses/mediagoblin_licenses/__init__.py create mode 100644 docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/PKG-INFO create mode 100644 docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/SOURCES.txt create mode 100644 docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/dependency_links.txt create mode 100644 docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/top_level.txt create mode 100644 docs/source/build/mediagoblin-licenses/setup.py create mode 100644 docs/source/build/pip-delete-this-directory.txt create mode 100644 docs/source/plugindocs/trim_whitespace.rst (limited to 'docs/source') diff --git a/docs/source/build/mediagoblin-licenses/PKG-INFO b/docs/source/build/mediagoblin-licenses/PKG-INFO new file mode 100644 index 00000000..047efe83 --- /dev/null +++ b/docs/source/build/mediagoblin-licenses/PKG-INFO @@ -0,0 +1,11 @@ +Metadata-Version: 1.1 +Name: mediagoblin-licenses +Version: 0.1.2 +Summary: Customize the licenses for your mediagoblin installation +Home-page: https://gitorious.org/mediagoblin-licenses/mediagoblin-licenses +Author: Sebastian Spaeth +Author-email: Sebastian@SSpaeth.de +License: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+) +Download-URL: https://gitorious.org/mediagoblin-licenses/mediagoblin-licenses/archive-tarball/mediagoblin-licenses-v0.1.2 +Description: UNKNOWN +Platform: UNKNOWN diff --git a/docs/source/build/mediagoblin-licenses/README b/docs/source/build/mediagoblin-licenses/README new file mode 100644 index 00000000..ce52a8c0 --- /dev/null +++ b/docs/source/build/mediagoblin-licenses/README @@ -0,0 +1,15 @@ +================ + Custom Licenses +================ + +Enable by configuring all custom licenses in the form of: +license_x=Abbreviation, Full Name, URL to license + +Make sure to only insert one line per license without line breaks. + +E.g. do this into mediagoblin_local.ini: +[[mediagoblin_licenses]] +license_1=Chicken Dance, Chicken Dance License v1.0, https://raw.github.com/supertunaman/cdl/f0ae734f4abce311070ac0c401dbc0230cbc4344/COPYING +license_2=WTFPL, Do What the Fuck Public License v2.0, http://sam.zoy.org/wtfpl/ + +This plugin is licensed under the GNU APGL v3+. \ No newline at end of file diff --git a/docs/source/build/mediagoblin-licenses/build/lib.linux-x86_64-2.7/mediagoblin_licenses/README.rst b/docs/source/build/mediagoblin-licenses/build/lib.linux-x86_64-2.7/mediagoblin_licenses/README.rst new file mode 100644 index 00000000..ce52a8c0 --- /dev/null +++ b/docs/source/build/mediagoblin-licenses/build/lib.linux-x86_64-2.7/mediagoblin_licenses/README.rst @@ -0,0 +1,15 @@ +================ + Custom Licenses +================ + +Enable by configuring all custom licenses in the form of: +license_x=Abbreviation, Full Name, URL to license + +Make sure to only insert one line per license without line breaks. + +E.g. do this into mediagoblin_local.ini: +[[mediagoblin_licenses]] +license_1=Chicken Dance, Chicken Dance License v1.0, https://raw.github.com/supertunaman/cdl/f0ae734f4abce311070ac0c401dbc0230cbc4344/COPYING +license_2=WTFPL, Do What the Fuck Public License v2.0, http://sam.zoy.org/wtfpl/ + +This plugin is licensed under the GNU APGL v3+. \ No newline at end of file diff --git a/docs/source/build/mediagoblin-licenses/build/lib.linux-x86_64-2.7/mediagoblin_licenses/__init__.py b/docs/source/build/mediagoblin-licenses/build/lib.linux-x86_64-2.7/mediagoblin_licenses/__init__.py new file mode 100644 index 00000000..37f5a390 --- /dev/null +++ b/docs/source/build/mediagoblin-licenses/build/lib.linux-x86_64-2.7/mediagoblin_licenses/__init__.py @@ -0,0 +1,69 @@ +# GNU MediaGoblin -- federated, autonomous media hosting +# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +from __future__ import unicode_literals + +import logging +from mediagoblin.tools.pluginapi import get_config +from mediagoblin.tools import licenses + +__VERSION__ = '0.1.2' # releases get numbers, post release a "+" appended +_log = logging.getLogger(__name__) + +SORTED_PLUGIN_LICENSES = [] +"""This is the equivalent of MG.tools.licenses.SORTED_LICENSES +that we want to replace""" + + +class CustomLicenses(object): + _setup_plugin_called = 0 + + @classmethod + def setup_plugin(cls): + if cls._setup_plugin_called: + return # Only set up once + cls._setup_plugin_called += 1 + _log.info('Configurable license plugin setting up!') + # Get configured licenses + config = get_config(cls.__module__) + if not config: + _log.warn('There are no licenses configured at all.') + return # Nothing configured, nothing to do... + + for k,v in config.iteritems(): + if not k.lower().startswith('license_'): + continue + (abbrev, name, url) = config.as_list(k) + _log.info("Adding license: {0}".format(abbrev)) + SORTED_PLUGIN_LICENSES.append(licenses.License(abbrev, name, url)) + + # Set the regular license list to our custom ones: + licenses.SORTED_LICENSES = SORTED_PLUGIN_LICENSES + # create dict {url: License,...} to enable fast license lookup by url. + + # The data structure in + # mediagoblin.tools.licenses.SUPPORTED_LICENSES and SORTED_LICENSES + # is really not optimal. What we want there is a "OrderedDict" that + # can give us order AND quick lookup by key at the same time. But as + # that is python >=2.7 and we have to deal with python 2.6, we'll + # live with the data duplication in 2 structures for now. It's not + # like we are going to have hundreds of licenses, fortunately. + licenses.SUPPORTED_LICENSES = dict(((l.uri, l) for l in \ + SORTED_PLUGIN_LICENSES)) + + +hooks = { + 'setup': CustomLicenses.setup_plugin + } diff --git a/docs/source/build/mediagoblin-licenses/mediagoblin_licenses/README.rst b/docs/source/build/mediagoblin-licenses/mediagoblin_licenses/README.rst new file mode 100644 index 00000000..ce52a8c0 --- /dev/null +++ b/docs/source/build/mediagoblin-licenses/mediagoblin_licenses/README.rst @@ -0,0 +1,15 @@ +================ + Custom Licenses +================ + +Enable by configuring all custom licenses in the form of: +license_x=Abbreviation, Full Name, URL to license + +Make sure to only insert one line per license without line breaks. + +E.g. do this into mediagoblin_local.ini: +[[mediagoblin_licenses]] +license_1=Chicken Dance, Chicken Dance License v1.0, https://raw.github.com/supertunaman/cdl/f0ae734f4abce311070ac0c401dbc0230cbc4344/COPYING +license_2=WTFPL, Do What the Fuck Public License v2.0, http://sam.zoy.org/wtfpl/ + +This plugin is licensed under the GNU APGL v3+. \ No newline at end of file diff --git a/docs/source/build/mediagoblin-licenses/mediagoblin_licenses/__init__.py b/docs/source/build/mediagoblin-licenses/mediagoblin_licenses/__init__.py new file mode 100644 index 00000000..37f5a390 --- /dev/null +++ b/docs/source/build/mediagoblin-licenses/mediagoblin_licenses/__init__.py @@ -0,0 +1,69 @@ +# GNU MediaGoblin -- federated, autonomous media hosting +# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +from __future__ import unicode_literals + +import logging +from mediagoblin.tools.pluginapi import get_config +from mediagoblin.tools import licenses + +__VERSION__ = '0.1.2' # releases get numbers, post release a "+" appended +_log = logging.getLogger(__name__) + +SORTED_PLUGIN_LICENSES = [] +"""This is the equivalent of MG.tools.licenses.SORTED_LICENSES +that we want to replace""" + + +class CustomLicenses(object): + _setup_plugin_called = 0 + + @classmethod + def setup_plugin(cls): + if cls._setup_plugin_called: + return # Only set up once + cls._setup_plugin_called += 1 + _log.info('Configurable license plugin setting up!') + # Get configured licenses + config = get_config(cls.__module__) + if not config: + _log.warn('There are no licenses configured at all.') + return # Nothing configured, nothing to do... + + for k,v in config.iteritems(): + if not k.lower().startswith('license_'): + continue + (abbrev, name, url) = config.as_list(k) + _log.info("Adding license: {0}".format(abbrev)) + SORTED_PLUGIN_LICENSES.append(licenses.License(abbrev, name, url)) + + # Set the regular license list to our custom ones: + licenses.SORTED_LICENSES = SORTED_PLUGIN_LICENSES + # create dict {url: License,...} to enable fast license lookup by url. + + # The data structure in + # mediagoblin.tools.licenses.SUPPORTED_LICENSES and SORTED_LICENSES + # is really not optimal. What we want there is a "OrderedDict" that + # can give us order AND quick lookup by key at the same time. But as + # that is python >=2.7 and we have to deal with python 2.6, we'll + # live with the data duplication in 2 structures for now. It's not + # like we are going to have hundreds of licenses, fortunately. + licenses.SUPPORTED_LICENSES = dict(((l.uri, l) for l in \ + SORTED_PLUGIN_LICENSES)) + + +hooks = { + 'setup': CustomLicenses.setup_plugin + } diff --git a/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/PKG-INFO b/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/PKG-INFO new file mode 100644 index 00000000..047efe83 --- /dev/null +++ b/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/PKG-INFO @@ -0,0 +1,11 @@ +Metadata-Version: 1.1 +Name: mediagoblin-licenses +Version: 0.1.2 +Summary: Customize the licenses for your mediagoblin installation +Home-page: https://gitorious.org/mediagoblin-licenses/mediagoblin-licenses +Author: Sebastian Spaeth +Author-email: Sebastian@SSpaeth.de +License: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+) +Download-URL: https://gitorious.org/mediagoblin-licenses/mediagoblin-licenses/archive-tarball/mediagoblin-licenses-v0.1.2 +Description: UNKNOWN +Platform: UNKNOWN diff --git a/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/SOURCES.txt b/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/SOURCES.txt new file mode 100644 index 00000000..0e504e97 --- /dev/null +++ b/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/SOURCES.txt @@ -0,0 +1,6 @@ +README +mediagoblin_licenses/__init__.py +pip-egg-info/mediagoblin_licenses.egg-info/PKG-INFO +pip-egg-info/mediagoblin_licenses.egg-info/SOURCES.txt +pip-egg-info/mediagoblin_licenses.egg-info/dependency_links.txt +pip-egg-info/mediagoblin_licenses.egg-info/top_level.txt \ No newline at end of file diff --git a/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/dependency_links.txt b/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/dependency_links.txt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/top_level.txt b/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/top_level.txt new file mode 100644 index 00000000..142877ed --- /dev/null +++ b/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/top_level.txt @@ -0,0 +1 @@ +mediagoblin_licenses diff --git a/docs/source/build/mediagoblin-licenses/setup.py b/docs/source/build/mediagoblin-licenses/setup.py new file mode 100644 index 00000000..952ba3ce --- /dev/null +++ b/docs/source/build/mediagoblin-licenses/setup.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python +from distutils.core import setup +import re + +from sys import version +assert version >= '2.6', 'This package requires python 2.6 at least. Sorry.' + +def get_version(): + """Parse __init__.py for version info, we cannot import it""" + version_re = re.compile(r'\s*__VERSION__\s*=\s*("|\')([\w\.\+]+)(\1)') + with open('mediagoblin_licenses/__init__.py', 'rt') as file: + for line in file: + if version_re.match(line): + return version_re.match(line).group(2) +__VERSION__ = get_version() + + +setup(name='mediagoblin-licenses', + version=__VERSION__, + description='Customize the licenses for your mediagoblin installation', + author='Sebastian Spaeth', + author_email='Sebastian@SSpaeth.de', + url='https://gitorious.org/mediagoblin-licenses/mediagoblin-licenses', + download_url='https://gitorious.org/mediagoblin-licenses/mediagoblin-licenses/archive-tarball/mediagoblin-licenses-v' + __VERSION__, + # http://bugs.python.org/issue13943. Must not be unicode... + packages=['mediagoblin_licenses'], + package_data = {'mediagoblin_licenses': ['README.rst', 'COPYING']}, + license=(b'License :: OSI Approved :: GNU Affero General Public License ' + b'v3 or later (AGPLv3+)') + ) diff --git a/docs/source/build/pip-delete-this-directory.txt b/docs/source/build/pip-delete-this-directory.txt new file mode 100644 index 00000000..c8883ea9 --- /dev/null +++ b/docs/source/build/pip-delete-this-directory.txt @@ -0,0 +1,5 @@ +This file is placed here by pip to indicate the source was put +here by pip. + +Once this package is successfully installed this source code will be +deleted (unless you remove this file). diff --git a/docs/source/plugindocs/trim_whitespace.rst b/docs/source/plugindocs/trim_whitespace.rst new file mode 100644 index 00000000..eb38e0e5 --- /dev/null +++ b/docs/source/plugindocs/trim_whitespace.rst @@ -0,0 +1 @@ +.. include:: ../../../mediagoblin/plugins/trim_whitespace/README.rst diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst index 25d4d83f..9b45f642 100644 --- a/docs/source/siteadmin/relnotes.rst +++ b/docs/source/siteadmin/relnotes.rst @@ -19,6 +19,15 @@ This chapter has important information for releases in it. If you're upgrading from a previous release, please read it carefully, or at least skim over it. +WIP +===== + +**New features** + +**Other changed** + +* Dependency list has been reduced not requireing the "webob" package anymore. + 0.3.2 ===== -- cgit v1.2.3 From 511d5b89664daef455da0579e8c8658e5b81cce5 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Sat, 22 Dec 2012 12:05:03 +0100 Subject: Revert accidental checkin Commit 8d19cb2445e2aa1f53431da26d866bf9b5e25872 accidentally included my docs/source/build directory. Removing it again. Thanks to Elrond for noticing. Signed-off-by: Sebastian Spaeth --- docs/source/build/mediagoblin-licenses/PKG-INFO | 11 ---- docs/source/build/mediagoblin-licenses/README | 15 ----- .../mediagoblin_licenses/README.rst | 15 ----- .../mediagoblin_licenses/__init__.py | 69 ---------------------- .../mediagoblin_licenses/README.rst | 15 ----- .../mediagoblin_licenses/__init__.py | 69 ---------------------- .../mediagoblin_licenses.egg-info/PKG-INFO | 11 ---- .../mediagoblin_licenses.egg-info/SOURCES.txt | 6 -- .../dependency_links.txt | 1 - .../mediagoblin_licenses.egg-info/top_level.txt | 1 - docs/source/build/mediagoblin-licenses/setup.py | 30 ---------- docs/source/build/pip-delete-this-directory.txt | 5 -- 12 files changed, 248 deletions(-) delete mode 100644 docs/source/build/mediagoblin-licenses/PKG-INFO delete mode 100644 docs/source/build/mediagoblin-licenses/README delete mode 100644 docs/source/build/mediagoblin-licenses/build/lib.linux-x86_64-2.7/mediagoblin_licenses/README.rst delete mode 100644 docs/source/build/mediagoblin-licenses/build/lib.linux-x86_64-2.7/mediagoblin_licenses/__init__.py delete mode 100644 docs/source/build/mediagoblin-licenses/mediagoblin_licenses/README.rst delete mode 100644 docs/source/build/mediagoblin-licenses/mediagoblin_licenses/__init__.py delete mode 100644 docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/PKG-INFO delete mode 100644 docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/SOURCES.txt delete mode 100644 docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/dependency_links.txt delete mode 100644 docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/top_level.txt delete mode 100644 docs/source/build/mediagoblin-licenses/setup.py delete mode 100644 docs/source/build/pip-delete-this-directory.txt (limited to 'docs/source') diff --git a/docs/source/build/mediagoblin-licenses/PKG-INFO b/docs/source/build/mediagoblin-licenses/PKG-INFO deleted file mode 100644 index 047efe83..00000000 --- a/docs/source/build/mediagoblin-licenses/PKG-INFO +++ /dev/null @@ -1,11 +0,0 @@ -Metadata-Version: 1.1 -Name: mediagoblin-licenses -Version: 0.1.2 -Summary: Customize the licenses for your mediagoblin installation -Home-page: https://gitorious.org/mediagoblin-licenses/mediagoblin-licenses -Author: Sebastian Spaeth -Author-email: Sebastian@SSpaeth.de -License: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+) -Download-URL: https://gitorious.org/mediagoblin-licenses/mediagoblin-licenses/archive-tarball/mediagoblin-licenses-v0.1.2 -Description: UNKNOWN -Platform: UNKNOWN diff --git a/docs/source/build/mediagoblin-licenses/README b/docs/source/build/mediagoblin-licenses/README deleted file mode 100644 index ce52a8c0..00000000 --- a/docs/source/build/mediagoblin-licenses/README +++ /dev/null @@ -1,15 +0,0 @@ -================ - Custom Licenses -================ - -Enable by configuring all custom licenses in the form of: -license_x=Abbreviation, Full Name, URL to license - -Make sure to only insert one line per license without line breaks. - -E.g. do this into mediagoblin_local.ini: -[[mediagoblin_licenses]] -license_1=Chicken Dance, Chicken Dance License v1.0, https://raw.github.com/supertunaman/cdl/f0ae734f4abce311070ac0c401dbc0230cbc4344/COPYING -license_2=WTFPL, Do What the Fuck Public License v2.0, http://sam.zoy.org/wtfpl/ - -This plugin is licensed under the GNU APGL v3+. \ No newline at end of file diff --git a/docs/source/build/mediagoblin-licenses/build/lib.linux-x86_64-2.7/mediagoblin_licenses/README.rst b/docs/source/build/mediagoblin-licenses/build/lib.linux-x86_64-2.7/mediagoblin_licenses/README.rst deleted file mode 100644 index ce52a8c0..00000000 --- a/docs/source/build/mediagoblin-licenses/build/lib.linux-x86_64-2.7/mediagoblin_licenses/README.rst +++ /dev/null @@ -1,15 +0,0 @@ -================ - Custom Licenses -================ - -Enable by configuring all custom licenses in the form of: -license_x=Abbreviation, Full Name, URL to license - -Make sure to only insert one line per license without line breaks. - -E.g. do this into mediagoblin_local.ini: -[[mediagoblin_licenses]] -license_1=Chicken Dance, Chicken Dance License v1.0, https://raw.github.com/supertunaman/cdl/f0ae734f4abce311070ac0c401dbc0230cbc4344/COPYING -license_2=WTFPL, Do What the Fuck Public License v2.0, http://sam.zoy.org/wtfpl/ - -This plugin is licensed under the GNU APGL v3+. \ No newline at end of file diff --git a/docs/source/build/mediagoblin-licenses/build/lib.linux-x86_64-2.7/mediagoblin_licenses/__init__.py b/docs/source/build/mediagoblin-licenses/build/lib.linux-x86_64-2.7/mediagoblin_licenses/__init__.py deleted file mode 100644 index 37f5a390..00000000 --- a/docs/source/build/mediagoblin-licenses/build/lib.linux-x86_64-2.7/mediagoblin_licenses/__init__.py +++ /dev/null @@ -1,69 +0,0 @@ -# GNU MediaGoblin -- federated, autonomous media hosting -# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -from __future__ import unicode_literals - -import logging -from mediagoblin.tools.pluginapi import get_config -from mediagoblin.tools import licenses - -__VERSION__ = '0.1.2' # releases get numbers, post release a "+" appended -_log = logging.getLogger(__name__) - -SORTED_PLUGIN_LICENSES = [] -"""This is the equivalent of MG.tools.licenses.SORTED_LICENSES -that we want to replace""" - - -class CustomLicenses(object): - _setup_plugin_called = 0 - - @classmethod - def setup_plugin(cls): - if cls._setup_plugin_called: - return # Only set up once - cls._setup_plugin_called += 1 - _log.info('Configurable license plugin setting up!') - # Get configured licenses - config = get_config(cls.__module__) - if not config: - _log.warn('There are no licenses configured at all.') - return # Nothing configured, nothing to do... - - for k,v in config.iteritems(): - if not k.lower().startswith('license_'): - continue - (abbrev, name, url) = config.as_list(k) - _log.info("Adding license: {0}".format(abbrev)) - SORTED_PLUGIN_LICENSES.append(licenses.License(abbrev, name, url)) - - # Set the regular license list to our custom ones: - licenses.SORTED_LICENSES = SORTED_PLUGIN_LICENSES - # create dict {url: License,...} to enable fast license lookup by url. - - # The data structure in - # mediagoblin.tools.licenses.SUPPORTED_LICENSES and SORTED_LICENSES - # is really not optimal. What we want there is a "OrderedDict" that - # can give us order AND quick lookup by key at the same time. But as - # that is python >=2.7 and we have to deal with python 2.6, we'll - # live with the data duplication in 2 structures for now. It's not - # like we are going to have hundreds of licenses, fortunately. - licenses.SUPPORTED_LICENSES = dict(((l.uri, l) for l in \ - SORTED_PLUGIN_LICENSES)) - - -hooks = { - 'setup': CustomLicenses.setup_plugin - } diff --git a/docs/source/build/mediagoblin-licenses/mediagoblin_licenses/README.rst b/docs/source/build/mediagoblin-licenses/mediagoblin_licenses/README.rst deleted file mode 100644 index ce52a8c0..00000000 --- a/docs/source/build/mediagoblin-licenses/mediagoblin_licenses/README.rst +++ /dev/null @@ -1,15 +0,0 @@ -================ - Custom Licenses -================ - -Enable by configuring all custom licenses in the form of: -license_x=Abbreviation, Full Name, URL to license - -Make sure to only insert one line per license without line breaks. - -E.g. do this into mediagoblin_local.ini: -[[mediagoblin_licenses]] -license_1=Chicken Dance, Chicken Dance License v1.0, https://raw.github.com/supertunaman/cdl/f0ae734f4abce311070ac0c401dbc0230cbc4344/COPYING -license_2=WTFPL, Do What the Fuck Public License v2.0, http://sam.zoy.org/wtfpl/ - -This plugin is licensed under the GNU APGL v3+. \ No newline at end of file diff --git a/docs/source/build/mediagoblin-licenses/mediagoblin_licenses/__init__.py b/docs/source/build/mediagoblin-licenses/mediagoblin_licenses/__init__.py deleted file mode 100644 index 37f5a390..00000000 --- a/docs/source/build/mediagoblin-licenses/mediagoblin_licenses/__init__.py +++ /dev/null @@ -1,69 +0,0 @@ -# GNU MediaGoblin -- federated, autonomous media hosting -# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -from __future__ import unicode_literals - -import logging -from mediagoblin.tools.pluginapi import get_config -from mediagoblin.tools import licenses - -__VERSION__ = '0.1.2' # releases get numbers, post release a "+" appended -_log = logging.getLogger(__name__) - -SORTED_PLUGIN_LICENSES = [] -"""This is the equivalent of MG.tools.licenses.SORTED_LICENSES -that we want to replace""" - - -class CustomLicenses(object): - _setup_plugin_called = 0 - - @classmethod - def setup_plugin(cls): - if cls._setup_plugin_called: - return # Only set up once - cls._setup_plugin_called += 1 - _log.info('Configurable license plugin setting up!') - # Get configured licenses - config = get_config(cls.__module__) - if not config: - _log.warn('There are no licenses configured at all.') - return # Nothing configured, nothing to do... - - for k,v in config.iteritems(): - if not k.lower().startswith('license_'): - continue - (abbrev, name, url) = config.as_list(k) - _log.info("Adding license: {0}".format(abbrev)) - SORTED_PLUGIN_LICENSES.append(licenses.License(abbrev, name, url)) - - # Set the regular license list to our custom ones: - licenses.SORTED_LICENSES = SORTED_PLUGIN_LICENSES - # create dict {url: License,...} to enable fast license lookup by url. - - # The data structure in - # mediagoblin.tools.licenses.SUPPORTED_LICENSES and SORTED_LICENSES - # is really not optimal. What we want there is a "OrderedDict" that - # can give us order AND quick lookup by key at the same time. But as - # that is python >=2.7 and we have to deal with python 2.6, we'll - # live with the data duplication in 2 structures for now. It's not - # like we are going to have hundreds of licenses, fortunately. - licenses.SUPPORTED_LICENSES = dict(((l.uri, l) for l in \ - SORTED_PLUGIN_LICENSES)) - - -hooks = { - 'setup': CustomLicenses.setup_plugin - } diff --git a/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/PKG-INFO b/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/PKG-INFO deleted file mode 100644 index 047efe83..00000000 --- a/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/PKG-INFO +++ /dev/null @@ -1,11 +0,0 @@ -Metadata-Version: 1.1 -Name: mediagoblin-licenses -Version: 0.1.2 -Summary: Customize the licenses for your mediagoblin installation -Home-page: https://gitorious.org/mediagoblin-licenses/mediagoblin-licenses -Author: Sebastian Spaeth -Author-email: Sebastian@SSpaeth.de -License: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+) -Download-URL: https://gitorious.org/mediagoblin-licenses/mediagoblin-licenses/archive-tarball/mediagoblin-licenses-v0.1.2 -Description: UNKNOWN -Platform: UNKNOWN diff --git a/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/SOURCES.txt b/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/SOURCES.txt deleted file mode 100644 index 0e504e97..00000000 --- a/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/SOURCES.txt +++ /dev/null @@ -1,6 +0,0 @@ -README -mediagoblin_licenses/__init__.py -pip-egg-info/mediagoblin_licenses.egg-info/PKG-INFO -pip-egg-info/mediagoblin_licenses.egg-info/SOURCES.txt -pip-egg-info/mediagoblin_licenses.egg-info/dependency_links.txt -pip-egg-info/mediagoblin_licenses.egg-info/top_level.txt \ No newline at end of file diff --git a/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/dependency_links.txt b/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/dependency_links.txt deleted file mode 100644 index 8b137891..00000000 --- a/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/top_level.txt b/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/top_level.txt deleted file mode 100644 index 142877ed..00000000 --- a/docs/source/build/mediagoblin-licenses/pip-egg-info/mediagoblin_licenses.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -mediagoblin_licenses diff --git a/docs/source/build/mediagoblin-licenses/setup.py b/docs/source/build/mediagoblin-licenses/setup.py deleted file mode 100644 index 952ba3ce..00000000 --- a/docs/source/build/mediagoblin-licenses/setup.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python -from distutils.core import setup -import re - -from sys import version -assert version >= '2.6', 'This package requires python 2.6 at least. Sorry.' - -def get_version(): - """Parse __init__.py for version info, we cannot import it""" - version_re = re.compile(r'\s*__VERSION__\s*=\s*("|\')([\w\.\+]+)(\1)') - with open('mediagoblin_licenses/__init__.py', 'rt') as file: - for line in file: - if version_re.match(line): - return version_re.match(line).group(2) -__VERSION__ = get_version() - - -setup(name='mediagoblin-licenses', - version=__VERSION__, - description='Customize the licenses for your mediagoblin installation', - author='Sebastian Spaeth', - author_email='Sebastian@SSpaeth.de', - url='https://gitorious.org/mediagoblin-licenses/mediagoblin-licenses', - download_url='https://gitorious.org/mediagoblin-licenses/mediagoblin-licenses/archive-tarball/mediagoblin-licenses-v' + __VERSION__, - # http://bugs.python.org/issue13943. Must not be unicode... - packages=['mediagoblin_licenses'], - package_data = {'mediagoblin_licenses': ['README.rst', 'COPYING']}, - license=(b'License :: OSI Approved :: GNU Affero General Public License ' - b'v3 or later (AGPLv3+)') - ) diff --git a/docs/source/build/pip-delete-this-directory.txt b/docs/source/build/pip-delete-this-directory.txt deleted file mode 100644 index c8883ea9..00000000 --- a/docs/source/build/pip-delete-this-directory.txt +++ /dev/null @@ -1,5 +0,0 @@ -This file is placed here by pip to indicate the source was put -here by pip. - -Once this package is successfully installed this source code will be -deleted (unless you remove this file). -- cgit v1.2.3 From b0c8328e547288028e7e43f0ceb1fa9f7c8dac4a Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Fri, 30 Nov 2012 10:10:35 +0100 Subject: Move db.sql.models* to db.models* --- docs/source/siteadmin/relnotes.rst | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs/source') diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst index 9b45f642..7d480d90 100644 --- a/docs/source/siteadmin/relnotes.rst +++ b/docs/source/siteadmin/relnotes.rst @@ -26,6 +26,9 @@ WIP **Other changed** +* Plugin writers: Internal restructuring led to mediagoblin.db.sql* be + mediagoblin.db.* starting from 0.3.3 + * Dependency list has been reduced not requireing the "webob" package anymore. 0.3.2 -- cgit v1.2.3 From 3a8b18f85b9affca46a433607d7d9ae723380b94 Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Fri, 25 Jan 2013 21:43:49 +0100 Subject: Updated video apt-get to not use glob Also changed some literal blocks to code-blocks --- docs/source/siteadmin/media-types.rst | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/media-types.rst b/docs/source/siteadmin/media-types.rst index 8fbce5e4..23d3f3b9 100644 --- a/docs/source/siteadmin/media-types.rst +++ b/docs/source/siteadmin/media-types.rst @@ -71,16 +71,24 @@ Video To enable video, first install gstreamer and the python-gstreamer bindings (as well as whatever gstremaer extensions you want, -good/bad/ugly). On Debianoid systems:: +good/bad/ugly). On Debianoid systems - sudo apt-get install python-gst0.10 gstreamer0.10-plugins-{base,bad,good,ugly} \ +.. code-block:: bash + + sudo apt-get install python-gst0.10 \ + gstreamer0.10-plugins-base \ + gstreamer0.10-plugins-bad \ + gstreamer0.10-plugins-good \ + gstreamer0.10-plugins-ugly \ gstreamer0.10-ffmpeg Add ``mediagoblin.media_types.video`` to the ``media_types`` list in your ``mediagoblin_local.ini`` and restart MediaGoblin. -Run:: +Run + +.. code-block:: bash ./bin/gmg dbupdate @@ -108,7 +116,9 @@ To install these on Debianoid systems, run:: The ``scikits.audiolab`` package you will install in the next step depends on the ``libsndfile1-dev`` package, so we should install it. -On Debianoid systems, run:: +On Debianoid systems, run + +.. code-block:: bash sudo apt-get install libsndfile1-dev @@ -126,7 +136,9 @@ Then install ``scikits.audiolab`` for the spectrograms:: Add ``mediagoblin.media_types.audio`` to the ``media_types`` list in your ``mediagoblin_local.ini`` and restart MediaGoblin. -Run:: +Run + +.. code-block:: bash ./bin/gmg dbupdate @@ -138,7 +150,9 @@ Ascii art To enable ascii art support, first install the `chardet `_ -library, which is necessary for creating thumbnails of ascii art:: +library, which is necessary for creating thumbnails of ascii art + +.. code-block:: bash ./bin/easy_install chardet @@ -152,7 +166,9 @@ the list would look like this:: media_types = mediagoblin.media_types.image, mediagoblin.media_types.ascii -Run:: +Run + +.. code-block:: bash ./bin/gmg dbupdate @@ -171,7 +187,9 @@ is surely not to work prior to Blender 2.5X). Add ``mediagoblin.media_types.stl`` to the ``media_types`` list in your ``mediagoblin_local.ini`` and restart MediaGoblin. -Run:: +Run + +.. code-block:: bash ./bin/gmg dbupdate -- cgit v1.2.3 From 92c597ca1cd0d93df7246eb2f81f84bcb08673ce Mon Sep 17 00:00:00 2001 From: Elrond Date: Sat, 26 Jan 2013 00:12:18 +0100 Subject: Allow doc string extraction and use for pluginapi. Allow us to extract docstrings from our sources using the sphinx.ext.autodoc module. First use: Extract some of the docs for the pluginapi and provide it in a new "Plugin API" section. --- docs/source/conf.py | 2 +- docs/source/index.rst | 1 + docs/source/pluginwriter/api.rst | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 docs/source/pluginwriter/api.rst (limited to 'docs/source') diff --git a/docs/source/conf.py b/docs/source/conf.py index 4209acc8..8113e247 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -26,7 +26,7 @@ sys.path.insert(0, os.path.abspath(os.path.join('..', '..'))) # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = [] +extensions = ['sphinx.ext.autodoc'] # Add any paths that contain templates here, relative to this directory. templates_path = ['source/_templates'] diff --git a/docs/source/index.rst b/docs/source/index.rst index ac8bd110..adaafb59 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -70,6 +70,7 @@ This guide covers writing new GNU MediaGoblin plugins. pluginwriter/foreward pluginwriter/quickstart + pluginwriter/api Indices and tables diff --git a/docs/source/pluginwriter/api.rst b/docs/source/pluginwriter/api.rst new file mode 100644 index 00000000..206c8b0b --- /dev/null +++ b/docs/source/pluginwriter/api.rst @@ -0,0 +1,23 @@ +.. MediaGoblin Documentation + + Written in 2013 by MediaGoblin contributors + + To the extent possible under law, the author(s) have dedicated all + copyright and related and neighboring rights to this software to + the public domain worldwide. This software is distributed without + any warranty. + + You should have received a copy of the CC0 Public Domain + Dedication along with this software. If not, see + . + + +========== +Plugin API +========== + +:mod:`pluginapi` Module +----------------------- + +.. automodule:: mediagoblin.tools.pluginapi + :members: get_config, register_routes, register_template_path -- cgit v1.2.3 From b238a95464fae821b9f83ad723eecf3fd43a52d2 Mon Sep 17 00:00:00 2001 From: Elrond Date: Sat, 26 Jan 2013 13:03:54 +0100 Subject: Add Trim whitespace plugin docs. Added the documentation (which was already present in plugindocs/) to the TOC, so it's getting build and linked. --- docs/source/index.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/source') diff --git a/docs/source/index.rst b/docs/source/index.rst index adaafb59..24cde4e6 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -58,6 +58,7 @@ Part 2: Core plugin documentation plugindocs/flatpagesfile plugindocs/sampleplugin plugindocs/oauth + plugindocs/trim_whitespace Part 3: Plugin Writer's Guide -- cgit v1.2.3 From 3214c653dd72605ecacfffe13d1972c2c88506c1 Mon Sep 17 00:00:00 2001 From: Elrond Date: Sat, 26 Jan 2013 19:20:18 +0100 Subject: Docs: Create new area for developers. We need some "Part" for developers. Currently, it's named "Part 4: Developer's Zone". But we should come up with a better name soon. Moved the codebase docs in there for starters. --- docs/source/devel/codebase.rst | 158 +++++++++++++++++++++++++++++++++++++ docs/source/index.rst | 12 ++- docs/source/siteadmin/codebase.rst | 158 ------------------------------------- 3 files changed, 169 insertions(+), 159 deletions(-) create mode 100644 docs/source/devel/codebase.rst delete mode 100644 docs/source/siteadmin/codebase.rst (limited to 'docs/source') diff --git a/docs/source/devel/codebase.rst b/docs/source/devel/codebase.rst new file mode 100644 index 00000000..73e938e7 --- /dev/null +++ b/docs/source/devel/codebase.rst @@ -0,0 +1,158 @@ +.. MediaGoblin Documentation + + Written in 2011, 2012 by MediaGoblin contributors + + To the extent possible under law, the author(s) have dedicated all + copyright and related and neighboring rights to this software to + the public domain worldwide. This software is distributed without + any warranty. + + You should have received a copy of the CC0 Public Domain + Dedication along with this software. If not, see + . + +.. _codebase-chapter: + +======================== + Codebase Documentation +======================== + +.. contents:: Sections + :local: + + +This chapter covers the libraries that GNU MediaGoblin uses as well as +various recipes for getting things done. + +.. Note:: + + This chapter is in flux. Clearly there are things here that aren't + documented. If there's something you have questions about, please + ask! + + See `the join page on the website `_ + for where we hang out. + +For more information on how to get started hacking on GNU MediaGoblin, +see `the wiki `_. + + +Software Stack +============== + +* Project infrastructure + + * `Python `_: the language we're using to write + this + + * `Nose `_: + for unit tests + + * `virtualenv `_: for setting up an + isolated environment to keep mediagoblin and related packages + (potentially not required if MediaGoblin is packaged for your + distro) + +* Data storage + + * `SQLAlchemy `_: SQL ORM and database + interaction library for Python. Currently we support sqlite and + postgress as backends. + +* Web application + + * `Paste Deploy `_ and + `Paste Script `_: we'll use this for + configuring and launching the application + + * `werkzeug `_: nice abstraction layer + from HTTP requests, responses and WSGI bits + + * `Beaker `_: for handling sessions and + caching + + * `Jinja2 `_: the templating engine + + * `WTForms `_: for handling, + validation, and abstraction from HTML forms + + * `Celery `_: for task queuing (resizing + images, encoding video, ...) + + * `Babel `_: Used to extract and compile + translations. + + * `Markdown (for python) `_: + implementation of `Markdown `_ + text-to-html tool to make it easy for people to write richtext + comments, descriptions, and etc. + + * `lxml `_: nice xml and html processing for + python. + +* Media processing libraries + + * `Python Imaging Library `_: + used to resize and otherwise convert images for display. + + * `GStreamer `_: (Optional, for + video hosting sites only) Used to transcode video, and in the + future, probably audio too. + + * `chardet `_: (Optional, for + ascii art hosting sites only) Used to make ascii art thumbnails. + +* Front end + + * `JQuery `_: for groovy JavaScript things + + + +What's where +============ + +After you've run checked out mediagoblin and followed the virtualenv +instantiation instructions, you're faced with the following directory +tree:: + + mediagoblin/ + |- mediagoblin/ # source code + | |- tests/ + | |- templates/ + | |- auth/ + | \- submit/ + |- docs/ # documentation + |- devtools/ # some scripts for developer convenience + | + | # the below directories are installed into your virtualenv checkout + | + |- bin/ # scripts + |- develop-eggs/ + |- lib/ # python libraries installed into your virtualenv + |- include/ + |- mediagoblin.egg-info/ + |- parts/ + |- user_dev/ # sessions, etc + + +As you can see, all the code for GNU MediaGoblin is in the +``mediagoblin`` directory. + +Here are some interesting files and what they do: + +:routing.py: maps url paths to views +:views.py: views handle http requests +:models.py: holds the sqlalchemy schemas---these are the data structures + we're working with + +You'll notice that there are several sub-directories: tests, +templates, auth, submit, ... + +``tests`` holds the unit test code. + +``templates`` holds all the templates for the output. + +``auth`` and ``submit`` are modules that enacpsulate authentication +and media item submission. If you look in these directories, you'll +see they have their own ``routing.py``, ``view.py``, and +``models.py`` in addition to some other code. diff --git a/docs/source/index.rst b/docs/source/index.rst index 24cde4e6..576e7af9 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -44,7 +44,6 @@ MediaGoblin website. It is written for site administrators. siteadmin/relnotes siteadmin/theming siteadmin/plugins - siteadmin/codebase .. _core-plugin-section: @@ -74,6 +73,17 @@ This guide covers writing new GNU MediaGoblin plugins. pluginwriter/api +Part 4: Developer's Zone +======================== + +This chapter contains various information for developers. + +.. toctree:: + :maxdepth: 1 + + devel/codebase + + Indices and tables ================== diff --git a/docs/source/siteadmin/codebase.rst b/docs/source/siteadmin/codebase.rst deleted file mode 100644 index 73e938e7..00000000 --- a/docs/source/siteadmin/codebase.rst +++ /dev/null @@ -1,158 +0,0 @@ -.. MediaGoblin Documentation - - Written in 2011, 2012 by MediaGoblin contributors - - To the extent possible under law, the author(s) have dedicated all - copyright and related and neighboring rights to this software to - the public domain worldwide. This software is distributed without - any warranty. - - You should have received a copy of the CC0 Public Domain - Dedication along with this software. If not, see - . - -.. _codebase-chapter: - -======================== - Codebase Documentation -======================== - -.. contents:: Sections - :local: - - -This chapter covers the libraries that GNU MediaGoblin uses as well as -various recipes for getting things done. - -.. Note:: - - This chapter is in flux. Clearly there are things here that aren't - documented. If there's something you have questions about, please - ask! - - See `the join page on the website `_ - for where we hang out. - -For more information on how to get started hacking on GNU MediaGoblin, -see `the wiki `_. - - -Software Stack -============== - -* Project infrastructure - - * `Python `_: the language we're using to write - this - - * `Nose `_: - for unit tests - - * `virtualenv `_: for setting up an - isolated environment to keep mediagoblin and related packages - (potentially not required if MediaGoblin is packaged for your - distro) - -* Data storage - - * `SQLAlchemy `_: SQL ORM and database - interaction library for Python. Currently we support sqlite and - postgress as backends. - -* Web application - - * `Paste Deploy `_ and - `Paste Script `_: we'll use this for - configuring and launching the application - - * `werkzeug `_: nice abstraction layer - from HTTP requests, responses and WSGI bits - - * `Beaker `_: for handling sessions and - caching - - * `Jinja2 `_: the templating engine - - * `WTForms `_: for handling, - validation, and abstraction from HTML forms - - * `Celery `_: for task queuing (resizing - images, encoding video, ...) - - * `Babel `_: Used to extract and compile - translations. - - * `Markdown (for python) `_: - implementation of `Markdown `_ - text-to-html tool to make it easy for people to write richtext - comments, descriptions, and etc. - - * `lxml `_: nice xml and html processing for - python. - -* Media processing libraries - - * `Python Imaging Library `_: - used to resize and otherwise convert images for display. - - * `GStreamer `_: (Optional, for - video hosting sites only) Used to transcode video, and in the - future, probably audio too. - - * `chardet `_: (Optional, for - ascii art hosting sites only) Used to make ascii art thumbnails. - -* Front end - - * `JQuery `_: for groovy JavaScript things - - - -What's where -============ - -After you've run checked out mediagoblin and followed the virtualenv -instantiation instructions, you're faced with the following directory -tree:: - - mediagoblin/ - |- mediagoblin/ # source code - | |- tests/ - | |- templates/ - | |- auth/ - | \- submit/ - |- docs/ # documentation - |- devtools/ # some scripts for developer convenience - | - | # the below directories are installed into your virtualenv checkout - | - |- bin/ # scripts - |- develop-eggs/ - |- lib/ # python libraries installed into your virtualenv - |- include/ - |- mediagoblin.egg-info/ - |- parts/ - |- user_dev/ # sessions, etc - - -As you can see, all the code for GNU MediaGoblin is in the -``mediagoblin`` directory. - -Here are some interesting files and what they do: - -:routing.py: maps url paths to views -:views.py: views handle http requests -:models.py: holds the sqlalchemy schemas---these are the data structures - we're working with - -You'll notice that there are several sub-directories: tests, -templates, auth, submit, ... - -``tests`` holds the unit test code. - -``templates`` holds all the templates for the output. - -``auth`` and ``submit`` are modules that enacpsulate authentication -and media item submission. If you look in these directories, you'll -see they have their own ``routing.py``, ``view.py``, and -``models.py`` in addition to some other code. -- cgit v1.2.3 From ae9f0aec381c7f04898f0dde3af322ec876b9651 Mon Sep 17 00:00:00 2001 From: Elrond Date: Sat, 26 Jan 2013 19:21:40 +0100 Subject: Docs: Add a database guide to the plugin docs. Plugin writers will often need to create new tables. So give them some hints, what they need to do and where they might find more info. --- docs/source/index.rst | 1 + docs/source/pluginwriter/database.rst | 111 ++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 docs/source/pluginwriter/database.rst (limited to 'docs/source') diff --git a/docs/source/index.rst b/docs/source/index.rst index 576e7af9..abd891a0 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -70,6 +70,7 @@ This guide covers writing new GNU MediaGoblin plugins. pluginwriter/foreward pluginwriter/quickstart + pluginwriter/database pluginwriter/api diff --git a/docs/source/pluginwriter/database.rst b/docs/source/pluginwriter/database.rst new file mode 100644 index 00000000..58edf3a0 --- /dev/null +++ b/docs/source/pluginwriter/database.rst @@ -0,0 +1,111 @@ +.. MediaGoblin Documentation + + Written in 2013 by MediaGoblin contributors + + To the extent possible under law, the author(s) have dedicated all + copyright and related and neighboring rights to this software to + the public domain worldwide. This software is distributed without + any warranty. + + You should have received a copy of the CC0 Public Domain + Dedication along with this software. If not, see + . + + +======== +Database +======== + + +Accessing Existing Data +======================= + +If your plugin wants to access existing data, this is quite +straight forward. Just import the appropiate models and use +the full power of SQLAlchemy. Take a look at the (upcoming) +database section in the Developer's Chapter. + + +Creating new Tables +=================== + +If your plugin needs some new space to store data, you +should create a new table. Please do not modify core +tables. Not doing so might seem inefficient and possibly +is. It will help keep things sane and easier to upgrade +versions later. + +So if you create a new plugin and need new tables, create a +file named ``models.py`` in your plugin directory. You +might take a look at the core's db.models for some ideas. +Here's a simple one: + +.. code-block:: python + + from mediagoblin.db.base import Base + from sqlalchemy import Column, Integer, Unicode, ForeignKey + + class MediaSecurity(Base): + __tablename__ = "yourplugin__media_security" + + # The primary key *and* reference to the main media_entry + media_entry = Column(Integer, ForeignKey('core__media_entries.id'), + primary_key=True) + get_media_entry = relationship("MediaEntry", + backref=backref("security_rating", cascade="all, delete-orphan")) + + rating = Column(Unicode) + + MODELS = [MediaSecurity] + +That's it. + +Some notes: + +* Make sure all your ``__tablename__`` start with your + plugin's name so the tables of various plugins can't + conflict in the database. (Conflicts in python naming are + much easier to fix later). +* Try to get your database design as good as possible in + the first attempt. Changing the database design later, + when people already have data using the old design, is + possible (see next chapter), but it's not easy. + + +Changing the Database Schema Later +================================== + +If your plugin is in use and instances use it to store some +data, changing the database design is a tricky thing. + +1. Make up your mind how the new schema should look like. +2. Change ``models.py`` to contain the new schema. Keep a + copy of the old version around for your personal + reference later. +3. Now make up your mind (possibly using your old and new + ``models.py``) what steps in SQL are needed to convert + the old schema to the new one. + This is called a "migration". +4. Create a file ``migrations.py`` that will contain all + your migrations and add your new migration. + +Take a look at the core's ``db/migrations.py`` for some +good examples on what you might be able to do. Here's a +simple one to add one column: + +.. code-block:: python + + from mediagoblin.db.migration_tools import RegisterMigration, inspect_table + from sqlalchemy import MetaData, Column, Integer + + MIGRATIONS = {} + + @RegisterMigration(1, MIGRATIONS) + def add_license_preference(db): + metadata = MetaData(bind=db.bind) + + security_table = inspect_table(metadata, 'yourplugin__media_security') + + col = Column('security_level', Integer) + col.create(security_table) + db.commit() -- cgit v1.2.3 From f8107ccccc83a7b2aea3adb6f2fe55c45371c080 Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Sun, 27 Jan 2013 22:10:47 +0100 Subject: *docs* intersphinx, exception monitoring --- docs/source/conf.py | 3 +- docs/source/siteadmin/production-deployments.rst | 46 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) (limited to 'docs/source') diff --git a/docs/source/conf.py b/docs/source/conf.py index 8113e247..0b2bccac 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -26,7 +26,8 @@ sys.path.insert(0, os.path.abspath(os.path.join('..', '..'))) # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc'] +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx'] +intersphinx_mapping = {'python': ('http://docs.python.org/2.7', None)} # Add any paths that contain templates here, relative to this directory. templates_path = ['source/_templates'] diff --git a/docs/source/siteadmin/production-deployments.rst b/docs/source/siteadmin/production-deployments.rst index 356fab7f..0ed5ac6a 100644 --- a/docs/source/siteadmin/production-deployments.rst +++ b/docs/source/siteadmin/production-deployments.rst @@ -77,6 +77,52 @@ Modify your existing MediaGoblin and application init scripts, if necessary, to prevent them from starting their own ``celeryd`` processes. +Monitor exceptions +------------------ + +This is an example config using raven_ to report exceptions and +:py:mod:`logging` messages to a sentry_ instance + +.. _raven: http://raven.readthedocs.org/ +.. _sentry: https://github.com/getsentry + +.. code-block:: ini + + [pipeline:main] + pipeline = + errors + raven + routing + + [loggers] + keys = root, sentry + + [handlers] + keys = console, sentry + + [formatters] + keys = generic + + [logger_root] + level = INFO + handlers = console, sentry + + [logger_sentry] + level = WARN + handlers = console + qualname = sentry.errors + propagate = 0 + + [handler_sentry] + class = raven.handlers.logging.SentryHandler + args = ('http://public:secret@example.com/1',) + level = WARNING + formatter = generic + + [filter:raven] + use = egg:raven#raven + dsn = http://71727ea2c69043e4bbcd793bb0115cd4:e9cedccb32d9482d81f99eeca8b1ad30@sentry.talka.tv/3 + .. _init-script: Use an Init Script -- cgit v1.2.3 From 75621003af128969c322d11aff74ec0c425a9ff4 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 30 Jan 2013 13:27:40 -0600 Subject: Added register_template_hooks and get_hook_templates to the plugin api auto module documentation. --- docs/source/pluginwriter/api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/source') diff --git a/docs/source/pluginwriter/api.rst b/docs/source/pluginwriter/api.rst index 206c8b0b..f700e161 100644 --- a/docs/source/pluginwriter/api.rst +++ b/docs/source/pluginwriter/api.rst @@ -20,4 +20,4 @@ Plugin API ----------------------- .. automodule:: mediagoblin.tools.pluginapi - :members: get_config, register_routes, register_template_path + :members: get_config, register_routes, register_template_path, register_template_hooks, get_hook_templates -- cgit v1.2.3 From cf41e7d7444fb9d19a777a4720d9b00684e6fe7b Mon Sep 17 00:00:00 2001 From: Elrond Date: Thu, 31 Jan 2013 20:57:03 +0100 Subject: Improve formatting for hook template docs. --- docs/source/pluginwriter/api.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/source') diff --git a/docs/source/pluginwriter/api.rst b/docs/source/pluginwriter/api.rst index f700e161..42dc3a3d 100644 --- a/docs/source/pluginwriter/api.rst +++ b/docs/source/pluginwriter/api.rst @@ -20,4 +20,5 @@ Plugin API ----------------------- .. automodule:: mediagoblin.tools.pluginapi - :members: get_config, register_routes, register_template_path, register_template_hooks, get_hook_templates + :members: get_config, register_routes, register_template_path, + register_template_hooks, get_hook_templates -- cgit v1.2.3 From 37b48053e9f2da3a6e2378874b025ab152f6f614 Mon Sep 17 00:00:00 2001 From: pythonsnake Date: Sun, 10 Feb 2013 14:07:09 +0100 Subject: Fix bug 461 --- docs/source/siteadmin/deploying.rst | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs/source') diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst index 91406f96..d1300d72 100644 --- a/docs/source/siteadmin/deploying.rst +++ b/docs/source/siteadmin/deploying.rst @@ -282,6 +282,9 @@ this ``nginx.conf`` file should be modeled on the following:: # Change this to update the upload size limit for your users client_max_body_size 8m; + # prevent attacks (someone uploading a .txt file that the browser interprets as an HTML file, etc.) + add_header X-Content-Type-Options nosniff;· + server_name mediagoblin.example.org www.mediagoblin.example.org; access_log /var/log/nginx/mediagoblin.example.access.log; error_log /var/log/nginx/mediagoblin.example.error.log; -- cgit v1.2.3 From a49c741f1141e8b9ff6022ebeddc4ad335fdab8a Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 24 Feb 2013 16:37:39 -0600 Subject: Removing stray character from pythonsnake's doc change and filling comment This commit sponsored by Johannes Knabbe. Thank you! --- docs/source/siteadmin/deploying.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst index d1300d72..9b2324ae 100644 --- a/docs/source/siteadmin/deploying.rst +++ b/docs/source/siteadmin/deploying.rst @@ -282,8 +282,9 @@ this ``nginx.conf`` file should be modeled on the following:: # Change this to update the upload size limit for your users client_max_body_size 8m; - # prevent attacks (someone uploading a .txt file that the browser interprets as an HTML file, etc.) - add_header X-Content-Type-Options nosniff;· + # prevent attacks (someone uploading a .txt file that the browser + # interprets as an HTML file, etc.) + add_header X-Content-Type-Options nosniff; server_name mediagoblin.example.org www.mediagoblin.example.org; access_log /var/log/nginx/mediagoblin.example.access.log; -- cgit v1.2.3 From 35f1f75922a106ec54ddd279e2939b3ce82b9332 Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Sat, 23 Feb 2013 00:06:52 +0100 Subject: Added raven plugin docs to docs --- docs/source/index.rst | 1 + docs/source/plugindocs/raven.rst | 1 + 2 files changed, 2 insertions(+) create mode 100644 docs/source/plugindocs/raven.rst (limited to 'docs/source') diff --git a/docs/source/index.rst b/docs/source/index.rst index abd891a0..9124b1c1 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -58,6 +58,7 @@ Part 2: Core plugin documentation plugindocs/sampleplugin plugindocs/oauth plugindocs/trim_whitespace + plugindocs/raven Part 3: Plugin Writer's Guide diff --git a/docs/source/plugindocs/raven.rst b/docs/source/plugindocs/raven.rst new file mode 100644 index 00000000..ae96f3f8 --- /dev/null +++ b/docs/source/plugindocs/raven.rst @@ -0,0 +1 @@ +.. include:: ../../../mediagoblin/plugins/raven/README.rst -- cgit v1.2.3 From f3f530286ff576a3120e29f734aff0b7b7fe882c Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Sun, 3 Mar 2013 02:32:03 +0100 Subject: Updated raven plugin - Added wrap_wsgi, celery_setup, celery_logging_setup hooks - Updated raven plugin docs - Updated production considerations docs - Added raven logging setup --- docs/source/plugindocs/raven.rst | 1 + docs/source/siteadmin/production-deployments.rst | 47 +++--------------------- 2 files changed, 7 insertions(+), 41 deletions(-) (limited to 'docs/source') diff --git a/docs/source/plugindocs/raven.rst b/docs/source/plugindocs/raven.rst index ae96f3f8..71e284d0 100644 --- a/docs/source/plugindocs/raven.rst +++ b/docs/source/plugindocs/raven.rst @@ -1 +1,2 @@ +.. _raven-setup: Set up the raven plugin .. include:: ../../../mediagoblin/plugins/raven/README.rst diff --git a/docs/source/siteadmin/production-deployments.rst b/docs/source/siteadmin/production-deployments.rst index 0ed5ac6a..3e9431c9 100644 --- a/docs/source/siteadmin/production-deployments.rst +++ b/docs/source/siteadmin/production-deployments.rst @@ -77,51 +77,16 @@ Modify your existing MediaGoblin and application init scripts, if necessary, to prevent them from starting their own ``celeryd`` processes. -Monitor exceptions ------------------- - -This is an example config using raven_ to report exceptions and -:py:mod:`logging` messages to a sentry_ instance - -.. _raven: http://raven.readthedocs.org/ -.. _sentry: https://github.com/getsentry - -.. code-block:: ini - - [pipeline:main] - pipeline = - errors - raven - routing - - [loggers] - keys = root, sentry - - [handlers] - keys = console, sentry - - [formatters] - keys = generic +.. _sentry: - [logger_root] - level = INFO - handlers = console, sentry +Set up sentry to monitor exceptions +----------------------------------- - [logger_sentry] - level = WARN - handlers = console - qualname = sentry.errors - propagate = 0 +We have a plugin for `raven`_ integration, see the ":doc:`/plugindocs/raven`" +documentation. - [handler_sentry] - class = raven.handlers.logging.SentryHandler - args = ('http://public:secret@example.com/1',) - level = WARNING - formatter = generic +.. _`raven`: http://raven.readthedocs.org - [filter:raven] - use = egg:raven#raven - dsn = http://71727ea2c69043e4bbcd793bb0115cd4:e9cedccb32d9482d81f99eeca8b1ad30@sentry.talka.tv/3 .. _init-script: -- cgit v1.2.3 From 43a2f7fe79c78c387804eadf4be9e3e232a1e0df Mon Sep 17 00:00:00 2001 From: Elrond Date: Sat, 9 Mar 2013 14:02:01 +0100 Subject: Revive old "Design Decisions". This brings back the exact version that was removed in 65e7ce634cfecc87ed6f390f9ccf91be513d2eea. --- docs/source/devel/originaldesigndecisions.rst | 329 ++++++++++++++++++++++++++ docs/source/index.rst | 1 + 2 files changed, 330 insertions(+) create mode 100644 docs/source/devel/originaldesigndecisions.rst (limited to 'docs/source') diff --git a/docs/source/devel/originaldesigndecisions.rst b/docs/source/devel/originaldesigndecisions.rst new file mode 100644 index 00000000..afa1e26b --- /dev/null +++ b/docs/source/devel/originaldesigndecisions.rst @@ -0,0 +1,329 @@ +.. _design-decisions-chapter: + +================== + Design Decisions +================== + +.. contents:: Sections + :local: + + +This chapter talks a bit about design decisions. + + +Why GNU MediaGoblin? +==================== + +Chris and Will on "Why GNU MediaGoblin": + + Chris came up with the name MediaGoblin. The name is pretty fun. + It merges the idea that this is a Media hosting project with + Goblin which sort of sounds like gobbling. Here's a piece of + software that gobbles up your media for all to see. + + `According to Wikipedia `_, a + goblin is: + + a legendary evil or mischievous illiterate creature, described + as grotesquely evil or evil-like phantom + + So are we evil? No. Are we mischievous or illiterate? Not + really. So what kind of goblin are we thinking about? We're + thinking about these goblins: + + .. figure:: goblin.png + :alt: Cute goblin with a beret. + + *Figure 1: Cute goblin with a beret. llustrated by Chris + Webber* + + .. figure:: snugglygoblin.png + :scale: 50% + :alt: Snuggly goblin with a beret. + + *Figure 2: Snuggly goblin. Illustrated by Karen Rustad* + + Those are pretty cute goblins. Those are the kinds of goblins + we're thinking about. + + Chris started doing work on the project after thinking about it + for a year. Then, after talking with Matt and Rob, it became an + official GNU project. Thus we now call it GNU MediaGoblin. + + That's a lot of letters, though, so in the interest of brevity and + facilitating easier casual conversation and balancing that with + what's important to us, we have the following rules: + + 1. "GNU MediaGoblin" is the name we're going to use in all official + capacities: web site, documentation, press releases, ... + + 2. In casual conversation, it's ok to use more casual names. + + 3. If you're writing about the project, we ask that you call it GNU + MediaGoblin. + + 4. If you don't like the name, we kindly ask you to take a deep + breath, think a happy thought about cute little goblins playing + on a playground and taking cute pictures of themselves, and let + it go. (Will added this one.) + + +Why Python +========== + +Chris Webber on "Why Python": + + Because I know Python, love Python, am capable of actually making + this thing happen in Python (I've worked on a lot of large free + software web applications before in Python, including `Miro + Community`_, the `Miro Guide`_, a large portion of `Creative + Commons`_, and a whole bunch of things while working at `Imaginary + Landscape`_). Me starting a project like this makes sense if it's + done in Python. + + You might say that PHP is way more deployable, that Rails has way + more cool developers riding around on fixie bikes---and all of + those things are true. But I know Python, like Python, and think + that Python is pretty great. I do think that deployment in Python + is not as good as with PHP, but I think the days of shared hosting + are (thankfully) coming to an end, and will probably be replaced + by cheap virtual machines spun up on the fly for people who want + that sort of stuff, and Python will be a huge part of that future, + maybe even more than PHP will. The deployment tools are getting + better. Maybe we can use something like Silver Lining. Maybe we + can just distribute as ``.debs`` or ``.rpms``. We'll figure it + out when we get there. + + Regardless, if I'm starting this project, which I am, it's gonna + be in Python. + +.. _Miro Community: http://mirocommunity.org/ +.. _Miro Guide: http://miroguide.org/ +.. _Creative Commons: http://creativecommons.org/ +.. _Imaginary Landscape: http://www.imagescape.com/ + + +Why WSGI Minimalism +=================== + +Chris Webber on "Why WSGI Minimalism": + + If you notice in the technology list I list a lot of components + that are very "django-like", but not actually `Django`_ + components. What can I say, I really like a lot of the ideas in + Django! Which leads to the question: why not just use Django? + + While I really like Django's ideas and a lot of its components, I + also feel that most of the best ideas in Django I want have been + implemented as good or even better outside of Django. I could + just use Django and replace the templating system with Jinja2, and + the form system with wtforms, and the database with MongoDB and + MongoKit, but at that point, how much of Django is really left? + + I also am sometimes saddened and irritated by how coupled all of + Django's components are. Loosely coupled yes, but still coupled. + WSGI has done a good job of providing a base layer for running + applications on and if you know how to do it yourself [1]_, it's + not hard or many lines of code at all to bind them together + without any framework at all (not even say `Pylons`_, `Pyramid`_ + or `Flask`_ which I think are still great projects, especially for + people who want this sort of thing but have no idea how to get + started). And even at this already really early stage of writing + MediaGoblin, that glue work is mostly done. + + Not to say I don't think Django isn't great for a lot of things. + For a lot of stuff, it's still the best, but not for MediaGoblin, + I think. + + One thing that Django does super well though is documentation. It + still has some faults, but even with those considered I can hardly + think of any other project in Python that has as nice of + documentation as Django. It may be worth learning some lessons on + documentation from Django [2]_, on that note. + + I'd really like to have a good, thorough hacking-howto and + deployment-howto, especially in the former making some notes on + how to make it easier for Django hackers to get started. + +.. _Django: http://www.djangoproject.com/ +.. _Pylons: http://pylonshq.com/ +.. _Pyramid: http://docs.pylonsproject.org/projects/pyramid/dev/ +.. _Flask: http://flask.pocoo.org/ + +.. [1] http://pythonpaste.org/webob/do-it-yourself.html +.. [2] http://pycon.blip.tv/file/4881071/ + + +Why MongoDB +=========== + +Chris Webber on "Why MongoDB": + + In case you were wondering, I am not a NOSQL fanboy, I do not go + around telling people that MongoDB is web scale. Actually my + choice for MongoDB isn't scalability, though scaling up really + nicely is a pretty good feature and sets us up well in case large + volume sites eventually do use MediaGoblin. But there's another + side of scalability, and that's scaling down, which is important + for federation, maybe even more important than scaling up in an + ideal universe where everyone ran servers out of their own + housing. As a memory-mapped database, MongoDB is pretty hungry, + so actually I spent a lot of time debating whether the inability + to scale down as nicely as something like SQL has with sqlite + meant that it was out. + + But I decided in the end that I really want MongoDB, not for + scalability, but for flexibility. Schema evolution pains in SQL + are almost enough reason for me to want MongoDB, but not quite. + The real reason is because I want the ability to eventually handle + multiple media types through MediaGoblin, and also allow for + plugins, without the rigidity of tables making that difficult. In + other words, something like:: + + {"title": "Me talking until you are bored", + "description": "blah blah blah", + "media_type": "audio", + "media_data": { + "length": "2:30", + "codec": "OGG Vorbis"}, + "plugin_data": { + "licensing": { + "license": "http://creativecommons.org/licenses/by-sa/3.0/"}}} + + + Being able to just dump media-specific information in a media_data + hashtable is pretty great, and even better is having a plugin + system where you can just let plugins have their own entire + key-value space cleanly inside the document that doesn't interfere + with anyone else's stuff. If we were to let plugins to deposit + their own information inside the database, either we'd let plugins + create their own tables which makes SQL migrations even harder + than they already are, or we'd probably end up creating a table + with a column for key, a column for value, and a column for type + in one huge table called "plugin_data" or something similar. (Yo + dawg, I heard you liked plugins, so I put a database in your + database so you can query while you query.) Gross. + + I also don't want things to be too loose so that we forget or lose + the structure of things, and that's one reason why I want to use + MongoKit, because we can cleanly define a much structure as we + want and verify that documents match that structure generally + without adding too much bloat or overhead (MongoKit is a pretty + lightweight wrapper and doesn't inject extra MongoKit-specific + stuff into the database, which is nice and nicer than many other + ORMs in that way). + + +Why Sphinx for documentation +============================ + +Will Kahn-Greene on "Why Sphinx": + + `Sphinx`_ is a fantastic tool for organizing documentation for a + Python-based project that makes it pretty easy to write docs that + are readable in source form and can be "compiled" into HTML, LaTeX + and other formats. + + There are other doc systems out there, but given that GNU + MediaGoblin is being written in Python and I've done a ton of + documentation using Sphinx, it makes sense to use Sphinx for now. + +.. _Sphinx: http://sphinx.pocoo.org/ + + +Why AGPLv3 and CC0? +=================== + +Chris, Brett, Will, Rob, Matt, et al curated into a story where +everyone is the hero by Will on "Why AGPLv3 and CC0": + + The `AGPL v3`_ preserves the freedoms guaranteed by the GPL v3 in + the context of software as a service. Using this license ensures + that users of the service have the ability to examine the source, + deploy their own instance, and implement their own version. This + is really important to us and a core mission component of this + project. Thus we decided that the software parts should be under + this license. + + However, the project is made up of more than just software: + there's CSS, images, and other output-related things. We wanted + the templates/images/css side of the project all permissive and + permissive in the same absolutely permissive way. We're waiving + our copyrights to non-software things under the CC0 waiver. + + That brings us to the templates where there's some code and some + output. The template engine we're using is called Jinja2. It + mixes HTML markup with Python code to render the output of the + software. We decided the templates are part of the output of the + software and not the software itself. We wanted the output of the + software to be licensed in a hassle-free way so that when someone + deploys their own GNU MediaGoblin instance with their own + templates, they don't have to deal with the copyleft aspects of + the AGPLv3 and we'd be fine with that because the changes they're + making are identity-related. So at first we decided to waive our + copyrights to the templates with a CC0 waiver and then add an + exception to the AGPLv3 for the software such that the templates + can make calls into the software and yet be a separately licensed + work. However, Brett brought up the question of whether this + allows some unscrupulous person to make changes to the software + through the templates in such a way that they're not bound by the + AGPLv3: i.e. a loophole. We thought about this loophole and + between this and the extra legalese involved in the exception to + the AGPLv3, we decided that it's just way simpler if the templates + were also licensed under the AGPLv3. + + Then we have the licensing for the documentation. Given that the + documentation is tied to the software content-wise, we don't feel + like we have to worry about ensuring freedom of the documentation + or worry about attribution concerns. Thus we're waiving our + copyrights to the documentation under CC0 as well. + + Lastly, we have branding. This covers logos and other things that + are distinctive to GNU MediaGoblin that we feel represents this + project. Since we don't currently have any branding, this is an + open issue, but we're thinking we'll go with a CC BY-SA license. + + By licensing in this way, we make sure that users of the software + receive the freedoms that the AGPLv3 ensures regardless of what + fate befalls this project. + + So to summarize: + + * software (Python, JavaScript, HTML templates): licensed + under AGPLv3 + * non-software things (CSS, images, video): copyrights waived + under CC0 because this is output of the software + * documentation: copyrights waived under CC0 because it's not part + of the software + * branding assets: we're kicking this can down the road, but + probably CC BY-SA + + This is all codified in the ``COPYING`` file. + +.. _AGPL v3: http://www.gnu.org/licenses/agpl.html +.. _CC0 v1: http://creativecommons.org/publicdomain/zero/1.0/ + + +Why (non-mandatory) copyright assignment? +========================================= + +Chris Webber on "Why copyright assignment?": + + GNU MediaGoblin is a GNU project with non-mandatory but heavily + encouraged copyright assignment to the FSF. Most, if not all, of + the core contributors to GNU MediaGoblin will have done a + copyright assignment, but unlike some other GNU projects, it isn't + required here. We think this is the best choice for GNU + MediaGoblin: it ensures that the Free Software Foundation may + protect the software by enforcing the AGPL if the FSF sees fit, + but it also means that we can immediately merge in changes from a + new contributor. It also means that some significant non-FSF + contributors might also be able to enforce the AGPL if seen fit. + + Again, assignment is not mandatory, but it is heavily encouraged, + even incentivized: significant contributors who do a copyright + assignment to the FSF are eligible to have a unique goblin drawing + produced for them by the project's main founder, Christopher Allan + Webber. See :ref:`contributing-howto-chapter` for details. + + diff --git a/docs/source/index.rst b/docs/source/index.rst index 9124b1c1..0ddacb71 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -84,6 +84,7 @@ This chapter contains various information for developers. :maxdepth: 1 devel/codebase + devel/originaldesigndecisions Indices and tables -- cgit v1.2.3 From ed6a0bcd42afa7b1aa42753ba9e9fc090b83eba8 Mon Sep 17 00:00:00 2001 From: Elrond Date: Sat, 9 Mar 2013 14:51:01 +0100 Subject: Change the _original_ design decisions. - Rename the chapter to "Original *". - Fix links. --- docs/source/devel/originaldesigndecisions.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'docs/source') diff --git a/docs/source/devel/originaldesigndecisions.rst b/docs/source/devel/originaldesigndecisions.rst index afa1e26b..7e5278ec 100644 --- a/docs/source/devel/originaldesigndecisions.rst +++ b/docs/source/devel/originaldesigndecisions.rst @@ -1,8 +1,8 @@ -.. _design-decisions-chapter: +.. _original-design-decisions-chapter: -================== - Design Decisions -================== +=========================== + Original Design Decisions +=========================== .. contents:: Sections :local: @@ -31,13 +31,13 @@ Chris and Will on "Why GNU MediaGoblin": really. So what kind of goblin are we thinking about? We're thinking about these goblins: - .. figure:: goblin.png + .. figure:: ../_static/goblin.png :alt: Cute goblin with a beret. *Figure 1: Cute goblin with a beret. llustrated by Chris Webber* - .. figure:: snugglygoblin.png + .. figure:: ../_static/snugglygoblin.png :scale: 50% :alt: Snuggly goblin with a beret. @@ -324,6 +324,6 @@ Chris Webber on "Why copyright assignment?": even incentivized: significant contributors who do a copyright assignment to the FSF are eligible to have a unique goblin drawing produced for them by the project's main founder, Christopher Allan - Webber. See :ref:`contributing-howto-chapter` for details. + Webber. See `the wiki `_ for details. -- cgit v1.2.3 From 8da84493328a029649e146b8e6fcc95011783b8b Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sat, 9 Mar 2013 12:18:36 -0600 Subject: tyop fix in docs, lazyserer.sh->lazyserver.sh This commit sponsored by S J Bennett. Thanks! --- docs/source/siteadmin/production-deployments.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/production-deployments.rst b/docs/source/siteadmin/production-deployments.rst index 3e9431c9..1a32d95e 100644 --- a/docs/source/siteadmin/production-deployments.rst +++ b/docs/source/siteadmin/production-deployments.rst @@ -52,7 +52,7 @@ as the basis for your script: :: Separate Celery --------------- -While the ``./lazyserer.sh`` configuration provides an efficient way to +While the ``./lazyserver.sh`` configuration provides an efficient way to start using a MediaGoblin instance, it is not suitable for production deployments for several reasons: -- cgit v1.2.3 From 6e2dcbffaf1ed0a8d83a7998796c5faf8980afd3 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 11 Mar 2013 12:34:02 -0500 Subject: 0.3.3 release notes --- docs/source/siteadmin/relnotes.rst | 59 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst index 7d480d90..455e7397 100644 --- a/docs/source/siteadmin/relnotes.rst +++ b/docs/source/siteadmin/relnotes.rst @@ -19,17 +19,72 @@ This chapter has important information for releases in it. If you're upgrading from a previous release, please read it carefully, or at least skim over it. -WIP +0.3.3 ===== +**Do this to upgrade** + +1. Make sure to run ``bin/gmg dbupdate`` after upgrading. +2. OpenStreetMap is now a plugin, so if you want to use it, add the + following to your config file:: + + [plugins] + [[mediagoblin.plugins.geolocation]] + +If you have your own theme, you may need to make some adjustments to +it as some theme related things may have changed in this releae. If +you run into problems, don't hesitate to join #mediagoblin on +irc.freenode.net and we'll try to help. + **New features** +* New dropdown menu for accessing various features. + +* Significantly improved URL generation. Now mediagoblin won't give + up on making a slug if it looks like there will be a duplicate; + it'll try extra hard to generate a meaningful one instead. + + Similarly, linking to an id no longer can possibly conflict with + linking to a slug; /u/username/m/id:35/ is the kind of reference we + now use to linking to entries with ids. However, old links with + entries that linked to ids should work just fine with our migration. + The only urls that might break in this release are ones using colons + or equal signs. + +* New template hooks for plugin authoring. + +* As a demonstration of new template hooks for plugin authoring, + openstreetmap support now moved to a plugin! + +* Method to add icon to collections switched from icon of paperclip to + button with "add to collection" text. + +* Bug where videos often failed to produce a proper thumbnail fixed! + +* Copying around files in mediagoblin now much more efficient, doesn't + waste gobs of memory. + +* Video transcoding now optional for videos that meet certain + criteria. By default, MediaGoblin will now now transcode webm + videos that are smaller in resolution than the mediagoblin defaults, + and mediagoblin can also be configured to allow theora files to not + be transcoded as well. + +* Per-user license preference option; always want your uploads to be + BY-SA and tired of changing that field? You can now set your + license preference in your user settings. + +* Video player now responsive; better for mobile! + **Other changed** * Plugin writers: Internal restructuring led to mediagoblin.db.sql* be mediagoblin.db.* starting from 0.3.3 -* Dependency list has been reduced not requireing the "webob" package anymore. +* Dependency list has been reduced not requiring the "webob" package anymore. + +* And many small fixes/improvements, too numerous to list! + 0.3.2 ===== -- cgit v1.2.3 From a28c6c4c48cf525621d90879449908cd7fe18169 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 11 Mar 2013 13:35:59 -0500 Subject: Minor release note changes, as suggested by Elrond. This commit sponsored by Martin Ansdell-Smith. Thanks! --- docs/source/siteadmin/relnotes.rst | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst index 455e7397..21067e75 100644 --- a/docs/source/siteadmin/relnotes.rst +++ b/docs/source/siteadmin/relnotes.rst @@ -32,9 +32,10 @@ carefully, or at least skim over it. [[mediagoblin.plugins.geolocation]] If you have your own theme, you may need to make some adjustments to -it as some theme related things may have changed in this releae. If -you run into problems, don't hesitate to join #mediagoblin on -irc.freenode.net and we'll try to help. +it as some theme related things may have changed in this release. If +you run into problems, don't hesitate to +`contact us `_ +(IRC is often best). **New features** @@ -56,8 +57,8 @@ irc.freenode.net and we'll try to help. * As a demonstration of new template hooks for plugin authoring, openstreetmap support now moved to a plugin! -* Method to add icon to collections switched from icon of paperclip to - button with "add to collection" text. +* Method to add media to collections switched from icon of paperclip + to button with "add to collection" text. * Bug where videos often failed to produce a proper thumbnail fixed! @@ -65,10 +66,10 @@ irc.freenode.net and we'll try to help. waste gobs of memory. * Video transcoding now optional for videos that meet certain - criteria. By default, MediaGoblin will now now transcode webm - videos that are smaller in resolution than the mediagoblin defaults, - and mediagoblin can also be configured to allow theora files to not - be transcoded as well. + criteria. By default, MediaGoblin will now transcode webm videos + that are smaller in resolution than the mediagoblin defaults, and + mediagoblin can also be configured to allow theora files to not be + transcoded as well. * Per-user license preference option; always want your uploads to be BY-SA and tired of changing that field? You can now set your @@ -76,7 +77,7 @@ irc.freenode.net and we'll try to help. * Video player now responsive; better for mobile! -**Other changed** +**Other changes** * Plugin writers: Internal restructuring led to mediagoblin.db.sql* be mediagoblin.db.* starting from 0.3.3 -- cgit v1.2.3 From 70177c1febb9485a02ca46a36d95eff45c14e599 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 11 Mar 2013 15:18:24 -0500 Subject: You can also DELETE accounts now --- docs/source/siteadmin/relnotes.rst | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs/source') diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst index 21067e75..5931a467 100644 --- a/docs/source/siteadmin/relnotes.rst +++ b/docs/source/siteadmin/relnotes.rst @@ -77,6 +77,9 @@ you run into problems, don't hesitate to * Video player now responsive; better for mobile! +* You can now delete your account from the user preferences page if + you so wish. + **Other changes** * Plugin writers: Internal restructuring led to mediagoblin.db.sql* be -- cgit v1.2.3 From fda5ea7aaa6b3879a681f5f1b2da2fe41c6e315c Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Tue, 12 Mar 2013 11:49:39 -0500 Subject: "will now" -> "will not" tyop caught by AVRS... fixed, thanks! --- docs/source/siteadmin/relnotes.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst index 5931a467..84ec09b5 100644 --- a/docs/source/siteadmin/relnotes.rst +++ b/docs/source/siteadmin/relnotes.rst @@ -62,13 +62,13 @@ you run into problems, don't hesitate to * Bug where videos often failed to produce a proper thumbnail fixed! -* Copying around files in mediagoblin now much more efficient, doesn't +* Copying around files in MediaGoblin now much more efficient, doesn't waste gobs of memory. * Video transcoding now optional for videos that meet certain - criteria. By default, MediaGoblin will now transcode webm videos - that are smaller in resolution than the mediagoblin defaults, and - mediagoblin can also be configured to allow theora files to not be + criteria. By default, MediaGoblin will not transcode webm videos + that are smaller in resolution than the MediaGoblin defaults, and + MediaGoblin can also be configured to allow theora files to not be transcoded as well. * Per-user license preference option; always want your uploads to be -- cgit v1.2.3 From 340100ee997756e5b84a2b3f7615b1682e07bbb5 Mon Sep 17 00:00:00 2001 From: Elrond Date: Sun, 10 Mar 2013 22:33:28 +0100 Subject: Start a storage section. With the workbench stuff in it. --- docs/source/devel/storage.rst | 43 +++++++++++++++++++++++++++++++++++++++++++ docs/source/index.rst | 1 + 2 files changed, 44 insertions(+) create mode 100644 docs/source/devel/storage.rst (limited to 'docs/source') diff --git a/docs/source/devel/storage.rst b/docs/source/devel/storage.rst new file mode 100644 index 00000000..52406c4e --- /dev/null +++ b/docs/source/devel/storage.rst @@ -0,0 +1,43 @@ +========= + Storage +========= + + +See for now: http://wiki.mediagoblin.org/Storage + +Things get moved here. + + +The storage systems attached to your app +---------------------------------------- + +Dynamic content: queue_store and public_store +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The workbench +~~~~~~~~~~~~~ + +In addition, there's a "workbench" used during +processing... it's just for temporary files during +processing, and also for making local copies of stuff that +might be on remote storage interfaces while transitionally +moving/converting from the queue_store to the public store. +See the workbench module documentation for more. + +.. automodule:: mediagoblin.tools.workbench + :members: + :show-inheritance: + + +Static assets / staticdirect +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +StorageInterface and implementations +------------------------------------ + +The guts of StorageInterface and friends +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Writing code to store stuff +~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/source/index.rst b/docs/source/index.rst index 0ddacb71..7f692d57 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -84,6 +84,7 @@ This chapter contains various information for developers. :maxdepth: 1 devel/codebase + devel/storage devel/originaldesigndecisions -- cgit v1.2.3 From f6097b2eac3d436cefd3e17992fa0b448672214a Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 17 Mar 2013 13:53:45 -0500 Subject: Clarification on some original design decisions things. --- docs/source/devel/originaldesigndecisions.rst | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs/source') diff --git a/docs/source/devel/originaldesigndecisions.rst b/docs/source/devel/originaldesigndecisions.rst index 7e5278ec..2843870c 100644 --- a/docs/source/devel/originaldesigndecisions.rst +++ b/docs/source/devel/originaldesigndecisions.rst @@ -10,6 +10,10 @@ This chapter talks a bit about design decisions. +Note: This is an outdated document. It's more or less the historical +reasons for a lot of things. That doesn't mean these decisions have +stayed the same or we haven't changed our minds on some things! + Why GNU MediaGoblin? ==================== @@ -157,6 +161,9 @@ Chris Webber on "Why WSGI Minimalism": Why MongoDB =========== +(Note: We don't use MongoDB anymore. This is the original rationale, +however.) + Chris Webber on "Why MongoDB": In case you were wondering, I am not a NOSQL fanboy, I do not go -- cgit v1.2.3 From 6b92dca59d450004d65b4dfb7a81685f8b10ea10 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 17 Mar 2013 14:16:19 -0500 Subject: Better description of the structure of the application --- docs/source/devel/codebase.rst | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) (limited to 'docs/source') diff --git a/docs/source/devel/codebase.rst b/docs/source/devel/codebase.rst index 73e938e7..5e8cbcc6 100644 --- a/docs/source/devel/codebase.rst +++ b/docs/source/devel/codebase.rst @@ -117,13 +117,27 @@ tree:: mediagoblin/ |- mediagoblin/ # source code - | |- tests/ - | |- templates/ - | |- auth/ - | \- submit/ + | |- db/ # database setup + | |- tools/ # various utilities + | |- init/ # "initialization" tools (arguably should be in tools/) + | |- tests/ # unit tests + | |- templates/ # templates for this application + | |- media_types/ # code for processing, displaying different media + | |- storage/ # different storage backends + | |- gmg_commands/ # command line tools (./bin/gmg) + | |- themes/ # pre-bundled themes + | | + | | # ... some submodules here as well for different sections + | | # of the application... here's just a few + | |- auth/ # authentication (login/registration) code + | |- user_dev/ # user pages (under /u/), including media pages + | \- submit/ # submitting media for processing + | |- docs/ # documentation |- devtools/ # some scripts for developer convenience | + |- user_dev/ # local instance sessions, media, etc + | | # the below directories are installed into your virtualenv checkout | |- bin/ # scripts @@ -131,8 +145,7 @@ tree:: |- lib/ # python libraries installed into your virtualenv |- include/ |- mediagoblin.egg-info/ - |- parts/ - |- user_dev/ # sessions, etc + \- parts/ As you can see, all the code for GNU MediaGoblin is in the @@ -142,8 +155,7 @@ Here are some interesting files and what they do: :routing.py: maps url paths to views :views.py: views handle http requests -:models.py: holds the sqlalchemy schemas---these are the data structures - we're working with +:forms.py: wtforms stuff for this submodule You'll notice that there are several sub-directories: tests, templates, auth, submit, ... @@ -154,5 +166,14 @@ templates, auth, submit, ... ``auth`` and ``submit`` are modules that enacpsulate authentication and media item submission. If you look in these directories, you'll -see they have their own ``routing.py``, ``view.py``, and -``models.py`` in addition to some other code. +see they have their own ``routing.py``, ``view.py``, and forms.py in +addition to some other code. + +You'll also notice that mediagoblin/db/ contains quite a few things, +including the following: + +:models.py: This is where the database is set up +:mixin.py: Certain functions appended to models from here +:migrations.py: When creating a new migration (a change to the + database structure), we put it here + -- cgit v1.2.3 From d40bce85945ab242caa62c1e269f477a6f4ca8b9 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 18 Mar 2013 08:50:29 -0500 Subject: Point to the Hacking HOWTO --- docs/source/devel/codebase.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'docs/source') diff --git a/docs/source/devel/codebase.rst b/docs/source/devel/codebase.rst index 5e8cbcc6..98e0c26e 100644 --- a/docs/source/devel/codebase.rst +++ b/docs/source/devel/codebase.rst @@ -34,7 +34,11 @@ various recipes for getting things done. for where we hang out. For more information on how to get started hacking on GNU MediaGoblin, -see `the wiki `_. +see `the wiki `_, and specifically, go +through the +`Hacking HOWTO `_ +which explains generally how to get going with running an instance for +development. Software Stack -- cgit v1.2.3 From 997ef976699b8d10908ee908cb62b9587d023f92 Mon Sep 17 00:00:00 2001 From: Elrond Date: Tue, 19 Mar 2013 18:52:14 +0100 Subject: Improve release notes formatting. The geolocation ini sample needed more indenting and got a nice "code-block:: ini". --- docs/source/siteadmin/relnotes.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst index 84ec09b5..6962dc5a 100644 --- a/docs/source/siteadmin/relnotes.rst +++ b/docs/source/siteadmin/relnotes.rst @@ -26,10 +26,12 @@ carefully, or at least skim over it. 1. Make sure to run ``bin/gmg dbupdate`` after upgrading. 2. OpenStreetMap is now a plugin, so if you want to use it, add the - following to your config file:: + following to your config file: - [plugins] - [[mediagoblin.plugins.geolocation]] + .. code-block:: ini + + [plugins] + [[mediagoblin.plugins.geolocation]] If you have your own theme, you may need to make some adjustments to it as some theme related things may have changed in this release. If -- cgit v1.2.3 From 9430b957e43575df73fec2054079cfef2ef589f4 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Thu, 21 Mar 2013 10:08:09 -0500 Subject: Move description of software stack below description of "What's where" --- docs/source/devel/codebase.rst | 140 ++++++++++++++++++++--------------------- 1 file changed, 70 insertions(+), 70 deletions(-) (limited to 'docs/source') diff --git a/docs/source/devel/codebase.rst b/docs/source/devel/codebase.rst index 98e0c26e..cd46242c 100644 --- a/docs/source/devel/codebase.rst +++ b/docs/source/devel/codebase.rst @@ -41,6 +41,76 @@ which explains generally how to get going with running an instance for development. +What's where +============ + +After you've run checked out mediagoblin and followed the virtualenv +instantiation instructions, you're faced with the following directory +tree:: + + mediagoblin/ + |- mediagoblin/ # source code + | |- db/ # database setup + | |- tools/ # various utilities + | |- init/ # "initialization" tools (arguably should be in tools/) + | |- tests/ # unit tests + | |- templates/ # templates for this application + | |- media_types/ # code for processing, displaying different media + | |- storage/ # different storage backends + | |- gmg_commands/ # command line tools (./bin/gmg) + | |- themes/ # pre-bundled themes + | | + | | # ... some submodules here as well for different sections + | | # of the application... here's just a few + | |- auth/ # authentication (login/registration) code + | |- user_dev/ # user pages (under /u/), including media pages + | \- submit/ # submitting media for processing + | + |- docs/ # documentation + |- devtools/ # some scripts for developer convenience + | + |- user_dev/ # local instance sessions, media, etc + | + | # the below directories are installed into your virtualenv checkout + | + |- bin/ # scripts + |- develop-eggs/ + |- lib/ # python libraries installed into your virtualenv + |- include/ + |- mediagoblin.egg-info/ + \- parts/ + + +As you can see, all the code for GNU MediaGoblin is in the +``mediagoblin`` directory. + +Here are some interesting files and what they do: + +:routing.py: maps url paths to views +:views.py: views handle http requests +:forms.py: wtforms stuff for this submodule + +You'll notice that there are several sub-directories: tests, +templates, auth, submit, ... + +``tests`` holds the unit test code. + +``templates`` holds all the templates for the output. + +``auth`` and ``submit`` are modules that enacpsulate authentication +and media item submission. If you look in these directories, you'll +see they have their own ``routing.py``, ``view.py``, and forms.py in +addition to some other code. + +You'll also notice that mediagoblin/db/ contains quite a few things, +including the following: + +:models.py: This is where the database is set up +:mixin.py: Certain functions appended to models from here +:migrations.py: When creating a new migration (a change to the + database structure), we put it here + + Software Stack ============== @@ -111,73 +181,3 @@ Software Stack * `JQuery `_: for groovy JavaScript things - -What's where -============ - -After you've run checked out mediagoblin and followed the virtualenv -instantiation instructions, you're faced with the following directory -tree:: - - mediagoblin/ - |- mediagoblin/ # source code - | |- db/ # database setup - | |- tools/ # various utilities - | |- init/ # "initialization" tools (arguably should be in tools/) - | |- tests/ # unit tests - | |- templates/ # templates for this application - | |- media_types/ # code for processing, displaying different media - | |- storage/ # different storage backends - | |- gmg_commands/ # command line tools (./bin/gmg) - | |- themes/ # pre-bundled themes - | | - | | # ... some submodules here as well for different sections - | | # of the application... here's just a few - | |- auth/ # authentication (login/registration) code - | |- user_dev/ # user pages (under /u/), including media pages - | \- submit/ # submitting media for processing - | - |- docs/ # documentation - |- devtools/ # some scripts for developer convenience - | - |- user_dev/ # local instance sessions, media, etc - | - | # the below directories are installed into your virtualenv checkout - | - |- bin/ # scripts - |- develop-eggs/ - |- lib/ # python libraries installed into your virtualenv - |- include/ - |- mediagoblin.egg-info/ - \- parts/ - - -As you can see, all the code for GNU MediaGoblin is in the -``mediagoblin`` directory. - -Here are some interesting files and what they do: - -:routing.py: maps url paths to views -:views.py: views handle http requests -:forms.py: wtforms stuff for this submodule - -You'll notice that there are several sub-directories: tests, -templates, auth, submit, ... - -``tests`` holds the unit test code. - -``templates`` holds all the templates for the output. - -``auth`` and ``submit`` are modules that enacpsulate authentication -and media item submission. If you look in these directories, you'll -see they have their own ``routing.py``, ``view.py``, and forms.py in -addition to some other code. - -You'll also notice that mediagoblin/db/ contains quite a few things, -including the following: - -:models.py: This is where the database is set up -:mixin.py: Certain functions appended to models from here -:migrations.py: When creating a new migration (a change to the - database structure), we put it here - -- cgit v1.2.3 From 82a40cc4e145e4fdf5f81d7b6319cf713afa44c1 Mon Sep 17 00:00:00 2001 From: Elrond Date: Tue, 9 Apr 2013 22:39:04 +0200 Subject: Remove the last traces of beaker. There were still some traces of beaker around: - docs: replaced by reference to itsdangerous. - paste configs: Wiped away. - config_spec.ini: wiped. - test_mgoblin_app.ini: also wiped. --- docs/source/devel/codebase.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/source') diff --git a/docs/source/devel/codebase.rst b/docs/source/devel/codebase.rst index cd46242c..9718a097 100644 --- a/docs/source/devel/codebase.rst +++ b/docs/source/devel/codebase.rst @@ -142,8 +142,8 @@ Software Stack * `werkzeug `_: nice abstraction layer from HTTP requests, responses and WSGI bits - * `Beaker `_: for handling sessions and - caching + * `itsdangerous `_: + for handling sessions * `Jinja2 `_: the templating engine -- cgit v1.2.3 From 71ef20078cc061317eaf42f20bdc905bcce3ab2a Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 10 Apr 2013 10:52:39 -0500 Subject: Adding some help about what to do if flup flakes out on you --- docs/source/siteadmin/deploying.rst | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs/source') diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst index 9b2324ae..77e60037 100644 --- a/docs/source/siteadmin/deploying.rst +++ b/docs/source/siteadmin/deploying.rst @@ -185,6 +185,11 @@ flup:: ./bin/easy_install flup +(Sometimes this breaks because flup's site is flakey. If it does for +you, try):: + + ./bin/easy_install https://pypi.python.org/pypi/flup/1.0.3.dev-20110405 + This concludes the initial configuration of the development environment. In the future, when you update your codebase, you should also run:: -- cgit v1.2.3 From 36748921c27deb3f8c9d88f9b7a3c368a427d418 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Thu, 11 Apr 2013 16:57:11 -0500 Subject: adding callable_runone and callable_runall to the docs --- docs/source/pluginwriter/api.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/source') diff --git a/docs/source/pluginwriter/api.rst b/docs/source/pluginwriter/api.rst index 42dc3a3d..44ffd6e8 100644 --- a/docs/source/pluginwriter/api.rst +++ b/docs/source/pluginwriter/api.rst @@ -21,4 +21,5 @@ Plugin API .. automodule:: mediagoblin.tools.pluginapi :members: get_config, register_routes, register_template_path, - register_template_hooks, get_hook_templates + register_template_hooks, get_hook_templates, + callable_runone, callable_runall -- cgit v1.2.3 From a80ebf3b64dce807d84ab3993984c211f55b47db Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Wed, 27 Mar 2013 12:21:10 +0200 Subject: add pdf media type The new media type supports pdf and a subset of media recognized by libreoffice via unoconv. Every document added goes through: * conversion to pdf with unoconv if not already a pdf * creation of thumbnail and medium sized image, and pdfinfo generates some information (even for unoconv produces docs - should fix this) Poppler (pdftocairo, pdfinfo) is used. http://poppler.freedesktop.org/ A working but uglified pdf.js integration exists, which is enabled by setting pdf.pdf_js=true mediagoblin_local.ini (disabled in mediagoblin.ini) Adds one test to the test_submission test suite, and another separate test_pdf suite. The tests are only run if media_types.pdf.processing.check_prerequisites passes, so the test suite will not require any extra package. TODO: make test suite say 'skipped' in that case instead of just 'ok' Signed-off-by: Alon Levy --- docs/source/siteadmin/media-types.rst | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'docs/source') diff --git a/docs/source/siteadmin/media-types.rst b/docs/source/siteadmin/media-types.rst index 23d3f3b9..264dc4fc 100644 --- a/docs/source/siteadmin/media-types.rst +++ b/docs/source/siteadmin/media-types.rst @@ -195,3 +195,40 @@ Run You should now be able to upload .obj and .stl files and MediaGoblin will be able to present them to your wide audience of admirers! + +PDF and Document +================ + +To enable the "PDF and Document" support plugin, you need pdftocairo, pdfinfo, +unoconv with headless support. All executables must be on your execution path. + +To install this on Fedora: + +.. code-block:: bash + + sudo yum install -y ppoppler-utils unoconv libreoffice-headless + +pdf.js relies on git submodules, so be sure you have fetched them: + +.. code-block:: bash + + git submodule init + git submodule update + +This feature has been tested on Fedora with: + poppler-utils-0.20.2-9.fc18.x86_64 + unoconv-0.5-2.fc18.noarch + libreoffice-headless-3.6.5.2-8.fc18.x86_64 + +It may work on some earlier versions, but that is not guaranteed. + +Add ``mediagoblin.media_types.pdf`` to the ``media_types`` list in your +``mediagoblin_local.ini`` and restart MediaGoblin. + +Run + +.. code-block:: bash + + ./bin/gmg dbupdate + + -- cgit v1.2.3 From a2d94b0cca36e5e1442dc26f005afb57f2efb7a1 Mon Sep 17 00:00:00 2001 From: nattily pigeonfowl Date: Tue, 16 Apr 2013 15:34:40 -0400 Subject: Transfered information from http://wiki.mediagoblin.org/Storage into docs/source/devel/storage For info check out ticket: issues.mediagoblin.org/ticket/660 --- docs/source/devel/storage.rst | 85 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 79 insertions(+), 6 deletions(-) (limited to 'docs/source') diff --git a/docs/source/devel/storage.rst b/docs/source/devel/storage.rst index 52406c4e..ce89db09 100644 --- a/docs/source/devel/storage.rst +++ b/docs/source/devel/storage.rst @@ -2,18 +2,19 @@ Storage ========= - -See for now: http://wiki.mediagoblin.org/Storage - -Things get moved here. - - The storage systems attached to your app ---------------------------------------- Dynamic content: queue_store and public_store ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Two instances of the StorageInterface come attached to your app. These +are: + ++ **queue_store:** When a user submits a fresh piece of media for their gallery, before the Processing stage, that piece of media sits here in the queue_store. (It's possible that we'll rename this to "private_store" and start storing more non-publicly-stored stuff in the future...). This is a StorageInterface implementation instance. Visitors to your site probably cannot see it... it isn't designed to be seen, anyway. + ++ **public_store:** After your media goes through processing it gets moved to the public store. This is also a StorageInterface implelementation, and is for stuff that's intended to be seen by site visitors. + The workbench ~~~~~~~~~~~~~ @@ -32,6 +33,28 @@ See the workbench module documentation for more. Static assets / staticdirect ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +On top of all that, there is some static media that comes bundled with your +application. This stuff is kept in: + + mediagoblin/static/ + +These files are for mediagoblin base assets. Things like the CSS files, +logos, etc. You can mount these at whatever location is appropriate to you +(see the direct_remote_path option in the config file) so if your users +are keeping their static assets at http://static.mgoblin.example.org/ but +their actual site is at http://mgoblin.example.org/, you need to be able +to get your static files in a where-it's-mounted agnostic way. There's a +"staticdirector" attached to the request object. It's pretty easy to use; +just look at this bit taken from the +mediagoblin/templates/mediagoblin/base.html main template: + + + +see? Not too hard. As expected, if you configured direct_remote_path to be +http://static.mgoblin.example.org/ you'll get back +http://static.mgoblin.example.org/css/extlib/text.css just as you'd +probably expect. StorageInterface and implementations ------------------------------------ @@ -39,5 +62,55 @@ StorageInterface and implementations The guts of StorageInterface and friends ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +So, the StorageInterface! + +So, the public and queue stores both use StorageInterface implementations +... but what does that mean? It's not too hard. + +Open up: + + mediagoblin/storage.py + +In here you'll see a couple of things. First of all, there's the +StorageInterface class. What you'll see is that this is just a very simple +python class. A few of the methods actually implement things, but for the +most part, they don't. What really matters about this class is the +docstrings. Each expected method is documented as to how it should be +constructed. Want to make a new StorageInterface? Simply subclass it. Want +to know how to use the methods of your storage system? Read these docs, +they span all implementations. + +There are a couple of implementations of these classes bundled in +storage.py as well. The most simple of these is BasicFileStorage, which is +also the default storage system used. As expected, this stores files +locally on your machine. + +There's also a CloudFileStorage system. This provides a mapping to +[OpenStack's swift http://swift.openstack.org/] storage system (used by +RackSpace Cloud files and etc). + +Between these two examples you should be able to get a pretty good idea of +how to write your own storage systems, for storing data across your +beowulf cluster of radioactive monkey brains, whatever. + Writing code to store stuff ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +So what does coding for StorageInterface implementations actually look +like? It's pretty simple, really. For one thing, the design is fairly +inspired by [Django's file storage API +https://docs.djangoproject.com/en/dev/ref/files/storage/]... with some +differences. + +Basically, you access files on "file paths", which aren't exactly like +unix file paths, but are close. If you wanted to store a file on a path +like dir1/dir2/filename.jpg you'd actually write that file path like: + +['dir1', 'dir2', 'filename.jpg'] + +This way we can be *sure* that each component is actually a component of +the path that's expected... we do some filename cleaning on each component. + +Your StorageInterface should pass in and out "file like objects". In other +words, they should provide .read() and .write() at minimum, and probably +also .seek() and .close(). -- cgit v1.2.3 From 827f91e603bf706e628e8d2d625d49d79c62e721 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Wed, 17 Apr 2013 11:23:37 +0300 Subject: update documentation for s/nose/py.test/ Signed-off-by: Alon Levy --- docs/source/devel/codebase.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/source') diff --git a/docs/source/devel/codebase.rst b/docs/source/devel/codebase.rst index 9718a097..122a3297 100644 --- a/docs/source/devel/codebase.rst +++ b/docs/source/devel/codebase.rst @@ -119,7 +119,7 @@ Software Stack * `Python `_: the language we're using to write this - * `Nose `_: + * `Py.Test `_: for unit tests * `virtualenv `_: for setting up an -- cgit v1.2.3 From 3606316e9d7cac12ccf9411fb63c60bb1b775eb9 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 17 Apr 2013 07:41:00 -0500 Subject: ppoppler -> poppler tyop fix --- docs/source/siteadmin/media-types.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/media-types.rst b/docs/source/siteadmin/media-types.rst index 264dc4fc..210094b9 100644 --- a/docs/source/siteadmin/media-types.rst +++ b/docs/source/siteadmin/media-types.rst @@ -206,7 +206,7 @@ To install this on Fedora: .. code-block:: bash - sudo yum install -y ppoppler-utils unoconv libreoffice-headless + sudo yum install -y poppler-utils unoconv libreoffice-headless pdf.js relies on git submodules, so be sure you have fetched them: -- cgit v1.2.3 From 4d0191dcb8b43f82bfacc77ed8c92d0d3c573d8a Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Fri, 19 Apr 2013 13:22:03 -0500 Subject: A warning about the plugin API being unstable. --- docs/source/pluginwriter/api.rst | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'docs/source') diff --git a/docs/source/pluginwriter/api.rst b/docs/source/pluginwriter/api.rst index 44ffd6e8..85870d28 100644 --- a/docs/source/pluginwriter/api.rst +++ b/docs/source/pluginwriter/api.rst @@ -16,6 +16,15 @@ Plugin API ========== +This documents the general plugin API. + +Please note, at this point OUR PLUGIN HOOKS MAY AND WILL CHANGE. +Authors are encouraged to develop plugins and work with the +MediaGoblin community to keep them up to date, but this API will be a +moving target for a few releases. + +Please check the release notes for updates! + :mod:`pluginapi` Module ----------------------- -- cgit v1.2.3 From 51d5d3aa20b5f2d7dbe9c88e7d8c21db7ea172d1 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Fri, 19 Apr 2013 16:29:03 -0500 Subject: changing the things to document in api.rst --- docs/source/pluginwriter/api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/source') diff --git a/docs/source/pluginwriter/api.rst b/docs/source/pluginwriter/api.rst index 85870d28..3a75d455 100644 --- a/docs/source/pluginwriter/api.rst +++ b/docs/source/pluginwriter/api.rst @@ -31,4 +31,4 @@ Please check the release notes for updates! .. automodule:: mediagoblin.tools.pluginapi :members: get_config, register_routes, register_template_path, register_template_hooks, get_hook_templates, - callable_runone, callable_runall + hook_handle, hook_runall, hook_transform, -- cgit v1.2.3 From 90e7fc673878d4eb68db41ae49c47fb543a35a87 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Fri, 26 Apr 2013 16:13:05 -0500 Subject: word-wrapping the public/queue storage explainations in storage.rst --- docs/source/devel/storage.rst | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'docs/source') diff --git a/docs/source/devel/storage.rst b/docs/source/devel/storage.rst index ce89db09..215f9579 100644 --- a/docs/source/devel/storage.rst +++ b/docs/source/devel/storage.rst @@ -11,9 +11,18 @@ Dynamic content: queue_store and public_store Two instances of the StorageInterface come attached to your app. These are: -+ **queue_store:** When a user submits a fresh piece of media for their gallery, before the Processing stage, that piece of media sits here in the queue_store. (It's possible that we'll rename this to "private_store" and start storing more non-publicly-stored stuff in the future...). This is a StorageInterface implementation instance. Visitors to your site probably cannot see it... it isn't designed to be seen, anyway. - -+ **public_store:** After your media goes through processing it gets moved to the public store. This is also a StorageInterface implelementation, and is for stuff that's intended to be seen by site visitors. ++ **queue_store:** When a user submits a fresh piece of media for + their gallery, before the Processing stage, that piece of media sits + here in the queue_store. (It's possible that we'll rename this to + "private_store" and start storing more non-publicly-stored stuff in + the future...). This is a StorageInterface implementation + instance. Visitors to your site probably cannot see it... it isn't + designed to be seen, anyway. + ++ **public_store:** After your media goes through processing it gets + moved to the public store. This is also a StorageInterface + implelementation, and is for stuff that's intended to be seen by + site visitors. The workbench ~~~~~~~~~~~~~ -- cgit v1.2.3 From b835e15319882477e71c7b03db2c1565dd674a96 Mon Sep 17 00:00:00 2001 From: Elrond Date: Tue, 30 Apr 2013 00:24:45 +0200 Subject: Add warning about crypt/itsdangeroussecret.bin. You should not leak that file, really. --- docs/source/pluginwriter/api.rst | 2 +- docs/source/siteadmin/deploying.rst | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'docs/source') diff --git a/docs/source/pluginwriter/api.rst b/docs/source/pluginwriter/api.rst index 3a75d455..6323f713 100644 --- a/docs/source/pluginwriter/api.rst +++ b/docs/source/pluginwriter/api.rst @@ -31,4 +31,4 @@ Please check the release notes for updates! .. automodule:: mediagoblin.tools.pluginapi :members: get_config, register_routes, register_template_path, register_template_hooks, get_hook_templates, - hook_handle, hook_runall, hook_transform, + hook_handle, hook_runall, hook_transform diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst index 77e60037..f2f71e01 100644 --- a/docs/source/siteadmin/deploying.rst +++ b/docs/source/siteadmin/deploying.rst @@ -345,3 +345,17 @@ Visit the site you've set up in your browser by visiting smaller deployments. However, for larger production deployments with larger processing requirements, see the ":doc:`production-deployments`" documentation. + + +Security Considerations +~~~~~~~~~~~~~~~~~~~~~~~ + +.. warning:: + + The directory ``user_dev/crypto/`` contains some very + sensitive files. + Especially the ``itsdangeroussecret.bin`` is very important + for session security. Make sure not to leak its contents anywhere. + If the contents gets leaked nevertheless, delete your file + and restart the server, so that it creates a new secret key. + All previous sessions will be invalifated then. -- cgit v1.2.3 From a7d2a8924edd010e707e6da17f17bc74f5db2fbd Mon Sep 17 00:00:00 2001 From: Sam Tuke Date: Mon, 6 May 2013 16:19:10 +0200 Subject: Added info about editing mediagoblin.ini Added link to Apache deployment instructions --- docs/source/siteadmin/deploying.rst | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst index f2f71e01..fae4afa0 100644 --- a/docs/source/siteadmin/deploying.rst +++ b/docs/source/siteadmin/deploying.rst @@ -205,6 +205,19 @@ update) Deploy MediaGoblin Services --------------------------- +Edit site configuration +~~~~~~~~~~~~~~~~~~~~~~~ + +A few basic properties must be set before MediaGoblin will work. First make a copy of ``mediagoblin.ini`` for editing so the original config file isn't lost:: + + cp mediagoblin.ini mediagoblin_local.ini + +Then: + +Set ``email_sender_address`` to the address you wish to be used as the sender for system-generated emails +Edit ``direct_remote_path``, ``base_dir``, and ``base_url`` if you're mediagoblin directory is not the root directory of your vhost. + + Configure MediaGoblin to use the PostgreSQL database ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -240,11 +253,11 @@ browser to confirm that the service is operable. .. _webserver-config: -Connect the Webserver to MediaGoblin with FastCGI -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This section describes how to configure MediaGoblin to work via -FastCGI. Our configuration example will use nginx, however, you may +FastCGI and nginx +~~~~~~~~~~~~~~~~~ + +This configuration example will use nginx, however, you may use any webserver of your choice as long as it supports the FastCGI protocol. If you do not already have a web server, consider nginx, as the configuration files may be more clear than the @@ -345,6 +358,12 @@ Visit the site you've set up in your browser by visiting smaller deployments. However, for larger production deployments with larger processing requirements, see the ":doc:`production-deployments`" documentation. + + +Apache +~~~~~~ + +Instructions and scripts for running MediaGoblin on an Apache server can be found on the `MediaGoblin wiki `_. Security Considerations -- cgit v1.2.3 From f65bf8983611b18ec3a6a042404c50b8558529df Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 8 May 2013 10:57:23 -0500 Subject: Documenting plugin configuration This commit sponsored by David Krupicz. Thanks, David! --- docs/source/pluginwriter/api.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'docs/source') diff --git a/docs/source/pluginwriter/api.rst b/docs/source/pluginwriter/api.rst index 6323f713..df933511 100644 --- a/docs/source/pluginwriter/api.rst +++ b/docs/source/pluginwriter/api.rst @@ -32,3 +32,19 @@ Please check the release notes for updates! :members: get_config, register_routes, register_template_path, register_template_hooks, get_hook_templates, hook_handle, hook_runall, hook_transform + +Configuration +------------- + +Your plugin may define its own configuration defaults. + +Simply add to the directory of your plugin a config_spec.ini file. An +example might look like:: + + [plugin_spec] + some_string = string(default="blork") + some_int = integer(default=50) + +This means that when people enable your plugin in their config you'll +be able to provide defaults as well as type validation. + -- cgit v1.2.3 From b312d2cd83dbbfb32adc30c5eb3a9a4cc6ae9295 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Tue, 14 May 2013 16:09:55 -0500 Subject: Added documentation on view specific hooks This commit sponsored by Matthew Woodward. Thank you! --- docs/source/pluginwriter/api.rst | 62 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) (limited to 'docs/source') diff --git a/docs/source/pluginwriter/api.rst b/docs/source/pluginwriter/api.rst index df933511..0d5c82d8 100644 --- a/docs/source/pluginwriter/api.rst +++ b/docs/source/pluginwriter/api.rst @@ -48,3 +48,65 @@ example might look like:: This means that when people enable your plugin in their config you'll be able to provide defaults as well as type validation. + +Context Hooks +------------- + +View specific hooks ++++++++++++++++++++ + +You can hook up to almost any template called by any specific view +fairly easily. As long as the view directly or indirectly uses the +method ``render_to_response`` you can access the context via a hook +that has a key in the format of the tuple:: + + (view_symbolic_name, view_template_path) + +Where the "view symbolic name" is the same parameter used in +``request.urlgen()`` to look up the test. So say we're wanting to add +something to the context of the user's homepage. We look in +mediagoblin/user_pages/routing.py and see:: + + add_route('mediagoblin.user_pages.user_home', + '/u//', + 'mediagoblin.user_pages.views:user_home') + +Aha! That means that the name is ``mediagoblin.user_pages.user_home``. +Okay, so then we look at the view at the +``mediagoblin.user_pages.views:user_home`` method:: + + @uses_pagination + def user_home(request, page): + # [...] whole bunch of stuff here + return render_to_response( + request, + 'mediagoblin/user_pages/user.html', + {'user': user, + 'user_gallery_url': user_gallery_url, + 'media_entries': media_entries, + 'pagination': pagination}) + +Nice! So the template appears to be +``mediagoblin/user_pages/user.html``. Cool, that means that the key +is:: + + ("mediagoblin.user_pages.views:user_home", + "mediagoblin/user_pages/user.html") + +The context hook uses ``hook_transform()`` so that means that if we're +hooking into it, our hook will both accept one argument, ``context``, +and should return that modified object, like so:: + + def add_to_user_home_context(context): + context['foo'] = 'bar' + return context + + hooks = { + ("mediagoblin.user_pages.views:user_home", + "mediagoblin/user_pages/user.html"): add_to_user_home_context} + + +Global context hook ++++++++++++++++++++ + + -- cgit v1.2.3 From 1344c561a0da28290bab860e7e628998463fca15 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 15 May 2013 10:37:41 -0500 Subject: Adding global context hooks & fixing method names->symbolic view names in docs This commit sponsored by Sheila Miguez. Thanks Sheila! --- docs/source/pluginwriter/api.rst | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'docs/source') diff --git a/docs/source/pluginwriter/api.rst b/docs/source/pluginwriter/api.rst index 0d5c82d8..b411fa4d 100644 --- a/docs/source/pluginwriter/api.rst +++ b/docs/source/pluginwriter/api.rst @@ -73,7 +73,7 @@ mediagoblin/user_pages/routing.py and see:: Aha! That means that the name is ``mediagoblin.user_pages.user_home``. Okay, so then we look at the view at the -``mediagoblin.user_pages.views:user_home`` method:: +``mediagoblin.user_pages.user_home`` method:: @uses_pagination def user_home(request, page): @@ -90,7 +90,7 @@ Nice! So the template appears to be ``mediagoblin/user_pages/user.html``. Cool, that means that the key is:: - ("mediagoblin.user_pages.views:user_home", + ("mediagoblin.user_pages.user_home", "mediagoblin/user_pages/user.html") The context hook uses ``hook_transform()`` so that means that if we're @@ -102,11 +102,26 @@ and should return that modified object, like so:: return context hooks = { - ("mediagoblin.user_pages.views:user_home", + ("mediagoblin.user_pages.user_home", "mediagoblin/user_pages/user.html"): add_to_user_home_context} Global context hook +++++++++++++++++++ +If you need to add something to the context of *every* view, it is not +hard; there are two hooks hook that also uses hook_transform (like the +above) but make available what you are providing to *every* view. +Note that there is a slight, but critical, difference between the two. + +The most general one is the ``'template_global_context'`` hook. This +one is run only once, and is read into the global context... all views +will get access to what are in this dict. + +The slightly more expensive but more powerful one is +``'template_context_prerender'``. This one is not added to the global +context... it is added to the actual context of each individual +template render right before it is run! Because of this you also can +do some powerful and crazy things, such as checking the request object +or other parts of the context before passing them on. -- cgit v1.2.3 From 0553976187a4ec870f944d2d4d17a4951075d2a8 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 15 May 2013 11:10:25 -0500 Subject: Hook->hooks since there's more than one of them :) --- docs/source/pluginwriter/api.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/source') diff --git a/docs/source/pluginwriter/api.rst b/docs/source/pluginwriter/api.rst index b411fa4d..56aaac77 100644 --- a/docs/source/pluginwriter/api.rst +++ b/docs/source/pluginwriter/api.rst @@ -106,8 +106,8 @@ and should return that modified object, like so:: "mediagoblin/user_pages/user.html"): add_to_user_home_context} -Global context hook -+++++++++++++++++++ +Global context hooks +++++++++++++++++++++ If you need to add something to the context of *every* view, it is not hard; there are two hooks hook that also uses hook_transform (like the -- cgit v1.2.3 From 38ebd05d1a759c3a057ab041124c313cf5724dc4 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 15 May 2013 11:29:43 -0500 Subject: Simple tyop, view->test... I was writing too many tests at the time :) --- docs/source/pluginwriter/api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/source') diff --git a/docs/source/pluginwriter/api.rst b/docs/source/pluginwriter/api.rst index 56aaac77..5e0568fd 100644 --- a/docs/source/pluginwriter/api.rst +++ b/docs/source/pluginwriter/api.rst @@ -63,7 +63,7 @@ that has a key in the format of the tuple:: (view_symbolic_name, view_template_path) Where the "view symbolic name" is the same parameter used in -``request.urlgen()`` to look up the test. So say we're wanting to add +``request.urlgen()`` to look up the view. So say we're wanting to add something to the context of the user's homepage. We look in mediagoblin/user_pages/routing.py and see:: -- cgit v1.2.3 From 041d2fd785f9b3e18f9fd758f91dbfa7715d317c Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Fri, 17 May 2013 15:10:34 -0500 Subject: Just word-wrapping the recent changes to the deployment docs. --- docs/source/siteadmin/deploying.rst | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'docs/source') diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst index fae4afa0..9bcc0637 100644 --- a/docs/source/siteadmin/deploying.rst +++ b/docs/source/siteadmin/deploying.rst @@ -208,14 +208,18 @@ Deploy MediaGoblin Services Edit site configuration ~~~~~~~~~~~~~~~~~~~~~~~ -A few basic properties must be set before MediaGoblin will work. First make a copy of ``mediagoblin.ini`` for editing so the original config file isn't lost:: +A few basic properties must be set before MediaGoblin will work. First +make a copy of ``mediagoblin.ini`` for editing so the original config +file isn't lost:: cp mediagoblin.ini mediagoblin_local.ini - -Then: -Set ``email_sender_address`` to the address you wish to be used as the sender for system-generated emails -Edit ``direct_remote_path``, ``base_dir``, and ``base_url`` if you're mediagoblin directory is not the root directory of your vhost. +Then: + - Set ``email_sender_address`` to the address you wish to be used as + the sender for system-generated emails + - Edit ``direct_remote_path``, ``base_dir``, and ``base_url`` if + your mediagoblin directory is not the root directory of your + vhost. Configure MediaGoblin to use the PostgreSQL database @@ -363,7 +367,8 @@ Visit the site you've set up in your browser by visiting Apache ~~~~~~ -Instructions and scripts for running MediaGoblin on an Apache server can be found on the `MediaGoblin wiki `_. +Instructions and scripts for running MediaGoblin on an Apache server +can be found on the `MediaGoblin wiki `_. Security Considerations -- cgit v1.2.3