From 040e5cb16b8eb43c11ce1815bb94642ef752c245 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 27 Jun 2023 04:13:57 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- wagtail_wordpress_import/importers/wordpress.py | 2 -- .../management/commands/analyze_xml_content.py | 1 - .../management/commands/delete_imported_pages.py | 1 - wagtail_wordpress_import/management/commands/reduce_xml.py | 2 -- wagtail_wordpress_import/prefilters/handle_shortcodes.py | 1 - wagtail_wordpress_import/test/migrations/0001_initial.py | 1 - wagtail_wordpress_import/test/models.py | 1 - wagtail_wordpress_import/test/tests/test_commands.py | 1 - wagtail_wordpress_import/test/tests/xml_boilerplate.py | 1 - wagtail_wordpress_import/xml_boilerplate.py | 1 - 10 files changed, 12 deletions(-) diff --git a/wagtail_wordpress_import/importers/wordpress.py b/wagtail_wordpress_import/importers/wordpress.py index 8c056580..8143f7a3 100644 --- a/wagtail_wordpress_import/importers/wordpress.py +++ b/wagtail_wordpress_import/importers/wordpress.py @@ -117,7 +117,6 @@ def run(self, *args, **kwargs): item.get("wp:post_type") in kwargs["page_types"] and item.get("wp:status") in kwargs["page_statuses"] ): - wordpress_item = WordpressItem(item, self.logger) try: @@ -263,7 +262,6 @@ def analyze_html(self, html_analyzer, *, page_types, page_statuses): item.get("wp:post_type") in page_types and item.get("wp:status") in page_statuses ): - html_analyzer.analyze( filter_linebreaks_wp(item.get("content:encoded")) ) diff --git a/wagtail_wordpress_import/management/commands/analyze_xml_content.py b/wagtail_wordpress_import/management/commands/analyze_xml_content.py index 652a2452..ac26da7f 100644 --- a/wagtail_wordpress_import/management/commands/analyze_xml_content.py +++ b/wagtail_wordpress_import/management/commands/analyze_xml_content.py @@ -7,7 +7,6 @@ class Command(BaseCommand): - help = """Utils to output xml structure to a json file.""" # def __init__(self, *args, **kwargs): diff --git a/wagtail_wordpress_import/management/commands/delete_imported_pages.py b/wagtail_wordpress_import/management/commands/delete_imported_pages.py index a36e77e7..16e6b0f9 100644 --- a/wagtail_wordpress_import/management/commands/delete_imported_pages.py +++ b/wagtail_wordpress_import/management/commands/delete_imported_pages.py @@ -39,7 +39,6 @@ def add_arguments(self, parser): ) def handle(self, *args, **options): - parent = None pages_to_delete = None diff --git a/wagtail_wordpress_import/management/commands/reduce_xml.py b/wagtail_wordpress_import/management/commands/reduce_xml.py index 922ab963..7e76331b 100644 --- a/wagtail_wordpress_import/management/commands/reduce_xml.py +++ b/wagtail_wordpress_import/management/commands/reduce_xml.py @@ -20,7 +20,6 @@ def generate_stats_file(file_path, type_stats): class Command(BaseCommand): - help = """Utils to reduce xml file size by removing unwanted tags.""" """ @@ -31,7 +30,6 @@ def add_arguments(self, parser): parser.add_argument("xml_file", type=str, help="The full path to your xml file") def get_xml_file(self, xml_file): - if os.path.exists(xml_file): return xml_file diff --git a/wagtail_wordpress_import/prefilters/handle_shortcodes.py b/wagtail_wordpress_import/prefilters/handle_shortcodes.py index c4028102..8cd7d862 100644 --- a/wagtail_wordpress_import/prefilters/handle_shortcodes.py +++ b/wagtail_wordpress_import/prefilters/handle_shortcodes.py @@ -25,7 +25,6 @@ def _wrapper(cls): class BlockShortcodeHandler: - shortcode_name: str is_top_level_html_tag = True diff --git a/wagtail_wordpress_import/test/migrations/0001_initial.py b/wagtail_wordpress_import/test/migrations/0001_initial.py index 6a9d7518..0e78ec6f 100644 --- a/wagtail_wordpress_import/test/migrations/0001_initial.py +++ b/wagtail_wordpress_import/test/migrations/0001_initial.py @@ -18,7 +18,6 @@ class Migration(migrations.Migration): - streamfield_kwargs = {"use_json_field": True} if WAGTAIL_VERSION >= (3, 0) else {} initial = True diff --git a/wagtail_wordpress_import/test/models.py b/wagtail_wordpress_import/test/models.py index c15b4212..c62f6fa9 100644 --- a/wagtail_wordpress_import/test/models.py +++ b/wagtail_wordpress_import/test/models.py @@ -32,7 +32,6 @@ class Meta: class TestPage(WPImportedPageMixin, Page): - streamfield_kwargs = {"use_json_field": True} if WAGTAIL_VERSION >= (3, 0) else {} body = StreamField(WPImportStreamBlocks, **streamfield_kwargs) diff --git a/wagtail_wordpress_import/test/tests/test_commands.py b/wagtail_wordpress_import/test/tests/test_commands.py index 97c7db5b..2cfd6e9e 100644 --- a/wagtail_wordpress_import/test/tests/test_commands.py +++ b/wagtail_wordpress_import/test/tests/test_commands.py @@ -73,7 +73,6 @@ def test_run_with_xml_and_parent_id(self): WAGTAIL_WORDPRESS_IMPORTER_SOURCE_DOMAIN="http://www.example.com", ) class TestImportXmlCommandCompletes(TestCase): - fixtures = [ f"{FIXTURES_PATH}/dump.json", ] diff --git a/wagtail_wordpress_import/test/tests/xml_boilerplate.py b/wagtail_wordpress_import/test/tests/xml_boilerplate.py index 11ab0b2e..6f5e5f27 100644 --- a/wagtail_wordpress_import/test/tests/xml_boilerplate.py +++ b/wagtail_wordpress_import/test/tests/xml_boilerplate.py @@ -31,7 +31,6 @@ def build_xml_stream(xml_tags_fragment="", xml_items_fragment=""): def generate_temporay_file(xml_stream): - temp_file = tempfile.NamedTemporaryFile(delete=False) with open(temp_file.name, "w") as f: diff --git a/wagtail_wordpress_import/xml_boilerplate.py b/wagtail_wordpress_import/xml_boilerplate.py index e4ac0e27..d1c53a05 100644 --- a/wagtail_wordpress_import/xml_boilerplate.py +++ b/wagtail_wordpress_import/xml_boilerplate.py @@ -31,7 +31,6 @@ def build_xml_stream(xml_tags_fragment="", xml_items_fragment=""): def generate_temporary_file(xml_stream): - temp_file = tempfile.NamedTemporaryFile(delete=False) with open(temp_file.name, "w") as f: