def s3_get_extension(request=None):
 if (request is None):
  request = current.request
 extension = request.extension
 if ((request.function == 'ticket') and (request.controller == 'admin')):
  extension = 'html'
 elif ('format' in request.get_vars):
  ext = request.get_vars.format
  if isinstance(ext, list):
   ext = ext[(-1)]
  extension = (ext.lower() or extension)
 else:
  ext = None
  for arg in request.args[::(-1)]:
   if ('.' in arg):
    ext = arg.rsplit('.', 1)[1].lower()
    break
  if ext:
   extension = ext
 return extension

def s3_get_extension ( request = None ) : if ( request is None ) : request = current . request extension = request . extension if ( ( request . function == 'ticket' ) and ( request . controller == 'admin' ) ) : extension = 'html' elif ( 'format' in request . get_vars ) : ext = request . get_vars . format if isinstance ( ext , list ) : ext = ext [ ( - 1 ) ] extension = ( ext . lower ( ) or extension ) else : ext = None for arg in request . args [ : : ( - 1 ) ] : if ( '.' in arg ) : ext = arg . rsplit ( '.' , 1 ) [ 1 ] . lower ( ) break if ext : extension = ext return extension
get the file extension in the path of the request .