You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
365 B
Python
18 lines
365 B
Python
2 years ago
|
from .home import Home
|
||
|
|
||
|
class Resource:
|
||
|
resource_types = [Home]
|
||
|
|
||
|
@classmethod
|
||
|
def from_name(cls, name):
|
||
|
"""
|
||
|
from_name is to be implemented by resource classes
|
||
|
"""
|
||
|
for T in cls.resource_types:
|
||
|
if r := T.from_name(name):
|
||
|
return r
|
||
|
return None
|
||
|
|
||
|
def when(self, when_text):
|
||
|
pass
|