Skip to content

Commit

Permalink
Run format and lint with project specification.
Browse files Browse the repository at this point in the history
  • Loading branch information
FunkyOz committed Feb 28, 2024
1 parent 4536984 commit 5ab39eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
class RTFReader(BaseReader):
"""RTF (Rich Text Format) Reader. Reads rtf file and convert to Document."""

def load_data(self, input_file: Union[Path, str], extra_info=Dict[str, Any], **load_kwargs: Any) -> List[Document]:
def load_data(
self,
input_file: Union[Path, str],
extra_info=Dict[str, Any],
**load_kwargs: Any
) -> List[Document]:
"""Load data from RTF file.
Args:
Expand All @@ -24,6 +29,6 @@ def load_data(self, input_file: Union[Path, str], extra_info=Dict[str, Any], **l
except ImportError:
raise ImportError("striprtf is required to read RTF files.")

with open(str(input_file), "r") as f:
with open(str(input_file)) as f:
text = rtf_to_text(f.read())
return [Document(text=text.strip())]
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ PagedCSVReader = "thejessezhang"
PandasCSVReader = "ephe-meral"
PptxReader = "thejessezhang"
PyMuPDFReader = "iamarunbrahma"
RTFReader = "FunkyOz"
UnstructuredReader = "thejessezhang"
VideoAudioReader = "llama-index"
XMLReader = "mmaatouk"
RTFReader = "FunkyOz"

[tool.mypy]
disallow_untyped_defs = true
Expand Down

0 comments on commit 5ab39eb

Please sign in to comment.