from botornado.s3.bucket import AsyncBucket
from botornado.s3.connection import AsyncS3Connection
from botornado.s3.key import AsyncKey

from thumbor_botornado.s3_loader import S3Loader
from thumbor.loaders.http_loader import HttpLoader

def load(context, url, callback):
	p = re.compile('/^https?:/i')
	m = p.match(url)
	if m:
		HttpLoader.load(context, url, callback)
	else:
		S3Loader.load(context, url, callback)

import thumbor_botornado.s3_loader as S3Loader
import thumbor.loaders.http_loader as HttpLoader
import re

def load(context, url, callback):
	if re.match('https?:', url, re.IGNORECASE):
		HttpLoader.load(context, url, callback)
	else:
		S3Loader.load(context, url, callback)

Add s3-http loader which delegates based on the uri
Add s3-http loader which delegates based on the uri

- from botornado.s3.bucket import AsyncBucket
- from botornado.s3.connection import AsyncS3Connection
- from botornado.s3.key import AsyncKey
- 
- from thumbor_botornado.s3_loader import S3Loader
+ import thumbor_botornado.s3_loader as S3Loader
- from thumbor.loaders.http_loader import HttpLoader
+ import thumbor.loaders.http_loader as HttpLoader
+ import re
  
  def load(context, url, callback):
+ 	if re.match('https?:', url, re.IGNORECASE):
- 	p = re.compile('/^https?:/i')
- 	m = p.match(url)
- 	if m:
  		HttpLoader.load(context, url, callback)
  	else:
  		S3Loader.load(context, url, callback)
  
Add s3-http loader which delegates based on the uri
## Code Before:
from botornado.s3.bucket import AsyncBucket
from botornado.s3.connection import AsyncS3Connection
from botornado.s3.key import AsyncKey

from thumbor_botornado.s3_loader import S3Loader
from thumbor.loaders.http_loader import HttpLoader

def load(context, url, callback):
	p = re.compile('/^https?:/i')
	m = p.match(url)
	if m:
		HttpLoader.load(context, url, callback)
	else:
		S3Loader.load(context, url, callback)

## Instruction:
Add s3-http loader which delegates based on the uri
## Code After:
import thumbor_botornado.s3_loader as S3Loader
import thumbor.loaders.http_loader as HttpLoader
import re

def load(context, url, callback):
	if re.match('https?:', url, re.IGNORECASE):
		HttpLoader.load(context, url, callback)
	else:
		S3Loader.load(context, url, callback)
