Skip to content

Commit

Permalink
TME fix and clean-up imports
Browse files Browse the repository at this point in the history
  • Loading branch information
hildogjr authored and mmmaisel committed Jun 4, 2018
1 parent 08412e3 commit 5a90494
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 77 deletions.
3 changes: 2 additions & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ Contributors
* Diorcet Yann: https://github.com/diorcety
* Giacinto Luigi Cerone https://github.com/glcerone
* Hildo Guillardi Júnior https://github.com/hildogjr
* Adam Heinrich https://github.com/adamheinrich
* Adam Heinrich https://github.com/adamheinrich
* Max Maisel https://github.com/mmmaisel
12 changes: 7 additions & 5 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ History
______________________

* Changed Farnell link and table result format.

* Fixed TME `fake_browser` migration.
* Re-factored the distributors modules to class kind and improved the scrape sequence to decrease probability of ban.
* Fixed the multi-threading configuration.

0.1.44 (2018-05-28)
______________________

* Fixed `logging` messages when using `tqdm`(process bar) for sequencial scrape, missing fix for multithreads scrape.
* Improve the `spreadsheet.py` to a lighter file when use just one distributor.
* Improved log messages to better comunity debug.
* Fixed ``logging`` messages when using ``tqdm``(process bar) for sequential scrape, missing fix for multithreads scrape.
* Improve the ``spreadsheet.py`` to a lighter file when use just one distributor.
* Improved log messages to better community debug.
* Add Upverter CSV compatibility.
* Fixed Mouser "quote price" exception in the price tiers.
* Fixed wxPython exception import.
Expand All @@ -38,7 +40,7 @@ ______________________
* Added ``--group_fields`` option to ignore differences in fields of the components and group them.
* Fixed the not ungrouping issue when ``manf#`` equal ``None``.
* CSV now accepts files from Proteus and Eagle EDA tools.
* Cleared up unused Python imports and better placed functions into files (spreasheet creation files are now in ``spreadsheet.py``).
* Cleared up unused Python imports and better placed functions into files (spreadsheet creation files are now in ``spreadsheet.py``).
* Added a KiCost stamp version at the end of the spreadsheet and file information in the beginning, if they are not inside it.
* Fixed issues related to user visualization in the spreadsheet (added gray formatted conditioning and the "exclude desc and manf columns").
* Added "user errors" and software scape in the case of not recognized references characters given the message of how to solve.
Expand Down
12 changes: 2 additions & 10 deletions kicost/distributors/digikey/digikey.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,15 @@
# THE SOFTWARE.

# Inserted by Pasteurize tool.
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import zip
from builtins import range
from builtins import int
from builtins import str
from __future__ import print_function, unicode_literals, division, absolute_import
from builtins import zip, range, int, str
from future import standard_library
standard_library.install_aliases()

import future

import re, difflib
from bs4 import BeautifulSoup
import http.client # For web scraping exceptions.
#from .. import urlencode, urlquote, urlsplit, urlunsplit
from .. import fake_browser
from .. import EXTRA_INFO_DIST, extra_info_dist_name_translations
from ...globals import PartHtmlError
Expand Down
15 changes: 3 additions & 12 deletions kicost/distributors/farnell/farnell.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,15 @@
# THE SOFTWARE.

# Inserted by Pasteurize tool.
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import zip
from builtins import range
from builtins import int
from builtins import str
from __future__ import print_function, unicode_literals, division, absolute_import
from builtins import zip, range, int, str
from future import standard_library
standard_library.install_aliases()

import future

import re
import difflib
import re, difflib
from bs4 import BeautifulSoup
import http.client # For web scraping exceptions.
#from .. import urlencode, urlquote, urlsplit, urlunsplit
from .. import fake_browser
from ...globals import PartHtmlError
from ...globals import currency
Expand Down
6 changes: 1 addition & 5 deletions kicost/distributors/local/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,10 @@
# THE SOFTWARE.

