aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/processing
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/processing')
-rw-r--r--mediagoblin/processing/__init__.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/mediagoblin/processing/__init__.py b/mediagoblin/processing/__init__.py
index 361a9736..246091d6 100644
--- a/mediagoblin/processing/__init__.py
+++ b/mediagoblin/processing/__init__.py
@@ -14,7 +14,13 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from collections import OrderedDict
+# Use an ordered dict if we can. If not, we'll just use a normal dict
+# later.
+try:
+ from collections import OrderedDict
+except:
+ OrderedDict = None
+
import logging
import os
@@ -187,7 +193,10 @@ class ProcessingManager(object):
"""
def __init__(self):
# Dict of all MediaProcessors of this media type
- self.processors = OrderedDict()
+ if OrderedDict is not None:
+ self.processors = OrderedDict()
+ else:
+ self.processors = {}
def add_processor(self, processor):
"""
@@ -376,8 +385,7 @@ def store_public(entry, keyname, local_file, target_name=None,
raise PublicStoreFail(keyname=keyname)
# raise an error if the file failed to copy
- copied_filepath = mgg.public_store.get_local_path(target_filepath)
- if not os.path.exists(copied_filepath):
+ if not mgg.public_store.file_exists(target_filepath):
raise PublicStoreFail(keyname=keyname)
entry.media_files[keyname] = target_filepath