Coder Social home page Coder Social logo

Comments (20)

Bouni avatar Bouni commented on June 18, 2024 1

I've submitted a PR to the teardrops plugin repo NilujePerchut/kicad_scripts#34
That will fix the problem.

If you don't want to wait, simple remove this line https://github.com/NilujePerchut/kicad_scripts/blob/master/teardrops/td.py#L107

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on June 18, 2024 1

@NilujePerchut merged my PR so i concider this issue resolved. Please reopen if not!

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on June 18, 2024

@HaydenHu How did you install the Plugin?

Please open the terminal in KiCad before you start the plugin:
image

This will give you a stdout/stderr windows if something unusual happens.

Please post another picture after you've done that, maybe I can see from that whats wrong.

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on June 18, 2024

I just deleted the plugin here and installed it via git clone and again via downloading the zip file and both times it worked right out of the box!?

Maybe the URl is blocked? Can you open https://jlcpcb.com/componentSearch/uploadComponentInfo in a browser and see if a CSV gets downloaded?

from kicad-jlcpcb-tools.

HaydenHu avatar HaydenHu commented on June 18, 2024

I just deleted the plugin here and installed it via git clone and again via downloading the zip file and both times it worked right out of the box!?

Maybe the URl is blocked? Can you open https://jlcpcb.com/componentSearch/uploadComponentInfo in a browser and see if a CSV gets downloaded?

I did what you said, opened the console and ran the plugin, and everything worked.
Do I need to open the console every time I launch a plug-in?

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on June 18, 2024

No, that was not my intention, normally you can see errors in that windows that do not show up in the plugin.
So everythin works now even without the console open?

from kicad-jlcpcb-tools.

HaydenHu avatar HaydenHu commented on June 18, 2024

No, that was not my intention, normally you can see errors in that windows that do not show up in the plugin. So everythin works now even without the console open?

If I don't open the console before running the plug-in, it won't work as I described

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on June 18, 2024

Thats very strange! Do you get a second window besides the console like this:

image

from kicad-jlcpcb-tools.

HaydenHu avatar HaydenHu commented on June 18, 2024

Thats very strange! Do you get a second window besides the console like this:

image

22-43-01.mp4

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on June 18, 2024

Thats wild, You don't see the 3 messages that usually come up first 🤔
I know that I hat trouble when using the plugin together with the KiBuzzard plugin.
Maybe its some kind of interference with one of the many plugins you've installed.
Can you provide a list of you plugin so that I can try to reproduce it?

from kicad-jlcpcb-tools.

HaydenHu avatar HaydenHu commented on June 18, 2024

太疯狂了,您看不到通常最先出现的 3 条消息 🤔 我知道将插件与 KiBuzzard 插件一起使用时会遇到麻烦。 也许它对您安装的众多插件之一造成了某种干扰。 您能否提供您的插件列表,以便我可以尝试重现它?

https://www.lanzouw.com/inkNDvmj20j

Application: KiCad (64-bit)

Version: (5.99.0-12889-g70df3822b5), release build

Libraries:
wxWidgets 3.1.5
libcurl/7.78.0-DEV Schannel zlib/1.2.11

Platform: Windows 10 (build 19043), 64-bit edition, 64 bit, Little endian, wxMSW

Build Info:
Date: Oct 20 2021 12:00:27
wxWidgets: 3.1.5 (wchar_t,wx containers)
Boost: 1.76.0
OCC: 7.5.0
Curl: 7.78.0-DEV
ngspice: 35
Compiler: Visual C++ 1929 without C++ ABI

Build settings:
KICAD_USE_OCC=ON
KICAD_SPICE=ON

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on June 18, 2024

Ok, here's what I have installed:

Application: KiCad (64-bit)

Version: (5.99.0-12896-g1860893d63), release build

Libraries:
	wxWidgets 3.1.5
	libcurl/7.78.0-DEV Schannel zlib/1.2.11

Platform: Windows 10 (build 19043), 64-bit edition, 64 bit, Little endian, wxMSW

Build Info:
	Date: Oct 21 2021 12:00:08
	wxWidgets: 3.1.5 (wchar_t,wx containers)
	Boost: 1.76.0
	OCC: 7.5.0
	Curl: 7.78.0-DEV
	ngspice: 35
	Compiler: Visual C++ 1929 without C++ ABI

Build settings:
	KICAD_USE_OCC=ON
	KICAD_SPICE=ON

