diff --git a/src/osintbuddy/elements/__init__.py b/src/osintbuddy/elements/__init__.py index d2e32e1..6c501b7 100644 --- a/src/osintbuddy/elements/__init__.py +++ b/src/osintbuddy/elements/__init__.py @@ -18,4 +18,5 @@ DropdownInput, NumberInput, DecimalInput, + TextAreaInput ) diff --git a/src/osintbuddy/elements/inputs.py b/src/osintbuddy/elements/inputs.py index 2647763..79c8a4c 100644 --- a/src/osintbuddy/elements/inputs.py +++ b/src/osintbuddy/elements/inputs.py @@ -57,6 +57,31 @@ def to_dict(self): return self._base_entity_element(**self.element) +class TextAreaInput(BaseInput): + """The TextInput class represents a text input node used + in the OsintBuddy plugin system. + value : str + The value stored in the element. + icon : str + The icon to be displayed with the input element. + default : str + The default value for the input element. + + Usage Example: + class Plugin(OBPlugin): + node = [TextInput(label='Email search', placeholder='Enter email')] + """ + element_type: str = "textarea" + + def __init__(self, value="", default="", icon="IconAlphabetLatin", **kwargs): + super().__init__(**kwargs) + self.element = { + "value": value, + } + def to_dict(self): + return self._base_entity_element(**self.element) + + class DropdownInput(BaseInput): """ The DropdownInput class represents a dropdown menu node used diff --git a/src/osintbuddy/plugins.py b/src/osintbuddy/plugins.py index b6293e2..1f8b5fa 100755 --- a/src/osintbuddy/plugins.py +++ b/src/osintbuddy/plugins.py @@ -1,4 +1,4 @@ -import os, imp, importlib, inspect +import os, imp, importlib, inspect, sys from typing import List, Any, Callable from collections import defaultdict from pydantic import BaseModel, ConfigDict @@ -280,9 +280,10 @@ async def get_transform(self, transform_type: str, entity, use: OBAuthorUse) -> ] return transform except (Exception, OBPluginError) as e: - if isinstance(e, OBPluginError): - raise OBPluginError(e) - raise OBPluginError(f'This plugin has run into an unhandled error: {e}') + raise e + # exc_type, exc_obj, exc_tb = sys.exc_info() + # fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1] + # raise OBPluginError(f"Unhandled plugin error! {exc_type}\nPlease see {fname} on line no. {exc_tb.tb_lineno}\n{e}") return None @staticmethod