2844 Commits

Author SHA1 Message Date
Alon Levy
a80ebf3b64 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 <alon@pobox.com>
2013-04-15 09:51:21 +03:00
Alon Levy
3cadb4a6cd document submodule usage
Signed-off-by: Alon Levy <alon@pobox.com>
2013-04-14 22:46:44 +03:00
Christopher Allan Webber
0f6ab7da86 Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin 2013-04-13 20:21:14 -05:00
Christopher Allan Webber
f4f9d7ca95 Merge remote-tracking branch 'refs/remotes/tsyesika/599-allow-email-login' 2013-04-13 20:11:11 -05:00
Nathan Yergler
64598a79a9 Merge remote-tracking branch 'joar-github/oauth/refresh_tokens'
This merges the patch for Issue #548.
2013-04-13 15:54:58 -07:00
Christopher Allan Webber
50bf38b26e Text-align the headers on the media panel to the left to avoid confusion
Thanks to Tsyesika for pointing this out!
2013-04-13 14:12:25 -05:00
Christopher Allan Webber
9cbbc2a401 Adding Jessica Tallon to AUTHORS! 2013-04-13 12:10:23 -05:00
Christopher Allan Webber
64308aca3f Comment when/author link styling changes 2013-04-13 12:06:19 -05:00
Christopher Allan Webber
05ad187b86 Why not also display the times on when these media were created 2013-04-13 11:58:50 -05:00
Christopher Allan Webber
eac52ac1ce Changing translations to say "amount of time ago", basically
Previously they were just "amount of time"... I think this fits a bit better.
2013-04-13 11:57:16 -05:00
Christopher Allan Webber
6432755db3 Merge remote-tracking branch 'refs/remotes/tsyesika/394-fuzzy-timestamp' 2013-04-13 11:42:34 -05:00
Jessica T
b2c8dbcf85 Allows you to use your username or email to login 2013-04-12 22:07:44 +01:00
Jessica T
88dd6fc2e2 Adds the fuzzy timestamp to the admin panel too 2013-04-12 02:38:24 +01:00
Jessica T
79e2d4eee4 Adds the unit tests and removes useless function we don't use 2013-04-12 01:40:15 +01:00
Christopher Allan Webber
36748921c2 adding callable_runone and callable_runall to the docs 2013-04-11 16:57:11 -05:00
Jessica T
f1c3807db7 Adds the timesince ability which fixes #394 2013-04-11 22:37:48 +01:00
Christopher Allan Webber
761e26bb29 Merge branch '637_friendlier_hooks' 2013-04-10 17:53:05 -05:00
Christopher Allan Webber
04f295e20d Switch several functions over to using the new callable_run* tools! 2013-04-10 17:52:49 -05:00
Christopher Allan Webber
0a5c6ec901 Remove unhandled_okay from kwargs if it's there before passing to functions. 2013-04-10 17:42:29 -05:00
Christopher Allan Webber
cdc821eb74 callable hook convenience functions.. now work, and with tests!
- Added three "callables" test plugins.
 - updated callable_runone to check for unhandled_okay in the kwargs
   dict.

All passing!
2013-04-10 17:36:21 -05:00
Christopher Allan Webber
0d656f44a1 Open Source -> Free Software from the borrowed extlib repositories
We're a GNU project, gotta get with the GNU world order ;)
2013-04-10 16:08:08 -05:00
Christopher Allan Webber
71ef20078c Adding some help about what to do if flup flakes out on you 2013-04-10 10:52:39 -05:00
Christopher Allan Webber
33cbccb09d Fix sessions so they work across the site. 2013-04-10 10:08:09 -05:00
Elrond
b0ee3aae91 Make session cookies more secure.
1. Our session cookies only need to be available to http, so
   mark them appropiately.

2. Send the cookie to the subpath for mediagoblin.

And instantiate a session manager on the app, once.
2013-04-09 22:49:11 +02:00
Elrond
82a40cc4e1 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.
2013-04-09 22:39:04 +02:00
Elrond
11780855da Fix left over from variable renaming. 2013-04-09 22:37:10 +02:00
Elrond
8021cc5605 Merge remote-tracking branch 'brett/itsdangerous'
* brett/itsdangerous:
  Call is_updated instead of testing it boolean.
  Harden It's Dangerous key management.
  First tests for the Session class.
  Set a starting value for session.send_new_cookie.
  Remove beaker stuff from the code.
  Delete the session cookie on an empty session.
  Back sessions with It's Dangerous.
  Improve fs security for itsdangerous secret.
  Docs for get_timed_signer_url.
  Basic itsdangerous infrastructure.

Conflicts:
	mediagoblin/tests/test_cache.py
2013-04-09 19:40:54 +02:00
Christopher Allan Webber
70c061955c tests for new pluginapi methods that can't possibly pass yet :) 2013-04-09 11:21:31 -05:00
Elrond
b98882e16e Use cascade for comment deletion.
Also use the relationship for getting the comments on a
MediaEntry.
2013-04-08 17:03:26 +02:00
Elrond
25067d8110 Testing: Remove some left over files/dirs.
When using tempfile.* in testing, those files get created
in the system tempdir. The docs say, we should try to
remove them.
Yes, the next reboot will clean them up also.

