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

"""Loader."""
class Loader:
""" Abstract Loader Class """
@staticmethod
def load(uri):
"""
Load the uri ressource
:return: <RGB> image
"""
pass
@staticmethod
def uri_validator(uri):
"""
Validate the uri for the loader
:return: <bool> True is a valid uri
"""
return False
@staticmethod
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