159 Commits

Author SHA1 Message Date
warp
bc875dc7cc Fix for issue #491, invert latitude when neccesary. 2012-08-27 15:55:43 +02:00
Aleksej
9d3e56d500 replaced os.path.split()[0] with os.path.dirname() and corrected a couple of comments 2012-08-13 16:07:58 +04:00
Jakob Kramer
cf29edcd74 allow pre+code tags in rendered HTML 2012-08-07 22:19:10 +02:00
Jakob Kramer
c042801650 renamed MARKDOWN_INSTANCE to UNSAFE_...
as proposed by Elrond.

Conflicts:
	mediagoblin/tools/text.py

Signed-off-by: Joar Wandborg <git@wandborg.com>
2012-08-07 18:48:57 +02:00
Christopher Allan Webber
a04c07376d Merge remote-tracking branch 'refs/remotes/gandaro/369-thread-gettext' 2012-07-26 11:09:52 -05:00
Jakob Kramer
c80982c7a0 make mg_globals.translations thread-safe
I added mg_globals.thread_scope (an instance of threading.local)
and made `translations' an attribute of it.
2012-07-18 19:25:53 +02:00
Will Kahn-Greene
05e007c1db Rework plugin infrastructure to nix side-effects
This reworks the plugin infrastructure so as to remove module-loading
side-effects which were making things a pain in the ass to test.

With the new system, there's no auto-registering meta class. Instead
plugins do whatever they want and then specify a hooks dict that maps
hook names to callables for the things they're tying into. The most
common one (and the only one we've implemented so far) is "setup".

This also simplifies the sampleplugin a little by moving the code
to __init__.py.
2012-07-17 21:02:12 -04:00
Will Kahn-Greene
4bd65f69c7 Finish flatpagesplugin; add plugin docs 2012-07-16 09:26:28 -04:00
Will Kahn-Greene
8545dd50f0 Flatpages first pass
This fixes the template loader so that it can load plugin templates.

This adds code for registering template paths so that plugins can add
their own templates.

This adds the base code for the flatpagesfile plugin. It doesn't serve
pages, yet, but it's pretty close.
2012-07-16 09:26:28 -04:00
Christopher Allan Webber
27c9bb8a58 Small fix to themedata_for_theme_dir utility about sections
If we can't find the theme section, we should use a dictionary instead
of None in this section of code.
2012-07-14 22:44:06 -05:00
Christopher Allan Webber
faa74bf9f5 Store licensing info as well 2012-07-14 20:23:21 -05:00
Christopher Allan Webber
35a24fc263 Moving the "dependency injection printer tools" over to tools/common.py 2012-07-14 12:55:14 -05:00
Christopher Allan Webber
975be468cf Making the register_themes() tool also return the current theme
This will reduce the amount of work reproducing this behavior when
pulling together the theme registry elsewhere.
2012-07-14 12:55:14 -05:00
Christopher Allan Webber
5377114c4d Update staticdirect stuff so it can handle "domains" of staticdirection 2012-07-14 12:55:14 -05:00
Christopher Allan Webber
00eda826cb Kill MultiRemoteStaticDirect... nobody was really using it anyway
Since we're adding the new "domain" staticdirect system we should
clean this up.
2012-07-14 12:55:13 -05:00
Christopher Allan Webber
e8d4e58214 Moving staticdirect to tools/ 2012-07-14 12:55:13 -05:00
Christopher Allan Webber
828fc6300a Early version of theme registry code 2012-07-14 12:55:13 -05:00
Brett Smith
81d3c4cf1c Merge branch 'master' into 201207-testfixes 2012-07-08 11:07:02 -04:00
Brett Smith
16b8e3afd8 Don't rely on app_config if common.TESTS_ENABLED.
app_config will be None in this case, so all of these subscripts will
fail.
2012-07-08 10:37:33 -04:00
Joar Wandborg
8588505c6f Decoding EXIF strings as UTF-8 with replace in the ifd_tag_to_dict
method.
2012-07-07 20:01:19 +02:00
Christopher Allan Webber
118bafbd81 Switching the syntax of this exception-raise
It's nicer to raise exceptions like
  raise Exception("foo")
than
  raise Exception, "foo"
2012-07-06 09:06:01 -05:00
Christopher Allan Webber
1ec85bb3de Removing _jointhat()... not really needed. 2012-07-06 09:03:08 -05:00
Christopher Allan Webber
a850b1e2a2 one more noSuchFiles->no_such_files 2012-07-06 09:02:24 -05:00
Christopher Allan Webber
46583ff4e6 Merge remote-tracking branch 'refs/remotes/merge-requests/37' 2012-07-06 08:52:35 -05:00
Jorge Araya Navarro
6d539afda6 changing NoSuchFiles for no_such_files 2012-07-05 22:07:44 -06:00
Jorge Araya Navarro
fb2fbe2c0a fixing bug #255 as Joar and CWebber ask me to do :) 2012-06-28 22:13:26 -06:00
Joar Wandborg
c72d661bed Fixed EXIF longitude bug
- Negative or 'W' longitudes were not accounted for.
- pyflakes fixes.
2012-06-23 17:21:22 +02:00
Will Kahn-Greene
355fd6770d Update documentation for plugins 2012-05-16 21:04:52 -04:00
Will Kahn-Greene
29b6f91740 401. Plugin infrastructure
* implements installing, loading and setup for plugins
* codifies configuration
* has a sample plugin
* docs
* tests
2012-05-13 00:00:08 -04:00
Christopher Allan Webber
c051615889 Merge remote-tracking branch 'remotes/slikdigit/bassam'
Conflicts:
	mediagoblin/media_types/image/processing.py
2012-03-26 15:09:35 -05:00
Bassam
0f8221dca4 fix for ticket #404 2012-03-15 12:13:44 -04:00
Elrond
cc9f9a1dd3 Another .one -> .find_one
Same idea as in the previous commit.
Joar caught this one.

To reproduce
1. Create a user with an all-decimal ObjectId in mongo
2. Login using that user, while mongodb is enabled.
3. Switch instance to sql.
4. Restart.
5. Refresh any page.

This will error, because no user with that object id exists
any more.

While around, improved logging.
2012-03-13 00:19:53 +01:00
Elrond
3502958113 Attachment support in the SQL backend
attachments working with the sql backend.

- SQL Schema for attachment files, ordering attachments by
  their name, not by the submission order (as earlier).
- Dot-Notation for attachments, where missing.
- convert existing attachments over from mongo -> sql
2012-02-28 20:52:35 +01:00
Will Kahn-Greene
7f4ebeed76 Fix copyright statements; add LICENSE for EXIF.py 2012-02-08 10:47:08 -05:00
Christopher Allan Webber
cf29e8a824 It's 2012 all up in here 2012-02-02 09:44:13 -06:00
Joar Wandborg
63bd7c04bd Acts on feedback from Chris
- Added EXIF tests
- Removed pdb from image processing "ifmain"
- Fixed comment typo in image processing
- Removed unused import in tools.exif
2012-01-25 23:46:11 +01:00
Joar Wandborg
a180ca264e EXIF fixes
- Moved exif functions from mediagoblin.media_types.image.processing
  to mediagoblin.tools.exif
- Moved EXIF.py link from mediagoblin.media_types to mediagoblin.tools.extlib
- Refractored and updated EXIF exctraction and presentation
2012-01-25 23:44:59 +01:00
Christopher Allan Webber
ee4fb8125a Canonical license URIS for CC stuff should have a trailing slash. 2012-01-21 17:00:42 -06:00
Christopher Allan Webber
2c1f1fd08b Show the license list in sorted form 2012-01-21 16:58:03 -06:00
Christopher Allan Webber
5d775ebd2f Provided a SORTED_SUPPORTED_LICENSES (but keep the old unsorted dict!) 2012-01-21 16:51:21 -06:00
Aaron Williamson
0bfb4dc249 Added new files 2012-01-17 01:13:55 -05:00
Elrond
52fc51f6a9 Drop sessions with invalid ObjectIds
The session can contain invalid objectids when switching a
more or less live instance (with logged in users) from
mongo to sql or vice versa.
So drop the complete session and force the user to login
again.
2012-01-14 13:36:00 +01:00
Elrond
f1cdd278e7 f691: Use StrictUndefined for templates and fix some issues
References to undefined variables in templates were
silently ignored/converted to None/empty strings. This
makes coding lazy stuff easy, but it makes catching typos
harder.
(It would have catched one of the SQL things earlier!)

But on the other hand it might make the current templates
error out everywhere. In fact, early testing has shown two
instances, that errored out. Those are fixed with this
commit too.

If this turns out to make things more complex and useless
than actually solving any problems, it can easily be
dropped again.
2012-01-04 23:56:16 +01:00
Elrond
228c4470f4 Dot-Notation for MediaEntry.media_files 2012-01-04 11:57:39 +01:00
Elrond
6603b30041 Merge remote branch 'remotes/manolinux/671_spaces_in_tag_list_edit'
* remotes/manolinux/671_spaces_in_tag_list_edit:
  * Feature #678: Drop custom delimiters in tags   * Eliminate the definition of the tag delimiter for tests.   * Remove a test that was related to custom tags delimiter. * Bug #671: Tags list on Edit page is not seperated by spaces and hard to read   * Modify a test to include this space.
  * Bug #671: Tags list on Edit page is not seperated by spaces and hard to read : Make 'media_tags_as_string' function put a space after each comma. * Feature #678: Drop custom delimiters in tags : I declare a constant in the begining of text.py file.
2011-12-03 22:11:54 +01:00
Elrond
71c6c432a5 Bug #685: only provide CSRF token if it exists
This was suggested by Nathan Yergler in the bug logs.
Just implementing it.

- Let render_csrf_form_token return None, if the CSRF_TOKEN
  is not available in the environ, because the
  process_request part of the meddleware has not yet run.

- In render_template: If the returned value from above is
  None, then do not add the csrf_token to the templates
  context.
2011-12-03 21:25:55 +01:00
Christopher Allan Webber
c7e1fee1b8 Should be 404 for 404s, not 400 :) 2011-12-01 16:58:56 -06:00
Manuel Urbano Santos
3038ba87e4 * Bug #671: Tags list on Edit page is not seperated by spaces and hard to read : Make 'media_tags_as_string' function put a space after each comma.
* Feature #678: Drop custom delimiters in tags : I declare a constant in the begining of text.py file.
2011-11-27 13:49:47 +01:00
Christopher Allan Webber
ce5ae8da19 Rename MediaGoblin middleware to meddleware to avoid confusion w/ wsgi middleware
hehehehehe, "meddleware"
2011-11-25 12:13:56 -06:00
Christopher Allan Webber
53bc39755b Add app_config and global_config to the template environment 2011-11-19 08:33:29 -06:00