提交 c8193062 编写于 作者: W wuzewu

add TEXT type support

上级 fb0e8026
......@@ -65,6 +65,8 @@ class DataType(Enum):
if data_type == DataType.IMAGE:
return ImageReader
elif data_type == DataType.TEXT:
return TextReader
else:
type_str = DataType.str(data_type)
logger.critical(
......@@ -78,3 +80,9 @@ class ImageReader:
utils.check_path(path)
image = Image.open(path)
return image
class TextReader:
@classmethod
def read(cls, text):
return text
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册