diff options
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | docs/source/siteadmin/deploying.rst | 14 | ||||
-rwxr-xr-x | experimental-bootstrap.sh (renamed from bootstrap.sh) | 0 | ||||
m--------- | extlib/exif | 0 | ||||
-rw-r--r-- | mediagoblin/gmg_commands/batchaddmedia.py | 1 | ||||
-rw-r--r-- | mediagoblin/submit/lib.py | 4 | ||||
-rw-r--r-- | mediagoblin/tests/test_exif.py | 2 | ||||
-rw-r--r-- | mediagoblin/tools/exif.py | 5 | ||||
-rw-r--r-- | mediagoblin/user_pages/views.py | 20 | ||||
-rw-r--r-- | setup.py | 12 |
10 files changed, 36 insertions, 25 deletions
diff --git a/.gitmodules b/.gitmodules index 5d78d03e..20fa20e2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,6 +7,3 @@ [submodule "extlib/skeleton"] path = extlib/skeleton url = git://github.com/dhg/Skeleton.git -[submodule "extlib/exif"] - path = extlib/exif - url = https://github.com/ianare/exif-py.git diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst index 1cf633b3..0dde3b6a 100644 --- a/docs/source/siteadmin/deploying.rst +++ b/docs/source/siteadmin/deploying.rst @@ -91,13 +91,7 @@ name will be ``mediagoblin`` too. To create our new user, run:: - sudo -u postgres createuser mediagoblin - -then answer NO to *all* the questions:: - - Shall the new role be a superuser? (y/n) n - Shall the new role be allowed to create databases? (y/n) n - Shall the new role be allowed to create more new roles? (y/n) n + sudo -u postgres createuser -A -D mediagoblin then create the database all our MediaGoblin data should be stored in:: @@ -210,14 +204,16 @@ And set up the in-package virtualenv:: .. note:: - We presently have an experimental make-style deployment system. if + We presently have an **experimental** make-style deployment system. if you'd like to try it, instead of the above command, you can run:: - ./bootstrap.sh && ./configure && make + ./experimental-bootstrap.sh && ./configure && make This also includes a number of nice features, such as keeping your viratualenv up to date by simply running `make update`. + Note: this is liable to break. Use this method with caution. + .. :: (NOTE: Is this still relevant?) diff --git a/bootstrap.sh b/experimental-bootstrap.sh index 78d0f1c7..78d0f1c7 100755 --- a/bootstrap.sh +++ b/experimental-bootstrap.sh diff --git a/extlib/exif b/extlib/exif deleted file mode 160000 -Subproject 6ff9ed1410e72e1da19257b93976fa88fe4248b diff --git a/mediagoblin/gmg_commands/batchaddmedia.py b/mediagoblin/gmg_commands/batchaddmedia.py index deb6c5bd..b6fd2763 100644 --- a/mediagoblin/gmg_commands/batchaddmedia.py +++ b/mediagoblin/gmg_commands/batchaddmedia.py @@ -178,6 +178,7 @@ FAIL: Local file {filename} could not be accessed.".format(filename=filename) title=maybe_unicodeify(title), description=maybe_unicodeify(description), license=maybe_unicodeify(license), + metadata=json_ld_metadata, tags_string=u"", upload_limit=upload_limit, max_file_size=max_file_size) print "Successfully uploading {filename}!".format(filename=filename) diff --git a/mediagoblin/submit/lib.py b/mediagoblin/submit/lib.py index c70e2731..df3f7b62 100644 --- a/mediagoblin/submit/lib.py +++ b/mediagoblin/submit/lib.py @@ -98,7 +98,7 @@ class UserPastUploadLimit(UploadLimitError): def submit_media(mg_app, user, submitted_file, filename, title=None, description=None, - license=None, tags_string=u"", + license=None, metadata=None, tags_string=u"", upload_limit=None, max_file_size=None, callback_url=None, # If provided we'll do the feed_url update, otherwise ignore @@ -142,6 +142,8 @@ def submit_media(mg_app, user, submitted_file, filename, entry.license = license or None + entry.media_metadata = metadata or u"" + # Process the user's folksonomy "tags" entry.tags = convert_to_tag_list_of_dicts(tags_string) diff --git a/mediagoblin/tests/test_exif.py b/mediagoblin/tests/test_exif.py index c07e24ae..af301818 100644 --- a/mediagoblin/tests/test_exif.py +++ b/mediagoblin/tests/test_exif.py @@ -39,7 +39,7 @@ def test_exif_extraction(): gps = get_gps_data(result) # Do we have the result? - assert len(result) == 56 + assert len(result) == 55 # Do we have clean data? assert len(clean) == 53 diff --git a/mediagoblin/tools/exif.py b/mediagoblin/tools/exif.py index acbf3179..50f1aabf 100644 --- a/mediagoblin/tools/exif.py +++ b/mediagoblin/tools/exif.py @@ -14,10 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -import sys -sys.path.append('extlib/exif') - -from EXIF import process_file +from exifread import process_file from exifread.utils import Ratio from mediagoblin.processing import BadMediaFail diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py index 64fa793e..78751a28 100644 --- a/mediagoblin/user_pages/views.py +++ b/mediagoblin/user_pages/views.py @@ -31,6 +31,7 @@ from mediagoblin.user_pages.lib import (send_comment_email, add_media_to_collection, build_report_object) from mediagoblin.notifications import trigger_notification, \ add_comment_subscription, mark_comment_notification_seen +from mediagoblin.tools.pluginapi import hook_transform from mediagoblin.decorators import (uses_pagination, get_user_media_entry, get_media_entry_by_id, user_has_privilege, user_not_banned, @@ -146,14 +147,23 @@ def media_home(request, media, page, **kwargs): media_template_name = media.media_manager.display_template + context = { + 'media': media, + 'comments': comments, + 'pagination': pagination, + 'comment_form': comment_form, + 'app_config': mg_globals.app_config} + + # Since the media template name gets swapped out for each media + # type, normal context hooks don't work if you want to affect all + # media displays. This gives a general purpose hook. + context = hook_transform( + "media_home_context", context) + return render_to_response( request, media_template_name, - {'media': media, - 'comments': comments, - 'pagination': pagination, - 'comment_form': comment_form, - 'app_config': mg_globals.app_config}) + context) @get_media_entry_by_id @@ -53,13 +53,16 @@ try: 'kombu', 'jinja2', 'sphinx', - 'Babel', + 'Babel>=1.0', 'argparse', 'webtest<2', 'ConfigObj', 'Markdown', 'sqlalchemy<0.9.0, >0.8.0', - 'sqlalchemy-migrate', + # newer sqlalchemy-migrate requires pbr which BREAKS EVERYTHING AND IS + # TERRIBLE AND IS THE END OF ALL THINGS + # I'd love to remove this restriction. + 'sqlalchemy-migrate<0.8', 'mock', 'itsdangerous', 'pytz', @@ -68,6 +71,11 @@ try: 'unidecode', 'jsonschema', 'requests', + 'ExifRead', + + # PLEASE change this when we can; a dependency is forcing us to set this + # specific number and it is breaking setup.py develop + 'six==1.5.2' ## Annoying. Please remove once we can! We only indirectly ## use pbr, and currently it breaks things, presumably till |