aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/gmg_commands/import_export.py
diff options
context:
space:
mode:
authorJoar Wandborg <git@wandborg.com>2011-12-15 23:49:52 +0100
committerJoar Wandborg <git@wandborg.com>2011-12-15 23:49:52 +0100
commit8eb216388f0999115d68c33e2fe2460bc9986112 (patch)
treec654d4e2a74168c79847811b37afd682b57ce1ce /mediagoblin/gmg_commands/import_export.py
parente365f980ac21a403a50f61ae687d7dc04760f8bb (diff)
downloadmediagoblin-8eb216388f0999115d68c33e2fe2460bc9986112.tar.lz
mediagoblin-8eb216388f0999115d68c33e2fe2460bc9986112.tar.xz
mediagoblin-8eb216388f0999115d68c33e2fe2460bc9986112.zip
Fixed import_export
- Mongokit instead of pymongo - db.MediaEntry instead of db.media_entry (pymongo style)
Diffstat (limited to 'mediagoblin/gmg_commands/import_export.py')
-rw-r--r--mediagoblin/gmg_commands/import_export.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/mediagoblin/gmg_commands/import_export.py b/mediagoblin/gmg_commands/import_export.py
index 1308f09e..eda41f4c 100644
--- a/mediagoblin/gmg_commands/import_export.py
+++ b/mediagoblin/gmg_commands/import_export.py
@@ -64,7 +64,7 @@ def _import_media(db, args):
queue_cache = BasicFileStorage(
args._cache_path['queue'])
- for entry in db.media_entries.find():
+ for entry in db.MediaEntry.find():
for name, path in entry['media_files'].items():
_log.info('Importing: {0} - {1}'.format(
entry.title,
@@ -107,7 +107,7 @@ def env_import(args):
global_config, app_config = setup_global_and_app_config(args.conf_file)
connection, db = setup_connection_and_db_from_config(
- app_config, use_pymongo=True)
+ app_config)
tf = tarfile.open(
args.tar_file,
@@ -206,7 +206,7 @@ def _export_media(db, args):
queue_cache = BasicFileStorage(
args._cache_path['queue'])
- for entry in db.media_entries.find():
+ for entry in db.MediaEntry.find():
for name, path in entry['media_files'].items():
_log.info(u'Exporting {0} - {1}'.format(
entry.title,
@@ -215,7 +215,7 @@ def _export_media(db, args):
mc_file = media_cache.get_file(path, mode='wb')
mc_file.write(
mg_globals.public_store.get_file(path, mode='rb').read())
- except e:
+ except Exception as e:
_log.error('Failed: {0}'.format(e))
_log.info('...Media exported')
@@ -246,7 +246,7 @@ def env_export(args):
setup_storage()
connection, db = setup_connection_and_db_from_config(
- app_config, use_pymongo=True)
+ app_config)
_export_database(db, args)