Release of new KiCost 0.1.46 (GUI and currency feature)

Follow the steps of Latest version of KiCost: Faster! Custom Pricing!, KiCost 0.1.46 released, today 04/jul/2018, on PyPI.

News features include:
User GUI (for that one that is not habituated with terminal). Just type kicost on terminal and the graphical interface will be loaded (it use wxPython already installed with using Python2 KiCad on Linux).
The GUI provide quick links to documentation, issue page and last released package.
The scrape modules were re-factored (thanks Max Maisel).
Digikey now accept currency, an old ask for users, configuration (missing in other distributors yet). Use --locale IT, for example for use Italy-Euro configuration (can be used on GUI in the second tab).

There is a long path to archive all the features implementation, so we expect for opinions and suggestions.

For install use this manual https://github.com/xesscorp/KiCost/blob/master/docs/installation.rst.

1 Like

Hi, I just tried it in an up to date kde neon (ubuntu based) and I get this when trying to run the GUI

marcos@silversurfer:~$ sudo -H pip install wxpython
Requirement already satisfied: wxpython in /usr/lib/python2.7/dist-packages/wx-3.0-gtk2 (3.0.2.0)
marcos@silversurfer:~$ sudo -H pip install -U pip
Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages (10.0.1)
marcos@silversurfer:~$ kicost

(kicost:10304): Gtk-WARNING **: Unable to locate theme engine in module_path: “adwaita”,

(kicost:10304): Gtk-WARNING **: Unable to locate theme engine in module_path: “adwaita”,
Traceback (most recent call last):
File “/usr/local/bin/kicost”, line 11, in
sys.exit(main())
File “/usr/local/lib/python2.7/dist-packages/kicost/main.py”, line 233, in main
kicost_gui() # Use the user guide.
File “/usr/local/lib/python2.7/dist-packages/kicost/kicost_gui.py”, line 1051, in kicost_gui
frame = formKiCost(None)
File “/usr/local/lib/python2.7/dist-packages/kicost/kicost_gui.py”, line 252, in init
self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )
File “/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py”, line 9718, in SetSizeHints
return core.Window_SetSizeHints(*args, **kwargs)
TypeError: in method ‘Window_SetSizeHints’, expected argument 2 of type ‘int’
marcos@silversurfer:~$

Seems related to this

@marcos:

  1. with you type kicost --version on terminal, it returns “KiCost 0.1.46”?

  2. If you try to start the GUI by just kicost, did you receive a

    You don’t have the wxPython dependence to run the GUI interface. Run once of the follow commands in terminal to install them


message?

If all OK, comment the line 252 in kicost_gui.py that set the GUI default size. This may create some visual not fitting in first start but, after KiCost saves last size and position on the screen.

@marcos. Appear that you are right, the GUI was developed with compatibility with wxPython 4.x.x and KiCad still using 3.x.x on v5. Please, could you report in https://github.com/xesscorp/KiCost/issues/ to we track and keep a history?

Let me know the results.

Still no luck

Issue posted here

Thanks!

On my machine now, I am using KiCost on Python3 with wxPython4. But we will track the source of this to improve the user experience and quick installation side-by-side KiCad.

@marcos, please get a try using this file
https://github.com/hildogjr/KiCost/blob/wxPy3-4/kicost/kicost_gui.py
to replace the original one. If you don’t mind to be a “beta user”.

Replacing the file I get this

marcos@silversurfer:/usr/local/lib/python2.7/dist-packages/kicost$ kicost

(kicost:31295): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",

(kicost:31295): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",
Traceback (most recent call last):
  File "/usr/local/bin/kicost", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/kicost/__main__.py", line 233, in main
    kicost_gui() # Use the user guide.
  File "/usr/local/lib/python2.7/dist-packages/kicost/kicost_gui.py", line 1053, in kicost_gui
    frame = formKiCost(None)
  File "/usr/local/lib/python2.7/dist-packages/kicost/kicost_gui.py", line 530, in __init__
    self.set_properties()
  File "/usr/local/lib/python2.7/dist-packages/kicost/kicost_gui.py", line 871, in set_properties
    self.m_checkList_dist.Append(distributors_list)
  File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py", line 12856, in Append
    return _core_.ItemContainer_Append(*args, **kwargs)
TypeError: String or Unicode type required

Thanks again.
In last change that I did just not worked the right click context menu, that provide some shortcuts (select all distributors, unselect all, 
).
“https://github.com/hildogjr/KiCost/blob/wxPy3-4/kicost/kicost_gui.py”

Cool, now it opens a window. When I load an .xml bom it and click “kicost it” this exception is shown

marcos@silversurfer:/usr/local/lib/python2.7/dist-packages/kicost$ kicost

(kicost:10148): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",

(kicost:10148): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/lib/python2.7/dist-packages/kicost/kicost_gui.py", line 651, in run_kicost_guide
    self.run() # Run KiCost.
  File "/usr/local/lib/python2.7/dist-packages/kicost/kicost_gui.py", line 735, in run
    choisen_dist = list(self.m_checkList_dist.GetCheckedItems())
AttributeError: 'CheckListBox' object has no attribute 'GetCheckedItems'

The problem in the great part are function that wxPy3 just accept string and wxPy4 aso list, e.g. self.contro.Append().
@marcos ready for new try. Sorry by the iterative process, this machine redirect all the python to v3.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.