You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
655 B

class Loader:
""" Abstract Loader Class """
def load(uri):
Load the uri ressource
:return: <RGB> image
def uri_validator(uri):
Validate the uri for the loader
:return: <bool> True is a valid uri
return False
def get_loader(uri):
from loader.fs import FSLoader
from loader.http import HTTPLoader
for loader in (FSLoader, HTTPLoader):
if loader.uri_validator(uri):
return loader
return None