Skip to content

Commit

Permalink
Fix max_nb_chars parameter when adding paragraphs (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinburchell authored Nov 14, 2024
1 parent 9beae4b commit 774709b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/faker_file/contrib/docx_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def add_page_break(provider, document, data, counter, **kwargs):
def add_paragraph(provider, document, data, counter, **kwargs):
"""Callable responsible for the paragraph generation."""
content = kwargs.get("content", None)
max_nb_chars = kwargs.get("content", 5_000)
max_nb_chars = kwargs.get("max_nb_chars", 5_000)
wrap_chars_after = kwargs.get("wrap_chars_after", None)
format_func = kwargs.get("format_func", DEFAULT_FORMAT_FUNC)

Expand All @@ -95,7 +95,7 @@ def add_paragraph(provider, document, data, counter, **kwargs):
def add_heading(provider, document, data, counter, **kwargs):
"""Callable responsible for the heading generation."""
content = kwargs.get("content", None)
max_nb_chars = kwargs.get("content", 30)
max_nb_chars = kwargs.get("max_nb_chars", 30)
wrap_chars_after = kwargs.get("wrap_chars_after", None)
format_func = kwargs.get("format_func", DEFAULT_FORMAT_FUNC)
level = kwargs.get("level", 0)
Expand Down
2 changes: 1 addition & 1 deletion src/faker_file/contrib/image/weasyprint_snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def add_paragraph(
):
"""Callable responsible for paragraph generation using pdfkit."""
content = kwargs.get("content", None)
max_nb_chars = kwargs.get("content", 5_000)
max_nb_chars = kwargs.get("max_nb_chars", 5_000)
wrap_chars_after = kwargs.get("wrap_chars_after", None)
format_func = kwargs.get("format_func", DEFAULT_FORMAT_FUNC)

Expand Down
4 changes: 2 additions & 2 deletions src/faker_file/contrib/odt_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def add_page_break(provider, document, data, counter, **kwargs):
def add_paragraph(provider, document, data, counter, **kwargs):
"""Callable responsible for the paragraph generation."""
content = kwargs.get("content", None)
max_nb_chars = kwargs.get("content", 5_000)
max_nb_chars = kwargs.get("max_nb_chars", 5_000)
wrap_chars_after = kwargs.get("wrap_chars_after", None)
format_func = kwargs.get("format_func", DEFAULT_FORMAT_FUNC)

Expand All @@ -147,7 +147,7 @@ def add_paragraph(provider, document, data, counter, **kwargs):
def add_heading(provider, document, data, counter, **kwargs):
"""Callable responsible for the heading generation."""
content = kwargs.get("content", None)
max_nb_chars = kwargs.get("content", 30)
max_nb_chars = kwargs.get("max_nb_chars", 30)
wrap_chars_after = kwargs.get("wrap_chars_after", None)
format_func = kwargs.get("format_func", DEFAULT_FORMAT_FUNC)
level = kwargs.get("level", 1)
Expand Down
2 changes: 1 addition & 1 deletion src/faker_file/contrib/pdf_file/pdfkit_snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def add_paragraph(
):
"""Callable responsible for paragraph generation using pdfkit."""
content = kwargs.get("content", None)
max_nb_chars = kwargs.get("content", 5_000)
max_nb_chars = kwargs.get("max_nb_chars", 5_000)
wrap_chars_after = kwargs.get("wrap_chars_after", None)
format_func = kwargs.get("format_func", DEFAULT_FORMAT_FUNC)

Expand Down
2 changes: 1 addition & 1 deletion src/faker_file/contrib/pdf_file/reportlab_snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def add_paragraph(
):
"""Add paragraph function."""
content = kwargs.get("content", None)
max_nb_chars = kwargs.get("content", 5_000)
max_nb_chars = kwargs.get("max_nb_chars", 5_000)
wrap_chars_after = kwargs.get("wrap_chars_after", None)
format_func = kwargs.get("format_func", DEFAULT_FORMAT_FUNC)

Expand Down

0 comments on commit 774709b

Please sign in to comment.