From 933ed32d331fcedd44169d8685d7071e49858a98 Mon Sep 17 00:00:00 2001 From: Adrien Barbaresi Date: Mon, 7 Oct 2024 14:01:27 +0200 Subject: [PATCH] setup: remove current GUI (#713) * setup: deprecate current GUI * adapt coverage config --- .coveragerc | 1 - README.md | 1 - docs/index.rst | 1 - setup.py | 4 --- trafilatura/gui.py | 67 ---------------------------------------------- 5 files changed, 74 deletions(-) delete mode 100644 trafilatura/gui.py diff --git a/.coveragerc b/.coveragerc index ac4a77f9..49a1728c 100644 --- a/.coveragerc +++ b/.coveragerc @@ -4,7 +4,6 @@ source = trafilatura omit = tests/* setup.py - trafilatura/gui.py [report] exclude_lines = diff --git a/README.md b/README.md index 6455dce9..77912006 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,6 @@ search engine optimization, and information security). - Optional add-ons: - Language detection on extracted content - - Graphical user interface (GUI) - Speed optimizations - Actively maintained with support from the open-source community: diff --git a/docs/index.rst b/docs/index.rst index 41009acd..3bce9954 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -66,7 +66,6 @@ Features - HTML, XML and `XML-TEI `_ - Optional add-ons: - Language detection on extracted content - - Graphical user interface (GUI) - Speed optimizations - Actively maintained with support from the open-source community: - Regular updates, feature additions, and optimizations diff --git a/setup.py b/setup.py index 6e41531a..f18ab370 100644 --- a/setup.py +++ b/setup.py @@ -34,9 +34,6 @@ def get_long_description(): "urllib3[socks]", "zstandard >= 0.20.0", ], - "gui": [ - "Gooey >= 1.0.1", - ], } setup( @@ -120,7 +117,6 @@ def get_long_description(): entry_points={ "console_scripts": [ "trafilatura=trafilatura.cli:main", - "trafilatura_gui=trafilatura.gui:main", ], }, # platforms='any', diff --git a/trafilatura/gui.py b/trafilatura/gui.py deleted file mode 100644 index 1c5fc21b..00000000 --- a/trafilatura/gui.py +++ /dev/null @@ -1,67 +0,0 @@ -""" -This script implements a basic guided user interface (GUI). -""" - -import sys - -from gooey import Gooey, GooeyParser - -from . import __version__ -from .cli import add_args, process_args - - -DESCRIPTION = 'Web scraping tool for text discovery and extraction' - - -@Gooey( - program_name='Trafilatura Graphical User Interface', - default_size=(840, 720), - tabbed_groups=True, - required_cols=1, - optional_cols=1, - run_validators=True, - clear_before_run=True, - menu=[{ - 'name': 'File', - 'items': [{ - 'type': 'AboutDialog', - 'menuTitle': 'About', - 'name': 'Trafilatura-GUI', - 'description': DESCRIPTION, - 'version': __version__, - 'copyright': '2021', - 'website': 'https://trafilatura.readthedocs.io', - 'developer': 'Adrien Barbaresi', - 'license': "Apache 2.0" - }, { - 'type': 'Link', - 'menuTitle': 'Visit the website', - 'url': 'https://trafilatura.readthedocs.io' - }] - },{ - 'name': 'Help', - 'items': [{ - 'type': 'Link', - 'menuTitle': 'Documentation', - 'url': 'https://trafilatura.readthedocs.io/' - }] - }] -) - - -def main(): - "Run as a Gooey/GUI utility." - parser = GooeyParser(description=DESCRIPTION) - parser = add_args(parser) - - # https://github.com/chriskiehl/Gooey/blob/master/docs/Gooey-Options.md - args = parser.parse_args(sys.argv[1:]) - # safety: no input - if not args.URL and not args.inputfile and not args.inputdir: - sys.exit("Missing input, exiting.") - # process - process_args(args) - - -if __name__ == '__main__': - main()