# Inserted by Pasteurize tool.
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function, unicode_literals, division, absolute_import
from builtins import zip, range, int, str
from future import standard_library
standard_library.install_aliases()

import future

import re, difflib
Expand Down
15 changes: 3 additions & 12 deletions kicost/distributors/mouser/mouser.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,15 @@
# THE SOFTWARE.

# Inserted by Pasteurize tool.
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import zip
from builtins import range
from builtins import int
from builtins import str
from __future__ import print_function, unicode_literals, division, absolute_import
from builtins import zip, range, int, str
from future import standard_library
standard_library.install_aliases()

import future

import re
import difflib
import re, difflib
from bs4 import BeautifulSoup
import http.client # For web scraping exceptions.
#from .. import urlencode, urlquote, urlsplit, urlunsplit
from .. import fake_browser
from ...globals import PartHtmlError
from ...globals import logger, DEBUG_OVERVIEW, DEBUG_DETAILED, DEBUG_OBSESSIVE, DEBUG_HTTP_RESPONSES
Expand Down
15 changes: 3 additions & 12 deletions kicost/distributors/newark/newark.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,15 @@
# THE SOFTWARE.

# Inserted by Pasteurize tool.
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import zip
from builtins import range
from builtins import int
from builtins import str
from __future__ import print_function, unicode_literals, division, absolute_import
from builtins import zip, range, int, str
from future import standard_library
standard_library.install_aliases()

import future

import re
import difflib
import re, difflib
from bs4 import BeautifulSoup
import http.client # For web scraping exceptions.
#from .. import urlencode, urlquote, urlsplit, urlunsplit
from .. import fake_browser
from ...globals import PartHtmlError
from ...globals import logger, DEBUG_OVERVIEW, DEBUG_DETAILED, DEBUG_OBSESSIVE, DEBUG_HTTP_RESPONSES
Expand Down
7 changes: 1 addition & 6 deletions kicost/distributors/rs/rs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,15 @@
# THE SOFTWARE.

# Inserted by Pasteurize tool.
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function, unicode_literals, division, absolute_import
from builtins import zip, range, int, str
from future import standard_library
standard_library.install_aliases()

import future

import re, difflib
from bs4 import BeautifulSoup
import http.client # For web scraping exceptions.
#from .. import urlencode, urlquote, urlsplit, urlunsplit
from .. import fake_browser
from ...globals import PartHtmlError
from ...globals import logger, DEBUG_OVERVIEW, DEBUG_DETAILED, DEBUG_OBSESSIVE, DEBUG_HTTP_RESPONSES
Expand Down
18 changes: 4 additions & 14 deletions kicost/distributors/tme/tme.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,16 @@
# THE SOFTWARE.

# Inserted by Pasteurize tool.
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import zip
from builtins import range
from builtins import int
from builtins import str
from __future__ import print_function, unicode_literals, division, absolute_import
from builtins import zip, range, int, str
from future import standard_library
standard_library.install_aliases()

import future

import re
import difflib
import re, difflib
import json
from bs4 import BeautifulSoup
import http.client # For web scraping exceptions.
#from .. import urlencode, urlquote, urlsplit, urlunsplit
from .. import fake_browser
from ...globals import PartHtmlError
from ...globals import logger, DEBUG_OVERVIEW, DEBUG_DETAILED, DEBUG_OBSESSIVE, DEBUG_HTTP_RESPONSES
Expand Down Expand Up @@ -73,8 +64,7 @@ def __ajax_details(self, pn):
return None, None

try:
r = r.decode('utf-8') # Convert bytes to string in Python 3.
p = json.loads(r).get('Products')
p = json.loads(html).get('Products')
if p is not None and isinstance(p, list):
p = p[0]
html_tree = BeautifulSoup(p.get('PriceTpl', '').replace("\n", ""), "lxml")
Expand Down

0 comments on commit 5a90494

Please sign in to comment.