Test + Impl: empty footprint
This commit is contained in:
@@ -2,17 +2,22 @@ from kiutils.footprint import Footprint
|
||||
|
||||
class Converter:
|
||||
footprint: Footprint
|
||||
template: str
|
||||
|
||||
def __init__(self, footprint: Footprint):
|
||||
self.footprint = footprint
|
||||
self.template = open("res/template.js").read()
|
||||
|
||||
def convert(self) -> str:
|
||||
return ""
|
||||
|
||||
main = self.footprint.to_sexpr()
|
||||
|
||||
# replace new footprint name with module to be consistent
|
||||
main = main.replace("footprint", "module")
|
||||
return self.replace_template(self.template, "", main, "", "")
|
||||
|
||||
@staticmethod
|
||||
def replace_template(params, main, captions, pins) -> str:
|
||||
template = open("res/template.js").read()
|
||||
|
||||
def replace_template(template: str, params: str, main: str, captions: str, pins: str) -> str:
|
||||
replacements = {
|
||||
"{% params %}": params,
|
||||
"{% main %}": main,
|
||||
|
||||
Reference in New Issue
Block a user