41 Commits

Author SHA1 Message Date
Joar Wandborg
502073f2bf Feature #403 - Ability to delete media entries - Fixes according to feedback
*   Moved `mediagoblin.confirm` stuff to `mediagoblin.user_pages`,
    templates too.
*   Removed route extension for `mediagoblin.confirm`
*   Created `delete_media_files` which deletes all media files
    on the public_store when the entry is deleted
*   Created a new decorator to check if a user has the permission
     to delete an entry.
2011-08-30 23:16:46 +02:00
Joar Wandborg
026074af1e Feature/Bug #519 - CloudFilesStorage.get_file() performance issue - Fix
*   `CloudFilesStorage.get_file()` now guesses the filepath without connecting to cloudfiles. Huge profits for xDSL-hosted or slow net machines.
2011-08-25 01:05:49 +02:00
Christopher Allan Webber
bd3b566dbe Merge remote branch 'remotes/elrond/dev/storage_config' 2011-08-21 13:51:05 -05:00
Elrond
758eb74654 Document changes to storage_system_from_config
Chris suggested changing the docs for
storage_system_from_config:
- The only param is a config section.
- The format of that section is much simpler, no prefix.
2011-08-12 13:01:41 +02:00
Christopher Allan Webber
f016fc6505 Adding slightly clearer docs to MountStorage. 2011-08-11 11:29:14 -05:00
Elrond
f9b68f6efa Storage Config: Finally drop debug 2011-08-09 13:40:20 +02:00
Elrond
56fc718659 Storage config: Drop all Backward Compatibility
Chris Webber says not to care about backward compatibility
at this stage. So drop the last bits.
2011-08-09 13:18:22 +02:00
Elrond
ed7970696e Storage Config: Use own section
Instead of configuring storage X by parameters in the main
section "X_class = backend" and "X_param = value", use a
new section in the config: "[storage:X]" and use "class =
backend" and "param = value" there.

This is the beginning, it includes a try at being backward
compatible. But that try isn't really fully useful anyway.
2011-08-09 13:13:04 +02:00
Elrond
620fca5472 MountStorage: Improve mounting asserts
The asserts now differentiate between mounting on the same
path and mounting over a shorter path.
2011-08-08 21:51:11 +02:00
Elrond
255f02c486 MountStorage: Add docs. 2011-08-08 20:11:28 +02:00
Elrond
ff94b4ce38 Merge remote branch 'upstream/master' into dev/mount_storage
Conflicts:
	mediagoblin/storage.py
2011-08-08 20:00:57 +02:00
Joar Wandborg
aa797ca130 Feature #477 - Cloud Files public storage
*   mediagoblin.storage is now fully PEP-8 compliant.
*   mediagoblin.storage:BaseFileStorage precedes CloudFilesStorage
*   Removed all the cloudfiles-specific options from mediagoblin.ini, now it's in the wiki, http://wiki.mediagoblin.org/ConfigureMediaGoblin#Setting_up_Cloud_Files_public_storage
2011-08-04 14:49:12 +02:00
Joar Wandborg
851c51a354 Feature 477 - Support Cloud Files public storage
*   Added configuration options to mediagoblin.ini
*   process_media supports the python-cloudfiles
    almost-file-like objects by wrapping them in a
    contextlib.contextmanager-decorated func.
*   storage now has the CloudFilesStorage
*   New dependency added to setup.py; `python-cloudfiles`
2011-08-04 01:32:34 +02:00
Elrond
eea315623f MountStorage: Better error reporting
Created a new resolver frontend function, that raises and
error, when no backend is found. Useful for all the
wrappers.
2011-08-03 23:13:58 +02:00
Elrond
926aec1473 MountStorage: drop u'' nonsense from mount method
My old resolver couldn't handle empty lists, so for the
mount resolving I appeneded a u'' as dummy element.
Not needed any more.
2011-08-03 23:11:42 +02:00
Elrond
937e2c8811 MountStorage: Create all the wrappers
All those methods just call the appropiate method of the
relevant backend.
2011-08-01 23:50:39 +02:00
Elrond
93b2796c7e MountStorage: Some small fixups/changes.
1) A bit more assert.

