parameters: (media)
return_statement: return Status.SUCCESS
docstring: Process a non-media file: copy and create thumbnail.
docstring_summary: Process a non-media file: copy and create thumbnail.
docstring_tokens: Process a non - media file : copy and create thumbnail .
function: def process_nonmedia(media):
      """Process a non-media file: copy and create thumbnail."""
      logger.info('Processing non-media file: %s', media.dst_filename)
      settings = media.settings
      plugin_settings = settings.get('nonmedia_files_options', {})
  
      try:
          utils.copy(media.src_path, media.dst_path, symlink=settings['orig_link'])
      except Exception:
          if logger.getEffectiveLevel() == logging.DEBUG:
              raise
          else:
              return Status.FAILURE
  
      if plugin_settings.get('ext_as_thumb', DEFAULT_CONFIG['ext_as_thumb']):
          logger.info('plugin_settings: %r', plugin_settings)
          try:
              kwargs = {}
              if plugin_settings.get('thumb_font', None):
                  kwargs['font'] = plugin_settings['thumb_font']
              if plugin_settings.get('thumb_bg_color', None):
                  kwargs['bg_color'] = plugin_settings['thumb_bg_color']
              if plugin_settings.get('thumb_font_color', None):
                  kwargs['font_color'] = plugin_settings['thumb_font_color']
              generate_thumbnail(
                  media.src_ext[1:].upper(),
                  media.thumb_path,
                  settings['thumb_size'],
                  options=settings['jpg_options'],
                  **kwargs,
              )
          except Exception:
              if logger.getEffectiveLevel() == logging.DEBUG:
                  raise
              else:
                  return Status.FAILURE
      return Status.SUCCESS
function_tokens: def process_nonmedia ( media ) : logger . info ( 'Processing non-media file: %s' , media . dst_filename ) settings = media . settings plugin_settings = settings . get ( 'nonmedia_files_options' , { } ) try : utils . copy ( media . src_path , media . dst_path , symlink = settings [ 'orig_link' ] ) except Exception : if logger . getEffectiveLevel ( ) == logging . DEBUG : raise else : return Status . FAILURE if plugin_settings . get ( 'ext_as_thumb' , DEFAULT_CONFIG [ 'ext_as_thumb' ] ) : logger . info ( 'plugin_settings: %r' , plugin_settings ) try : kwargs = { } if plugin_settings . get ( 'thumb_font' , None ) : kwargs [ 'font' ] = plugin_settings [ 'thumb_font' ] if plugin_settings . get ( 'thumb_bg_color' , None ) : kwargs [ 'bg_color' ] = plugin_settings [ 'thumb_bg_color' ] if plugin_settings . get ( 'thumb_font_color' , None ) : kwargs [ 'font_color' ] = plugin_settings [ 'thumb_font_color' ] generate_thumbnail ( media . src_ext [ 1 : ] . upper ( ) , media . thumb_path , settings [ 'thumb_size' ] , options = settings [ 'jpg_options' ] , * * kwargs , ) except Exception : if logger . getEffectiveLevel ( ) == logging . DEBUG : raise else : return Status . FAILURE return Status . SUCCESS