
In all cases where get_media_manager(_media_type_as_string) was called in our code base we ultimately passed in a "MediaEntry().media_type" to get the matching MEDIA_MANAGER. It so makes sense to make this a function of the MediaEntry rather than a global function in mediagoblin.media_types and passing around media_entry.media_type as arguments all the time. It saves a few import statements and arguments. I also made it so the Media_manager property is cached for subsequent calls, although I am not too sure that this is needed (there are other cases for which this would make more sense) Also add a get_media_manager test to the media submission tests. It submits an image and checks that both media.media_type and media.media_manager return the right thing. Not sure if these tests could not be merged with an existing submission test, but it can't hurt to have things explicit. TODO: Right now we iterate through all existing media_managers to find the right one based on the string of its module name. This should be made a simple dict lookup to avoid all the extra work. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
======== README ======== What is GNU MediaGoblin? ======================== * Initially, a place to store all your photos that’s as awesome as, if not more awesome than, existing network services (Flickr, SmugMug, Picasa, etc) * Customizable! * A place for people to collaborate and show off original and derived creations. Free, as in freedom. We’re a GNU project after all. * Later, a place for all sorts of media, such as video, music, etc hosting. * Later, federated with OStatus! Is it ready for me to use? ========================== Yes! But with caveats. The software is usable and there are instances running, but it's still in its early stages. Can I help/hang out/participate/whisper sweet nothings in your ear? =================================================================== Yes! Please join us and hang out! For more information on where we hang out, see `our Join page <http://mediagoblin.org/join/>`_ Where is the documentation? =========================== The beginnings of a site administration manual is located in the ``docs/`` directory in HTML, Texinfo, and source (Restructured Text) forms. It's also available online at http://docs.mediagoblin.org/ in HTML form. Contributor/developer documentation as well as documentation on the project processes and infrastructure is located on `the wiki <http://wiki.mediagoblin.org/>`_.
Description
Languages
JavaScript
43.9%
Python
43.2%
HTML
9.1%
CSS
1.4%
Shell
0.9%
Other
1.5%