Giter Club home page Giter Club logo

Comments (1)

abetusk avatar abetusk commented on September 26, 2024

+1

I'm getting what I believe is the same error on a newer version:

$ python3 Start.py -L tmp/SparkFun-Aesthetics.lbr a b
Error Converting Library: 'SparkFun-Aesthetics'
Error: Can't convert 'NoneType' object to str implicitly
See Log.txt for more info
$ cat Log.txt
###############################################################################
#Session: 2014-12-28 17:35:17
###############################################################################


*******************************************
Converting Lib: tmp/SparkFun-Aesthetics.lbr
Module Output: b
Symbol Output: a
Lib Name: SparkFun-Aesthetics
Conversion Failed

Traceback (most recent call last):
  File "Start.py", line 141, in convertLib
    lib.writeLibrary(modFile, symFile)
  File "/home/abe/prog/github/DanChianucci/Eagle2Kicad/Library/Library.py", line 65, in writeLibrary
    self.writeSymFile(symFile)
  File "/home/abe/prog/github/DanChianucci/Eagle2Kicad/Library/Library.py", line 86, in writeSymFile
    devicepart.write(symFile)
  File "/home/abe/prog/github/DanChianucci/Eagle2Kicad/Common/Symbol.py", line 39, in write
    symFile.write("#Generated for " + self.device.fullName + " package " + self.device.package + "\n")
TypeError: Can't convert 'NoneType' object to str implicitly
*******************************************

As a temporary workaround, I've wrapped the self.device.package in an 'xstr' function that returns the empty string if it's a None type, but this is probably not a great solution as it does not address the underlying problem:

$ diff -b Symbol.py Symbol.py.cur
7a8,10
> def xstr(s):
>     return '' if s is None else str(s)
> 
39c42,46
<         symFile.write("#Generated for " + self.device.fullName + " package " + self.device.package + "\n")
---
>         #if self.device.package is None:
>         #  print( "!!!", self.device.package, self.device.fullName, self.name )
>         #symFile.write("#Generated for " + self.device.fullName + " package " + xstr(self.device.package) + "\n")
> 
>         symFile.write("#Generated for " + xstr(self.device.fullName) + " package " + xstr(self.device.package) + "\n")
46c53
<         symFile.write(" " + self.device.package + "\n")
---
>         symFile.write(" " + xstr(self.device.package) + "\n")

See https://github.com/abetusk/Eagle2Kicad/blob/release/Common/Symbol.py.

from eagle2kicad.

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.