24 Commits

Author SHA1 Message Date
Joar Wandborg
3c48bb39b7 CloudFiles: Default to SSL URIs 2013-06-07 00:28:17 +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
Sebastian Spaeth
99a54c0095 Make copying to/from storage systems memory efficient (#419)
The copy_locally and copy_local_to_storage (very inconsistent terms BTW)
were simply slurping in everything in RAM and writing it out at once.
(the copy_locally was actually memory efficient if the remote system was local)

Use shutil.copyfileobj which does chunked reads/writes on file objects.
The default buffer size is 16kb, and as each chunk means a separate HTTP
request for e.g. cloudfiles, we use a chunksize of 4MB here (which has
just been arbitrarily set by me without tests).

This should help with the failure to upload large files issue #419.
2013-03-03 14:40:06 -06:00
Joar Wandborg
e11bc1991d Added .send method to cloudfiles storage object
.. wrapper. Also added some logging - A .warn() for the legacy .write()
method and a .debug() for the new copy_local_to_storage()
2013-03-03 00:11:34 +01:00
Sebastian Spaeth
8b35e7ad15 Make Cloudfiles copy memory efficient too (#419)
It seems that (our implementation of) cloudfiles.write() takes
all existing data and appends write(data) to it, sending the
full monty over the wire everytime. This would of course
absolutely kill chunked writes with some O(1^n) performance
and bandwidth usage. So, override this method and use the
Cloudfile's "send" interface instead.

Also make the Cloudfile file wrapper an iterator that allows us to
simply do "for data in cloudfile:" which will stream the data in a
memory-efficient way.

DO NOTE THAT THIS PATCH IS COMPLETELY UNTESTED DUE TO LACK OF SETUP
PLEASE REVIEW AND VERIFY.
2013-03-02 23:44:54 +01:00
Christopher Allan Webber
0ac8317ddc Removing docstring bit about delete_file possibly deleting directories in the future
I agree that delete_dir as a separate operation is a better way to do
things, especially since there is a non-recursive deletion option that
will politely fail if the directory is not empty.
2013-01-22 14:32:00 -06:00
Sebastian Spaeth
b34d7e1d9b Implement delete_dir in the FileStorage
plus options for deleting only empty directories and deleting
them recursively.

Not sure how cloudfile storage is or should be handled here. Are
things such as a "directory" even a concept there?
2013-01-22 14:05:34 -06:00
Joar Wandborg
c43f8c1d92 Fixed attachments 2012-10-23 01:10:46 +02:00
Joar Wandborg
a07d052f0d Non-performance improvements to cloudfiles
Improved documentation and added logging to cloudfiles
2012-08-05 22:55:45 +02:00
Brett Smith
4a791b8006 Make filestorage available to code that only imports storage.
The storage-related tests were relying on this, if nothing else.
2012-07-08 10:30:55 -04:00
Will Kahn-Greene
a855e92a98 Fix problems from pyflakes output 2012-06-03 15:53:34 -04:00
Christopher Allan Webber
add8d351de Also make sure mimetype here is set correctly via mimetype[0] (Thanks Shackra!) 2012-04-18 09:22:51 -05:00
Shackra
ea42790bc3 Save the MIMEtype to cloudfiles correctly. 2012-04-16 22:06:54 +02:00
Christopher Allan Webber
cf29e8a824 It's 2012 all up in here 2012-02-02 09:44:13 -06:00
Joar Wandborg
b9e1fa280e Merge branch 'video_gstreamer-only'
Conflicts:
	mediagoblin/db/migrations.py
	mediagoblin/submit/views.py
2011-11-21 21:51:30 +01:00
Christopher Allan Webber
2e8fbc8fab Slightly clearer docs on copy_local_to_storage 2011-11-20 22:02:02 -06:00
Christopher Allan Webber
98f6efb068 copy_local_to_storage, both general and specialized-for-BasicFileStorage versions
This utility should allow for easy copying from a local filesystem to
the storage instance.
2011-11-20 22:01:43 -06:00
Christopher Allan Webber
ee91c2b88d Merge remote-tracking branch 'remotes/nyergler/pep8-ification'
Conflicts:
	mediagoblin/db/migrations.py
	mediagoblin/db/models.py
	mediagoblin/user_pages/views.py
	mediagoblin/util.py
2011-11-13 20:23:26 -06:00
Christopher Allan Webber
b43b17fc26 Merge remote branch 'remotes/aaronw/bug444_fix_utils_py_redux'
Conflicts:
	mediagoblin/util.py
2011-10-01 21:27:36 -05:00
Nathan Yergler
243c3843bd Whitespace and formatting cleanup.
* Removed trailing whitespace
* Line length < 80 where possible
* Honor conventions on number of blank lines
* Honor conventions about spaces around :, =
2011-10-01 15:10:02 -07:00
Aaron Williamson
152a3bfaa3 Finished splitting util.py into separate files. 2011-10-01 18:05:44 -04:00
Joar Wandborg
93bdab9daa Multimedia support - Commiting from a not yet finished state - Details below
* DONE Initially testing with arista
** DONE Video display templates
*** TODO Multi-browser support
** TODO Video thumbnails
** TODO Link to original video
** TODO Video cropping

Also contains a lot of "debug" print's
2011-09-23 02:35:57 +02:00
Joar Wandborg
dd1756ee19 mountstorage - Changed typo in import 2011-09-15 13:19:25 +02:00
Joar Wandborg
a2468d18ca Feature #587 - Split storage.py into submodules
*   Removed storage.py
*   Created submodules for filestorage, cloudfiles, mountstorage
*   Changed test_storage to reflect the changes made in the storage
    module structure
*   Added mediagoblin.storage.filestorage.BasicFileStorage as a
    default for both publicstore and queuestore's `storage_class`
2011-09-12 02:32:03 +02:00