aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodney Ewing <ewing.rj@gmail.com>2013-08-12 15:48:40 -0700
committerRodney Ewing <ewing.rj@gmail.com>2013-08-16 15:30:18 -0700
commit36c17b85c12546076067e039e5f55c7780dc54f3 (patch)
tree0f43323013f7a104ea9ea1c89386350cf7c67716
parenta7f426368dfce15f86fa0ef56200ec1228f6e4af (diff)
downloadmediagoblin-36c17b85c12546076067e039e5f55c7780dc54f3.tar.lz
mediagoblin-36c17b85c12546076067e039e5f55c7780dc54f3.tar.xz
mediagoblin-36c17b85c12546076067e039e5f55c7780dc54f3.zip
remove old code
-rw-r--r--mediagoblin/gmg_commands/reprocess.py118
-rw-r--r--mediagoblin/media_types/image/__init__.py1
2 files changed, 0 insertions, 119 deletions
diff --git a/mediagoblin/gmg_commands/reprocess.py b/mediagoblin/gmg_commands/reprocess.py
index 3ba5d92c..5285942e 100644
--- a/mediagoblin/gmg_commands/reprocess.py
+++ b/mediagoblin/gmg_commands/reprocess.py
@@ -131,124 +131,6 @@ def reprocess_parser_setup(subparser):
###############
-
-def _set_media_type(args):
- """
- This will verify that all media id's are of the same media_type. If the
- --type flag is set, it will be replaced by the given media id's type.
-
- If they are trying to process different media types, an Exception will be
- raised.
- """
- if args[0].media_id:
- if len(args[0].media_id) == 1:
- args[0].type = MediaEntry.query.filter_by(id=args[0].media_id[0])\
- .first().media_type.split('.')[-1]
-
- elif len(args[0].media_id) > 1:
- media_types = []
-
- for id in args[0].media_id:
- media_types.append(MediaEntry.query.filter_by(id=id).first()
- .media_type.split('.')[-1])
- for type in media_types:
- if media_types[0] != type:
- raise Exception((u'You cannot reprocess different'
- ' media_types at the same time.'))
-
- args[0].type = media_types[0]
-
-
-def _reprocess_all(args):
- """
- This handles reprocessing if no media_id's are given.
- """
- if not args[0].type:
- # If no media type is given, we can either regenerate all thumbnails,
- # or try to reprocess all failed media
-
- if args[0].thumbnails:
- if args[0].available:
- print _('Available options for regenerating all processed'
- ' media thumbnails: \n'
- '\t --size: max_width max_height'
- ' (defaults to config specs)')
- else:
- #TODO regenerate all thumbnails
- pass
-
- # Reprocess all failed media
- elif args[0].state == 'failed':
- if args[0].available:
- print _('\n Available reprocess actions for all failed'
- ' media_entries: \n \t --initial_processing')
- else:
- #TODO reprocess all failed entries
- pass
-
- # If here, they didn't set the --type flag and were trying to do
- # something other the generating thumbnails or initial_processing
- else:
- raise Exception(_('You must set --type when trying to reprocess'
- ' all media_entries, unless you set --state'
- ' to "failed".'))
-
- else:
- _run_reprocessing(args)
-
-
-def _run_reprocessing(args):
- # Are they just asking for the available reprocessing options for the given
- # media?
- if args[0].available:
- if args[0].state == 'failed':
- print _('\n Available reprocess actions for all failed'
- ' media_entries: \n \t --initial_processing')
- else:
- result = hook_handle(('reprocess_action', args[0].type), args)
- if not result:
- print _('Sorry there is no available reprocessing for {}'
- ' entries in the {} state'.format(args[0].type,
- args[0].state))
- else:
- # Run media reprocessing
- return hook_handle(('media_reprocess', args[0].type), args)
-
-
-def _set_media_state(args):
- """
- This will verify that all media id's are in the same state. If the
- --state flag is set, it will be replaced by the given media id's state.
-
- If they are trying to process different media states, an Exception will be
- raised.
- """
- if args[0].media_id:
- # Only check if we are given media_ids
- if len(args[0].media_id) == 1:
- args[0].state = MediaEntry.query.filter_by(id=args[0].media_id[0])\
- .first().state
-
- elif len(args[0].media_id) > 1:
- media_states = []
-
- for id in args[0].media_id:
- media_states.append(MediaEntry.query.filter_by(id=id).first()
- .state)
-
- # Make sure that all media are in the same state
- for state in media_states:
- if state != media_states[0]:
- raise Exception(_('You can only reprocess media that is in'
- ' the same state.'))
-
- args[0].state = media_states[0]
-
- # If no state was set, then we will default to the processed state
- if not args[0].state:
- args[0].state = 'processed'
-
-
def available(args):
# Get the media type, either by looking up media id, or by specific type
try:
diff --git a/mediagoblin/media_types/image/__init__.py b/mediagoblin/media_types/image/__init__.py
index f8c4a7d1..99643409 100644
--- a/mediagoblin/media_types/image/__init__.py
+++ b/mediagoblin/media_types/image/__init__.py
@@ -72,5 +72,4 @@ hooks = {
'sniff_handler': sniff_handler,
('media_manager', MEDIA_TYPE): lambda: ImageMediaManager,
('reprocess_manager', MEDIA_TYPE): lambda: ImageProcessingManager,
- # ('media_reprocess', MEDIA_TYPE): ProcessImage().media_reprocess,
}