[packages/python-selenium] - rel 4; firefox addon in selenium-firefoxdriver.spec; make this noarch package

arekm arekm at pld-linux.org
Wed Apr 11 09:19:25 CEST 2018


commit c963db01de77e640a856c0251cc38b02f3236317
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Apr 11 09:19:18 2018 +0200

    - rel 4; firefox addon in selenium-firefoxdriver.spec; make this noarch package

 x-ignore-nofocus-path.patch | 41 +++++++++++++++++++++++++++++++++++++++++
 xpi-path.patch              | 23 +++++++++++++++++++++++
 2 files changed, 64 insertions(+)
---
diff --git a/x-ignore-nofocus-path.patch b/x-ignore-nofocus-path.patch
new file mode 100644
index 0000000..7e20232
--- /dev/null
+++ b/x-ignore-nofocus-path.patch
@@ -0,0 +1,41 @@
+diff --git a/selenium/webdriver/firefox/firefox_binary.py b/selenium/webdriver/firefox/firefox_binary.py
+index f619f1e..5db7afc 100644
+--- a/selenium/webdriver/firefox/firefox_binary.py
++++ b/selenium/webdriver/firefox/firefox_binary.py
+@@ -191,6 +191,8 @@ class FirefoxBinary(object):
+ 
+     def _extract_and_check(self, profile, no_focus_so_name, x86, amd64):
+ 
++        os_lib_path = '/usr/' + sys.lib + '/firefoxdriver'
++
+         paths = [x86, amd64]
+         built_path = ""
+         for path in paths:
+@@ -199,7 +201,7 @@ class FirefoxBinary(object):
+                 os.makedirs(library_path)
+             import shutil
+             shutil.copy(os.path.join(
+-                os.path.dirname(__file__),
++                os_lib_path,
+                 path,
+                 self.NO_FOCUS_LIBRARY_NAME),
+                 library_path)
+diff --git a/setup.py b/setup.py
+index 779ae5e..0e6335d 100755
+--- a/setup.py
++++ b/setup.py
+@@ -68,12 +68,10 @@ setup_args = {
+                  'selenium.webdriver.remote',
+                  'selenium.webdriver.support', ],
+     'package_data': {
+-        'selenium.webdriver.firefox': ['*.xpi', 'webdriver_prefs.json'],
++        'selenium.webdriver.firefox': ['webdriver_prefs.json'],
+         'selenium.webdriver.remote': ['getAttribute.js', 'isDisplayed.js'],
+     },
+-    'data_files': [('selenium/webdriver/firefox/x86', ['selenium/webdriver/firefox/x86/x_ignore_nofocus.so']),
+-                   ('selenium/webdriver/firefox/amd64', ['selenium/webdriver/firefox/amd64/x_ignore_nofocus.so']),
+-                   ('selenium/webdriver/remote', ['selenium/webdriver/remote/getAttribute.js']),
++    'data_files': [('selenium/webdriver/remote', ['selenium/webdriver/remote/getAttribute.js']),
+                    ('selenium/webdriver/remote', ['selenium/webdriver/remote/isDisplayed.js'])],
+     'include_package_data': True,
+     'zip_safe': False
diff --git a/xpi-path.patch b/xpi-path.patch
new file mode 100644
index 0000000..b4059f8
--- /dev/null
+++ b/xpi-path.patch
@@ -0,0 +1,23 @@
+diff --git a/selenium/webdriver/firefox/firefox_profile.py b/selenium/webdriver/firefox/firefox_profile.py
+index 6f8293d..3dae348 100644
+--- a/selenium/webdriver/firefox/firefox_profile.py
++++ b/selenium/webdriver/firefox/firefox_profile.py
+@@ -37,7 +37,7 @@ from selenium.webdriver.common.proxy import ProxyType
+ from selenium.common.exceptions import WebDriverException
+ 
+ 
+-WEBDRIVER_EXT = "webdriver.xpi"
++WEBDRIVER_EXT = "/usr/share/firefoxdriver/webdriver.xpi"
+ WEBDRIVER_PREFERENCES = "webdriver_prefs.json"
+ EXTENSION_NAME = "fxdriver at googlecode.com"
+ 
+@@ -246,9 +246,6 @@ class FirefoxProfile(object):
+             - path: url, absolute path to .xpi, or directory of addons
+             - unpack: whether to unpack unless specified otherwise in the install.rdf
+         """
+-        if addon == WEBDRIVER_EXT:
+-            addon = os.path.join(os.path.dirname(__file__), WEBDRIVER_EXT)
+-
+         tmpdir = None
+         xpifile = None
+         if addon.endswith('.xpi'):
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-selenium.git/commitdiff/c963db01de77e640a856c0251cc38b02f3236317



More information about the pld-cvs-commit mailing list