Ok, I figured out that it is some sort of collision between KiBuzzard and this plugin!
If I delete KiBuzzard from the plugin folder, kicad-jlcpcb-tools works as expected.

I think its the way how both plugins try to redirect stdout/stderr that causes this problem.

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on June 18, 2024

Ok, its defenitely caused by some sort of issue between the way kicad-jlcpcb-tools and KiBuzzard setup their loggers.
Maybe I can figure out whats going on here and provide a fix!

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on June 18, 2024

Ok, its defenitely the way logging is handled by KiBuzzard that prevents kicad-jlcpcb-tools from working properly!
I filed an issue over there gregdavill/KiBuzzard#57 in order to find a way both plugins can work side by side.
In the meantime you can replace the logging in KiBuzzard-main\KiBuzzard\plugin.py (https://github.com/gregdavill/KiBuzzard/blob/main/KiBuzzard/plugin.py#L105-L142) with this:

    def InitLogger(self):
        root = logging.getLogger()
        root.setLevel(logging.DEBUG)

        # Log to stderr
        handler1 = logging.StreamHandler(sys.stderr)
        handler1.setLevel(logging.DEBUG)

        log_file = os.path.join(os.path.dirname(__file__), "..", "kibuzzard.log")

        # and to our error file
        handler2 = logging.FileHandler(log_file)
        handler2.setLevel(logging.DEBUG)
        formatter = logging.Formatter(
            "%(asctime)s %(name)s %(lineno)d:%(message)s", datefmt="%m-%d %H:%M:%S"
        )
        handler1.setFormatter(formatter)
        handler2.setFormatter(formatter)
        root.addHandler(handler1)
        root.addHandler(handler2)

That way both plugins seem to work properly

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on June 18, 2024

@HaydenHu The author of KiBuzzard updated his plugin with a fix for this issue. Please update and test if the issue is solved with this!

from kicad-jlcpcb-tools.

HaydenHu avatar HaydenHu commented on June 18, 2024

Ok, its defenitely the way logging is handled by KiBuzzard that prevents kicad-jlcpcb-tools from working properly! I filed an issue over there gregdavill/KiBuzzard#57 in order to find a way both plugins can work side by side. In the meantime you can replace the logging in KiBuzzard-main\KiBuzzard\plugin.py (https://github.com/gregdavill/KiBuzzard/blob/main/KiBuzzard/plugin.py#L105-L142) with this:

    def InitLogger(self):
        root = logging.getLogger()
        root.setLevel(logging.DEBUG)

        # Log to stderr
        handler1 = logging.StreamHandler(sys.stderr)
        handler1.setLevel(logging.DEBUG)

        log_file = os.path.join(os.path.dirname(__file__), "..", "kibuzzard.log")

        # and to our error file
        handler2 = logging.FileHandler(log_file)
        handler2.setLevel(logging.DEBUG)
        formatter = logging.Formatter(
            "%(asctime)s %(name)s %(lineno)d:%(message)s", datefmt="%m-%d %H:%M:%S"
        )
        handler1.setFormatter(formatter)
        handler2.setFormatter(formatter)
        root.addHandler(handler1)
        root.addHandler(handler2)

That way both plugins seem to work properly

The Teardrop plugin won't work after using your code

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on June 18, 2024

Ok, I'll dig into that as well 😬

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on June 18, 2024

Ok, If I start the python shell before the teardrops plugin and the try to use it I get this:

\plugins\kicad_scripts-master\teardrops\td.py", line 116, in __Zone
    sys.stdout.write("+")
AttributeError: 'NoneType' object has no attribute 'write'

If I remove kicad-jlcpcb-tools from my plugins folder, the issue stays the same, if I remove KiBuzzard as well, still the same issue.
But If I add the old version of KiBuzzard (before @gregdavill refactored the logging) it works again.

I guess that the author of the teardrops plugin had KiBuzzard installed during the development of the teardrops plugin and therefore sys.stdout.write("+") worked.
The reson is that Greg redirected stderr / stdout to his logger

The call to sys.stdout.write ends up in kibuzzard.log

10-25 09:18:25 STDOUT 153:Starting plugin ViaStitching
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:+
10-25 09:18:32 STDOUT 153:47 teardrops inserted

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on June 18, 2024

@HaydenHu I would highly appreciate if you could verify that this solves your problem so that I can cloase this issue.

from kicad-jlcpcb-tools.

HaydenHu avatar HaydenHu commented on June 18, 2024

Everything is back to normal. Perfect!

from kicad-jlcpcb-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.