Skip to content

Commit

Permalink
Merge pull request #280 from hildogjr/master
Browse files Browse the repository at this point in the history
  • Loading branch information
hildogjr authored Jun 23, 2018
2 parents 2eddb76 + 0989267 commit 143e5c2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion kicost/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
# the user just want the KiCost CLI.
from .distributors.global_vars import distributor_dict
from .eda_tools import eda_tool_dict
from . import __version__ # Version control by @xesscorp.
from . import __version__ # Version control by @xesscorp and collaborator.

NUM_PROCESSES = 30 # Maximum number of parallel web-scraping processes.
HTML_RESPONSE_RETRIES = 2 # Number of attempts to retrieve part data from a website.
Expand Down
16 changes: 11 additions & 5 deletions kicost/kicost_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
from distutils.version import StrictVersion # To comparasion of versions.
import re # Regular expression parser.

from . import __version__ # Version control by @xesscorp.
from . import __version__ # Version control by @xesscorp and collaborator.
import logging
from .global_vars import logger, DEBUG_OVERVIEW, DEBUG_DETAILED, DEBUG_OBSESSIVE # Debug configurations.
from .kicost import * # kicost core functions.
from .distributors import fake_browser # Use the configurations alredy made to get KiCost last version.
from .distributors import init_distributor_dict
Expand Down Expand Up @@ -1041,14 +1043,18 @@ def __init__(self, aWxTextCtrl):
def write(self, msg):
try:
self.area.AppendText(msg)
sys.__stdout__.flush()
except:
# In case of freeze GUI, print on terminal to allow debug.
sys.__stdout__.write(msg)
def flush(self):
sys.__stdout__.flush
#finally:
# self.flush()
#def flush(self):
# sys.__stdout__.flush

# Redirect the logger to the GUI area a
sys.stdout = GUILoggerHandler(formKiCost.m_textCtrl_messages)
# Redirect the logger to the GUI area.
#sys.stdout = GUILoggerHandler(frame.m_textCtrl_messages)
#sys.stderr = GUILoggerHandler(frame.m_textCtrl_messages)
#TODO when the above works, change all print and `m_textCtrl_messages.Append` on GUI to logging.

frame.Show()
Expand Down
2 changes: 1 addition & 1 deletion kicost/spreadsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import xlsxwriter # XLSX file interpreter.
from xlsxwriter.utility import xl_rowcol_to_cell, xl_range, xl_range_abs
# KiCost libraries.
from . import __version__ # Version control by @xesscorp.
from . import __version__ # Version control by @xesscorp and collaborator.
from .global_vars import SEPRTR
from .global_vars import logger, DEBUG_OVERVIEW, DEBUG_DETAILED, DEBUG_OBSESSIVE
from .distributors.global_vars import distributor_dict # Distributors names and definitions to use in the spreadsheet.
Expand Down

0 comments on commit 143e5c2

Please sign in to comment.