diff options
Diffstat (limited to 'python-get-gecko-driver.spec')
-rw-r--r-- | python-get-gecko-driver.spec | 330 |
1 files changed, 330 insertions, 0 deletions
diff --git a/python-get-gecko-driver.spec b/python-get-gecko-driver.spec new file mode 100644 index 0000000..a01f182 --- /dev/null +++ b/python-get-gecko-driver.spec @@ -0,0 +1,330 @@ +%global _empty_manifest_terminate_build 0 +Name: python-get-gecko-driver +Version: 1.3.10 +Release: 1 +Summary: A tool to download and install GeckoDriver. +License: MIT +URL: https://github.com/zaironjacobs/get-gecko-driver +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/3d/4a/2cf4b05f4cf6f8019ee45fc4ed66a998bdd540f65eccc227378c05bffa7c/get-gecko-driver-1.3.10.tar.gz +BuildArch: noarch + + +%description +[](https://pypi.python.org/pypi/get-gecko-driver) +[](https://pypi.python.org/pypi/get-gecko-driver) +[](https://pypi.python.org/pypi/get-gecko-driver) +[](https://pypi.python.org/pypi/get-gecko-driver) +A tool to download and install GeckoDriver. Download the latest version or another specific version. You can use this +tool as a package import or as a command-line application. +This Python package runs through a Jenkins test pipeline every hour to ensure proper functionality. +## Install +To install: +```console +pip install get-gecko-driver +``` +To upgrade: +```console +pip install get-gecko-driver --upgrade +``` +## Usage +#### Install and use GeckoDriver with Selenium +```Python +import time +from get_gecko_driver import GetGeckoDriver +from selenium import webdriver +# Install the driver: +# Downloads the latest GeckoDriver version +# Adds the downloaded GeckoDriver to path +get_driver = GetGeckoDriver() +get_driver.install() +# Use the installed GeckoDriver with Selenium +driver = webdriver.Firefox() +driver.get("https://google.com") +time.sleep(3) +driver.quit() +``` +#### For downloading only +```Python +from get_gecko_driver import GetGeckoDriver +get_driver = GetGeckoDriver() +# Print the latest version +print(get_driver.latest_version()) +# Print the latest version download link +print(get_driver.latest_version_url()) +# Print the download link of a specific version +print(get_driver.version_url('0.27.0')) +# Download the latest driver version +# Optional: use output_path= to specify where to download the driver +# Optional: use extract=True to extract the file +get_driver.download_latest_version(extract=True) +# Download a specific driver version +# Optional: use output_path= to specify where to download the driver +# Optional: use extract=True to extract the file +get_driver.download_version('0.27.0', extract=True) +``` +#### Command-line +Print the latest version url of all platforms: +```console +get-gecko-driver --latest-urls +``` +Print the latest version: +```console +get-gecko-driver --latest-version +``` +Print the latest version url: +```console +get-gecko-driver --latest-url +``` +Download the latest version and extract the file: +```console +get-gecko-driver --download-latest --extract +``` +Download a specific version and extract the file: +```console +get-gecko-driver --download-version 0.27.0 --extract +``` +#### The downloaded driver can be found at: +*`<current directory>/<geckodriver>/<version>/<bin>/<geckodriver>`* +### Options +``` +--help Show help. +--latest-version Print the latest version. +--latest-urls Print the latest version urls for all platforms. +--version-url Print the version url. +--latest-url Print the latest version url. +--download-latest Download the latest version. +--download-version Download a specific version. +--extract Extract the compressed driver file. +--version App version. +``` + +%package -n python3-get-gecko-driver +Summary: A tool to download and install GeckoDriver. +Provides: python-get-gecko-driver +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-get-gecko-driver +[](https://pypi.python.org/pypi/get-gecko-driver) +[](https://pypi.python.org/pypi/get-gecko-driver) +[](https://pypi.python.org/pypi/get-gecko-driver) +[](https://pypi.python.org/pypi/get-gecko-driver) +A tool to download and install GeckoDriver. Download the latest version or another specific version. You can use this +tool as a package import or as a command-line application. +This Python package runs through a Jenkins test pipeline every hour to ensure proper functionality. +## Install +To install: +```console +pip install get-gecko-driver +``` +To upgrade: +```console +pip install get-gecko-driver --upgrade +``` +## Usage +#### Install and use GeckoDriver with Selenium +```Python +import time +from get_gecko_driver import GetGeckoDriver +from selenium import webdriver +# Install the driver: +# Downloads the latest GeckoDriver version +# Adds the downloaded GeckoDriver to path +get_driver = GetGeckoDriver() +get_driver.install() +# Use the installed GeckoDriver with Selenium +driver = webdriver.Firefox() +driver.get("https://google.com") +time.sleep(3) +driver.quit() +``` +#### For downloading only +```Python +from get_gecko_driver import GetGeckoDriver +get_driver = GetGeckoDriver() +# Print the latest version +print(get_driver.latest_version()) +# Print the latest version download link +print(get_driver.latest_version_url()) +# Print the download link of a specific version +print(get_driver.version_url('0.27.0')) +# Download the latest driver version +# Optional: use output_path= to specify where to download the driver +# Optional: use extract=True to extract the file +get_driver.download_latest_version(extract=True) +# Download a specific driver version +# Optional: use output_path= to specify where to download the driver +# Optional: use extract=True to extract the file +get_driver.download_version('0.27.0', extract=True) +``` +#### Command-line +Print the latest version url of all platforms: +```console +get-gecko-driver --latest-urls +``` +Print the latest version: +```console +get-gecko-driver --latest-version +``` +Print the latest version url: +```console +get-gecko-driver --latest-url +``` +Download the latest version and extract the file: +```console +get-gecko-driver --download-latest --extract +``` +Download a specific version and extract the file: +```console +get-gecko-driver --download-version 0.27.0 --extract +``` +#### The downloaded driver can be found at: +*`<current directory>/<geckodriver>/<version>/<bin>/<geckodriver>`* +### Options +``` +--help Show help. +--latest-version Print the latest version. +--latest-urls Print the latest version urls for all platforms. +--version-url Print the version url. +--latest-url Print the latest version url. +--download-latest Download the latest version. +--download-version Download a specific version. +--extract Extract the compressed driver file. +--version App version. +``` + +%package help +Summary: Development documents and examples for get-gecko-driver +Provides: python3-get-gecko-driver-doc +%description help +[](https://pypi.python.org/pypi/get-gecko-driver) +[](https://pypi.python.org/pypi/get-gecko-driver) +[](https://pypi.python.org/pypi/get-gecko-driver) +[](https://pypi.python.org/pypi/get-gecko-driver) +A tool to download and install GeckoDriver. Download the latest version or another specific version. You can use this +tool as a package import or as a command-line application. +This Python package runs through a Jenkins test pipeline every hour to ensure proper functionality. +## Install +To install: +```console +pip install get-gecko-driver +``` +To upgrade: +```console +pip install get-gecko-driver --upgrade +``` +## Usage +#### Install and use GeckoDriver with Selenium +```Python +import time +from get_gecko_driver import GetGeckoDriver +from selenium import webdriver +# Install the driver: +# Downloads the latest GeckoDriver version +# Adds the downloaded GeckoDriver to path +get_driver = GetGeckoDriver() +get_driver.install() +# Use the installed GeckoDriver with Selenium +driver = webdriver.Firefox() +driver.get("https://google.com") +time.sleep(3) +driver.quit() +``` +#### For downloading only +```Python +from get_gecko_driver import GetGeckoDriver +get_driver = GetGeckoDriver() +# Print the latest version +print(get_driver.latest_version()) +# Print the latest version download link +print(get_driver.latest_version_url()) +# Print the download link of a specific version +print(get_driver.version_url('0.27.0')) +# Download the latest driver version +# Optional: use output_path= to specify where to download the driver +# Optional: use extract=True to extract the file +get_driver.download_latest_version(extract=True) +# Download a specific driver version +# Optional: use output_path= to specify where to download the driver +# Optional: use extract=True to extract the file +get_driver.download_version('0.27.0', extract=True) +``` +#### Command-line +Print the latest version url of all platforms: +```console +get-gecko-driver --latest-urls +``` +Print the latest version: +```console +get-gecko-driver --latest-version +``` +Print the latest version url: +```console +get-gecko-driver --latest-url +``` +Download the latest version and extract the file: +```console +get-gecko-driver --download-latest --extract +``` +Download a specific version and extract the file: +```console +get-gecko-driver --download-version 0.27.0 --extract +``` +#### The downloaded driver can be found at: +*`<current directory>/<geckodriver>/<version>/<bin>/<geckodriver>`* +### Options +``` +--help Show help. +--latest-version Print the latest version. +--latest-urls Print the latest version urls for all platforms. +--version-url Print the version url. +--latest-url Print the latest version url. +--download-latest Download the latest version. +--download-version Download a specific version. +--extract Extract the compressed driver file. +--version App version. +``` + +%prep +%autosetup -n get-gecko-driver-1.3.10 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-get-gecko-driver -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 1.3.10-1 +- Package Spec generated |