pybackive/backive/core/tool.py

21 lines
374 B
Python
Raw Normal View History

2019-01-06 21:29:21 +01:00
import os
AVAILABLE_TOOLS = {}
def register_tool(name):
def decorator(Cls):
AVAILABLE_TOOLS.update({name: Cls})
return decorator
class Tool:
def __init__(self, options):
pass
@classmethod
def instance(cls, name, options):
if name in AVAILABLE_TOOLS:
return AVAILABLE_TOOLS.get(name)(options)
return None