2) Change __repr__ to use lists for the recursion parameter.
2011-08-01 23:50:39 +02:00
Elrond
68cf996c1d First start at MountStorage.
This includes the mounttab, a resolver and adding mount entries.
2011-08-01 23:50:39 +02:00
Christopher Allan Webber
3c7d11ff28 renaming storage_system_from_paste_config()->storage_system_from_config()
As Elrond points out, this name doesn't make sense anymore since this
isn't based on the paste config.  Thanks Elrond!
2011-06-19 11:36:52 -05:00
Christopher Allan Webber
6a07362dd0 Adding a copy_locally() method to the StorageInterface and giving it a test. 2011-06-11 12:04:30 -05:00
Christopher Allan Webber
3a89c23e7f Allow storage systems to be local and allow for a get_local_path
method if applicable.
2011-06-11 11:18:03 -05:00
Christopher Allan Webber
d807b7252d Reorganization of storage.py.
Ordering: Errors, Storage interface / implementation, utils.
2011-04-17 10:26:52 -05:00
Christopher Allan Webber
ffa2293549 storage.storage_system_from_paste_config() utility, w/ tests 2011-04-17 10:24:36 -05:00
Christopher Allan Webber
5afb92275c Encourage storage systems to passively accept extraneous keyword
arguments w/ **kwargs.

Also did that for BasicFileStorage.
2011-04-17 09:18:12 -05:00
Christopher Allan Webber
f61a41b89d Import urlparse! Duh. I should remember to turn flymake-mode on. 2011-04-16 12:46:58 -05:00
Christopher Allan Webber
d0e3a5341e "if not os.path.exists(directory)", not "if not os.path.exists('directory')" 2011-04-16 10:59:23 -05:00
Christopher Allan Webber
b0bfb766d9 when running get_unique_filepath, clean_listy_filepath from the get-go 2011-04-16 10:27:03 -05:00
Christopher Allan Webber
b1bb050b27 Added delete_file, url_for_file methods to BasicFileStorage 2011-04-16 09:36:36 -05:00
Will Kahn-Greene
8e1e744d27 Changes Mediagoblin -> MediaGoblin. 2011-04-13 10:04:30 -04:00
Christopher Allan Webber
cee7a1c163 get_file() implementation for BasicFileStorage 2011-04-10 17:03:23 -05:00
Christopher Allan Webber
2fdec8270d We should import uuid, because we use it! 2011-04-10 16:50:52 -05:00
Christopher Allan Webber
2d1a60739e get_unique_filepath not get_unique_filename! 2011-04-10 16:44:47 -05:00
Christopher Allan Webber
644614d4dd Added the url_for_file stub to the interface 2011-04-10 15:01:00 -05:00
Christopher Allan Webber
1118858140 I don't think we need _create_dirs_for_filepath. 2011-04-10 14:57:23 -05:00
Christopher Allan Webber
779f2b9411 Put down structure of BasicFileStorage, and the ._resolve_filepath() method 2011-04-10 13:38:01 -05:00
Christopher Allan Webber
b0de01cf01 More documentation on all the core storage API methods 2011-04-09 14:26:41 -05:00
Christopher Allan Webber
ef10e3a2c7 u'string', but of course ;) 2011-04-09 14:08:07 -05:00
Christopher Allan Webber
0b9cf289c3 Actually, we can implement get_unique_filename, which should be the
same across all storage API implementations
2011-04-09 14:05:44 -05:00
Christopher Allan Webber
797be93ca6 Most of the StorageInterface stubs in place and documented. 2011-04-09 14:02:54 -05:00
Christopher Allan Webber
770c12be8d Raise a specific error if a filename component can't be resolved into anything. 2011-04-09 11:45:38 -05:00
Christopher Allan Webber
a6b378ef4d file storage filelist cleaning 2011-04-09 11:41:09 -05:00