KiCad / kicad-library-utils

Some scripts for helping with library development
GNU General Public License v3.0
128 stars 95 forks source link

kicad-library-utils don't work #300

Closed jneiva08 closed 5 years ago

jneiva08 commented 5 years ago

Hi

I'm trying to run check_kicad_mod.py but it don't work.

Its giving the following error:

Traceback (most recent call last):
  File "./check_kicad_mod.py", line 117, in <module>
    rule.check()
  File "/home/jneiva/workspace/eda/kicad-library-utils/pcb/rules/G1_7.py", line 17, in check
    if 'linux' in platform.platform().lower() and not checkLineEndings(self.module.filename):
  File "/home/jneiva/workspace/eda/kicad-library-utils/common/rulebase.py", line 75, in checkLineEndings
    LE1 = ord(chr(filecontentsraw[-2]))
TypeError: an integer is required

Have try checklib.py it don't works too.

Its giving the following error:

Traceback (most recent call last):
  File "./checklib.py", line 135, in <module>
    rule.check()
  File "/home/jneiva/workspace/eda/kicad-library-utils/schlib/rules/G1_7.py", line 19, in check
    if not checkLineEndings(self.component.lib_filename):
  File "/home/jneiva/workspace/eda/kicad-library-utils/common/rulebase.py", line 75, in checkLineEndings
    LE1 = ord(chr(filecontentsraw[-2]))
TypeError: an integer is required

My OS is Linux Mint xfce 19.1

Solartraveler commented 5 years ago

Yes, just came across the same error with Debian Stretch. As workaround, I simply disabled the checks: LE1 = 42 #ord(chr(filecontentsraw[-2])) LE2 = 23 #ord(chr(filecontentsraw[-1]))

The you can at least run the other checks.

poeschlr commented 5 years ago

What python version are you using? We definetly require pyhton 3 and might even require at least 3.4.

jneiva08 commented 5 years ago

Have alwats run the script by "./checklib.py" and it always worked but now gives the error mantioned earlier. but if i run like you say "python3 checklib.py" it don't gives any error.

StormTrooper commented 5 years ago

Had the same problem. I have python 2.7 and 3 intstalled Running ./checklib.py on my desktop used python 2.7 I changed first line of checklib.py to:

#!/usr/bin/env python3

evanshultz commented 5 years ago

Python 3 is required. This is stated clearly above. Please use Python 3 to run the scripts and post here if and only if you still have problems. Thank you.

poeschlr commented 5 years ago

Evan the first line of the script was indeed wrong. Fix is in pull request #305

evanshultz commented 5 years ago

I misunderstood the comments above. Sorry.