Fixed minimum KiCad version required is 5.1.6.

- KiCad 5.1.5 lacks GetBuildVersion()
- Fixes #45
This commit is contained in:
Salvador E. Tropea 2021-01-26 12:42:49 -03:00
parent 73cb98f113
commit 409df8cca0
5 changed files with 12 additions and 5 deletions

View File

@ -1527,7 +1527,7 @@ I don't know how to make it.
### Installation on other targets
- Install KiCad 5.x
- Install KiCad 5.1.6 or newer
- Install Python 3.5 or newer
- Install the Python Yaml and requests modules
- Run the script *src/kibot*

2
debian/control vendored
View File

@ -10,7 +10,7 @@ X-Python3-Version: >= 3.6
Package: kibot
Architecture: all
Multi-Arch: foreign
Depends: ${misc:Depends}, ${python3:Depends}, python3-yaml, kicad (>= 5.1.0), python3-wxgtk4.0
Depends: ${misc:Depends}, ${python3:Depends}, python3-yaml, kicad (>= 5.1.6), python3-wxgtk4.0
Recommends: kibom.inti-cmnb (>= 1.8.0), interactivehtmlbom.inti-cmnb, pcbdraw, imagemagick, librsvg2-bin, python3-xlsxwriter, rar
Description: KiCad Bot
KiBot is a program which helps you to automate the generation of KiCad

View File

@ -613,7 +613,7 @@ I don't know how to make it.
### Installation on other targets
- Install KiCad 5.x
- Install KiCad 5.1.6 or newer
- Install Python 3.5 or newer
- Install the Python Yaml and requests modules
- Run the script *src/kibot*

View File

@ -72,7 +72,8 @@ log.set_domain('kibot')
logger = log.init()
from .docopt import docopt
from .gs import (GS)
from .misc import NO_PCB_FILE, NO_SCH_FILE, EXIT_BAD_ARGS, W_VARSCH, W_VARCFG, W_VARPCB, NO_PCBNEW_MODULE, KICAD_VERSION_5_99
from .misc import (NO_PCB_FILE, NO_SCH_FILE, EXIT_BAD_ARGS, W_VARSCH, W_VARCFG, W_VARPCB, NO_PCBNEW_MODULE,
KICAD_VERSION_5_99, W_NOKIVER)
from .pre_base import (BasePreFlight)
from .config_reader import (CfgYamlReader, print_outputs_help, print_output_help, print_preflights_help, create_example,
print_filters_help)
@ -211,7 +212,12 @@ def detect_kicad():
" Is KiCad installed?"
" Do you need to add it to PYTHONPATH?")
sys.exit(NO_PCBNEW_MODULE)
GS.kicad_version = pcbnew.GetBuildVersion()
try:
GS.kicad_version = pcbnew.GetBuildVersion()
except AttributeError:
logger.warning(W_NOKIVER+"Unknown KiCad version, please install KiCad 5.1.6 or newer")
# Assume the best case
GS.kicad_version = '5.1.5'
m = re.search(r'(\d+)\.(\d+)\.(\d+)', GS.kicad_version)
GS.kicad_version_major = int(m.group(1))
GS.kicad_version_minor = int(m.group(2))

View File

@ -166,6 +166,7 @@ W_FAILDL = '(W048) '
W_NOLAYER = '(W049) '
W_EMPTYZIP = '(W050) '
W_WRONGCHAR = '(W051) '
W_NOKIVER = '(W052) '
class Rect(object):