And in the workbench case, check after each test, that the
global workbench dir is empty (so the sub-workbcnhes have
been destroyed).
2013-04-08 17:03:26 +02:00
Elrond
8ec87dc3fd Implement queue dir delete for proc_state.delete_queue_file
Implement queue dir deleting in the
proc_state.delete_queue_file helper function.
2013-04-08 16:12:32 +02:00
Elrond
2dd0af3635 Merge remote-tracking branch 'cwebber/254_delete_queue_directories'
* cwebber/254_delete_queue_directories:
  Removing docstring bit about delete_file possibly deleting directories in the future
  Convert media processing backends to delete the queue directory (#254)
  Implement delete_dir in the FileStorage

Conflicts:
	mediagoblin/media_types/image/processing.py
	mediagoblin/media_types/video/processing.py

Conflicts, because those media_types already use the newer
proc_state.delete_queue_file() method (which needs
updating.
2013-04-08 15:57:06 +02:00
Christopher Allan Webber
e495e28ee0 Convenience functions for callable hooks 2013-04-07 17:46:11 -05:00
Elrond
0c0f31c4ef Teach runtests.sh the -n arg.
If you give "-n 8" to runtests, it thinks, it got
"-n" -- a nice option, ignored.
"8"  -- Oh! a single test named "8" to run, so no need to
        run all the GMG tests.

Well, that's not what we want. So runtests now knows about
-n taking an arg.
2013-04-06 22:56:40 +02:00
Joar Wandborg
c121a7d3d0 OAuth: Support refresh tokens, etc
Initially I was going to write a failing test for refresh tokens. Thus
this fix includes an orphaned 'expect_failure' method in test utils.

I ended up writing support for OAuth refresh tokens, as well as a lot of
cleanup (hopefully) in the OAuth plugin code.

**Rebase**: While waiting for this stuff to be merged, the testing
framework changed, it comes with batteries included regarding fails.
Removed legacy nosetest helper.

Also added a lot of backref=backref([...], cascade='all, delete-orphan')
2013-04-06 22:17:27 +02:00
Christopher Allan Webber
7d503a897b Really removing nosetests things now! all assert_whatever removed 2013-04-06 10:08:26 -05:00
Elrond
4412385394 Better docs for GenerateSlugMixin. 2013-04-06 16:53:04 +02:00
Elrond
455fd36ff6 Use GenerateSlugMixin for collections.
Use the new way of generating slugs also for collections.
Also drop the dummy_db arg to check_collection_slug_used.
2013-04-06 16:53:04 +02:00
Elrond
29c65044bf Refactor generate_slug into a mixin.
Refactor the new generate_slug into a mixin to
allow it to be used for collections also.
2013-04-06 16:53:04 +02:00
Christopher Allan Webber
fe6755f0f4 Merge branch '614_multi_test_config' 2013-04-04 19:44:36 -05:00
Christopher Allan Webber
5c2ece7401 Switch test_app generation over to use py.test fixtures.
By doing this, we can take advantage of py.test's ability to create
temporary directories that are then cleaned up later during testing.
This helps for sandboxing things.

This also involves a ton of changes:
 - Changing the get_app stuff appropriately, getting rid of the
   setup_fresh_app decorator
 - Making said fixture
 - Switching over a billion tests to use it
2013-04-04 19:23:04 -05:00
Christopher Allan Webber
e11c62a0ef Oops, forgot to assign dump_old_app to self, heh. 2013-04-04 11:13:47 -05:00
Christopher Allan Webber
245d4f119f Turning setup_fresh_app into SetupFreshApp, a decorator with options!
This way people can pass in particular paste/mediagoblin configs that they want to use.
2013-04-04 11:08:50 -05:00
Christopher Allan Webber
6588acc183 Updating get_app to allow for passing in particular app configs 2013-04-04 10:37:32 -05:00
Christopher Allan Webber
39a71c09d7 Also require pytest-xdist! 2013-04-03 16:31:42 -05:00
Christopher Allan Webber
c8196f2805 Use py.test --boxed for unit tests from now on! 2013-04-03 15:21:40 -05:00
Christopher Allan Webber
cb14544082 These tests need to have a MediaGoblin app setup so they can connect to the db!
Thanks to py.test --boxed for helping discover that ;)
2013-04-03 14:32:35 -05:00
Christopher Allan Webber
958080be16 All mediagoblin tests now pass with py.test (switched setUp to setup) 2013-04-03 14:05:42 -05:00
Elrond
d9f61cf7d7 Create ProcessingState.store_public.
The ideas is by Alon Levy.

Use it in ProcessingState.copy_original for now.
2013-04-03 18:52:17 +02:00
Elrond
af0b508c75 Little refactoring for images: media_files.
Set the media_files directly at the relvant places.
2013-04-03 18:49:46 +02:00