Rodney Ewing
226f1771e2
Removed an unused import
2013-04-26 07:32:39 -07:00
Elrond
d891966424
Unit test for ReallyLazyProxy.
...
LazyProxy caches its value. So create a unit test for
lazy_pass_to_ugettext to make sure its returned proxy
actually gives a different translation when the locale
is switched.
2013-04-25 14:31:29 +02:00
Elrond
5ae0cbaa55
No lazy_* needed here; Add ReallyLazyProxy.__repr__.
...
One should use lazy_* only if you have a good reason.
This one found by our unit tests!
For example add_message adds the message to the session,
the session needs to be serialized (with json) and well,
LazyProxy is not serializable.
To aid in debugging, gave our ReallyLazyProxy a __repr__.
2013-04-25 14:31:29 +02:00
Christopher Allan Webber
c47be4b8ba
Adding ReallyLazyProxy, a proxy that does what we expect :)
2013-04-24 16:40:30 -05:00
Christopher Allan Webber
a789b713f5
Switching non-forms back to using normal pass_to_ugettext
2013-04-24 16:40:30 -05:00
Aditi Mittal
665b9c420a
Fix-bug-667-Use-lazy_pass_to_ugettext-for-forms.
2013-04-24 16:40:29 -05:00
Rodney Ewing
34d8bc9820
Check for duplicate collection slugs and make them unique. Add unique constraint to collection.slug model
2013-04-24 14:31:51 -07:00
Elrond
50cb512220
Create set_thread_locale and use it.
...
Setting up a new template env should not directly touch the
translation tools, but go through a function in
translations.py.
2013-04-24 22:30:50 +02:00
Elrond
c82a8ba54f
resize_image: Change calling style a bit.
...
- entry: not used, removed.
- proc_state: going to be used, added.
- size_limits: not used, removed.
2013-04-24 15:20:32 +02:00
Alon Levy
cec9648c11
mediagoblin/submit/lib.py: fix typo
...
Signed-off-by: Alon Levy <alon@pobox.com>
2013-04-23 13:11:40 +02:00
Elrond
6bea8a9094
Create add_media_to_collection()
...
The ideas is by Alon Levy.
Not only media_collect, but also other places might want to
add media to a collection. So refactor this into a function
for easier usage.
2013-04-23 12:29:17 +02:00
Elrond
e6bd03d429
Doc string for ProcessingState.
2013-04-22 22:18:24 +02:00
Elrond
dc1ec36eb9
resize_image: Refactor config loading a small bit.
...
Well, get the config into a local variable, for easier access.
2013-04-21 19:26:57 +02:00
Elrond
fd1202b774
Cleanup storage after test, and test .delete_dir().
...
The storage tests work in the system's tmpdir. The python
docs say, we should clean up after using things. Yes the
directory should be cleaned up on reboot, but if running
tests a lot, the tmpdir could fill up, so we should really
cleanup.
So use the new .delete_dir() on the storage interface to
cleanup test dirs and get them finally removed with
os.rmdir. All nicely packed into cleanup_storage().
2013-04-21 19:26:57 +02:00
Christopher Allan Webber
449863863a
Merge remote-tracking branch 'remotes/npigeon/ticket-601'
2013-04-20 17:19:56 -05:00
Christopher Allan Webber
8aa18b6682
bumping image quality to 90, after conversation with Elrond
2013-04-20 11:03:48 -05:00
Christopher Allan Webber
7bb26613a3
Bumping the default image quality up to 85.
2013-04-20 10:54:13 -05:00
dunkyp
35f6d6a750
image quality can be set in config file
...
(cherry-picked from
https://gitorious.org/~dunkyp/mediagoblin/dunkyps-mediagoblin/commits/image_quality )
2013-04-20 10:54:13 -05:00
Elrond
12dccc4552
Refactor test configs.
...
All the hook_* tests use the same config, so refactor it.
2013-04-20 00:24:09 +02:00
Christopher Allan Webber
c5d8d30182
removing old callable utilities and porting stuff over.
2013-04-19 16:51:14 -05:00
Christopher Allan Webber
97e0a79f39
Let's not use reserved keywords :)
2013-04-19 16:31:23 -05:00
Christopher Allan Webber
51d5d3aa20
changing the things to document in api.rst
2013-04-19 16:29:03 -05:00
Christopher Allan Webber
a0e7699a45
Added new tests to test hook_transform()
2013-04-19 16:28:41 -05:00
Christopher Allan Webber
234ddad607
we should be returning the result, not None!
2013-04-19 16:28:24 -05:00
Christopher Allan Webber
d1146101bb
Adjusting tests to use hook_handle and hook_runall
2013-04-19 16:16:26 -05:00
Christopher Allan Webber
eff722ef15
fixing hook_handle for when result is never assigned, avoid reference without assignent
2013-04-19 14:58:22 -05:00
Christopher Allan Webber
e49b7bf290
As Elrond points out, we might as well .pop() default_handler
2013-04-19 14:25:02 -05:00
Christopher Allan Webber
ff259f6bf3
Hooks: the Next Generation!
...
I have not tested any of this but it looks right ;)
2013-04-19 13:56:05 -05:00
Christopher Allan Webber
4d0191dcb8
A warning about the plugin API being unstable.
2013-04-19 13:22:03 -05:00
Christopher Allan Webber
dd7eac8223
And... pyblosxom code removed again :)
...
We agreed on a new direction on IRC last night...
2013-04-19 13:13:32 -05:00
Christopher Allan Webber
0ea7b48055
pyblosxom run_callback hoisted
2013-04-18 17:03:25 -05:00
Christopher Allan Webber
2455a54f72
Moving the rest of the relevant tests to have test_app set up in "def setup()" as well
2013-04-18 11:15:47 -05:00
Christopher Allan Webber
0f3467013f
at pytest author's advice, changing the way _setup back to -> setup
...
They showed me how to use @pytest.fixture, which allowed us to pass the
test into setup!
2013-04-18 10:53:36 -05:00
Elrond
90d7de255a
piwigo: Send NotImplemented for unknown methods.
...
That's somewhat, what piwigo does.
2013-04-18 16:14:16 +02:00
Elrond
f6f557696d
Use check_file_field in pwg_images_addSimple.
2013-04-18 16:14:16 +02:00
Elrond
bc92ff9d3c
Start to use six for basestring.
...
six allows us to smoothly get more forward compatible with
py3. The idea is to change things over to use six, when/if
we feel a need for it.
2013-04-18 16:14:16 +02:00
Elrond
4c7b9420ab
stl:blender_render() - Remove useless arg_string.
2013-04-17 22:08:10 +02:00
Christopher Allan Webber
6a28bc4e87
Fixing typo in calling render_http_exception
2013-04-17 10:03:33 -05:00
Christopher Allan Webber
3606316e9d
ppoppler -> poppler tyop fix
2013-04-17 07:41:15 -05:00
Elrond
f84425c0c1
Turning image's media manager into a new style class.
...
images are the first media type to use the new style class
based media manager.
2013-04-17 12:09:30 +02:00
Elrond
95dab599da
Add sniff_handler method to mediamanagers.
...
The MediaManagerBase gets a fallback "return False" one.
The Compat-Manager checks in the dict and calls that one or
returns False.
2013-04-17 12:09:30 +02:00
Elrond
6d37733a3f
Add MediaManagerBase class.
...
This is the base class for all new style class based media
managers.
2013-04-17 12:08:53 +02:00
Elrond
e8676fa383
MediaManager: Use .foo instead of ['foo'].
...
To make .media_fetch_order work, create a property.
2013-04-17 12:08:53 +02:00
Elrond
2077d6ed93
First step towards a MediaManager class: Compat one.
...
To get us moving towards a MediaManager class, the first
idea is to create a class that wraps our current dict based
manager and makes all users happy.
2013-04-17 12:08:52 +02:00
Alon Levy
827f91e603
update documentation for s/nose/py.test/
...
Signed-off-by: Alon Levy <alon@pobox.com>
2013-04-17 12:55:57 +03:00
Alon Levy
d0e9f843e2
PIL: Support systems with Pillow and without
...
Fixes for systems with Pillow, but leaves a "try: except ImportError" to
support anything that doesn't have a PIL top level import.
Signed-off-by: Alon Levy <alon@pobox.com>
2013-04-17 12:54:54 +03:00
Alon Levy
519bcfb0e6
pdf/processing.py: don't use check_output, only in python>=2.7
...
Signed-off-by: Alon Levy <alon@pobox.com>
2013-04-17 12:47:28 +03:00
Elrond
b698c94d03
Refactor test resources into new resources.py
2013-04-17 01:15:46 +02:00
Elrond
54b3113abc
PDF: Use pytest.mark.skipif for skipping tests
...
Instead of leaving test early if they can not run, use the
pytest.mark.skipif marked to tell the test system not to
even run the test.
This also adds to the stats, because skipped tests are
counted differently. Thus making it obvious, that some
tests did not run, because of any reason.
2013-04-16 23:39:01 +02:00
Christopher Allan Webber
24b1683b0d
Switch to an apparently newer version of pdf.js per irc.mozilla.org #pdfjs recommendations
2013-04-16 16:09:57 -05:00