mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2026-02-11 07:03:07 +01:00
Setup to remote project
This commit is contained in:
@@ -10,7 +10,7 @@ from datetime import datetime
|
|||||||
import re
|
import re
|
||||||
import pprint
|
import pprint
|
||||||
from platformio.project.config import ProjectConfig
|
from platformio.project.config import ProjectConfig
|
||||||
from platformio.project.exception import InvalidProjectConfError
|
|
||||||
|
|
||||||
Import("env")
|
Import("env")
|
||||||
#print(env.Dump())
|
#print(env.Dump())
|
||||||
@@ -104,17 +104,7 @@ def writeFileIfChanged(fileName,data):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def mergeConfig(base,other):
|
def mergeConfig(base,other):
|
||||||
try:
|
|
||||||
customconfig = env.GetProjectOption("custom_config")
|
|
||||||
except InvalidProjectConfError:
|
|
||||||
customconfig = None
|
|
||||||
for bdir in other:
|
for bdir in other:
|
||||||
if customconfig and os.path.exists(os.path.join(bdir,customconfig)):
|
|
||||||
cname=os.path.join(bdir,customconfig)
|
|
||||||
print("merge custom config {}".format(cname))
|
|
||||||
with open(cname,'rb') as ah:
|
|
||||||
base += json.load(ah)
|
|
||||||
continue
|
|
||||||
cname=os.path.join(bdir,"config.json")
|
cname=os.path.join(bdir,"config.json")
|
||||||
if os.path.exists(cname):
|
if os.path.exists(cname):
|
||||||
print("merge config %s"%cname)
|
print("merge config %s"%cname)
|
||||||
@@ -284,9 +274,9 @@ class Grove:
|
|||||||
def _ss(self,z=False):
|
def _ss(self,z=False):
|
||||||
if z:
|
if z:
|
||||||
return self.name
|
return self.name
|
||||||
return self.name if self.name != 'Z' else ''
|
return self.name if self.name is not 'Z' else ''
|
||||||
def _suffix(self):
|
def _suffix(self):
|
||||||
return '_'+self.name if self.name != 'Z' else ''
|
return '_'+self.name if self.name is not 'Z' else ''
|
||||||
def replace(self,line):
|
def replace(self,line):
|
||||||
if line is None:
|
if line is None:
|
||||||
return line
|
return line
|
||||||
@@ -526,17 +516,3 @@ env.Append(
|
|||||||
)
|
)
|
||||||
#script does not run on clean yet - maybe in the future
|
#script does not run on clean yet - maybe in the future
|
||||||
env.AddPostAction("clean",cleangenerated)
|
env.AddPostAction("clean",cleangenerated)
|
||||||
|
|
||||||
#look for extra task scripts and include them here
|
|
||||||
for taskdir in userTaskDirs:
|
|
||||||
script = os.path.join(taskdir, "extra_task.py")
|
|
||||||
if os.path.isfile(script):
|
|
||||||
taskname = os.path.basename(os.path.normpath(taskdir))
|
|
||||||
print("#extra task script for '{}'".format(taskname))
|
|
||||||
with open(script) as fh:
|
|
||||||
try:
|
|
||||||
code = compile(fh.read(), taskname, 'exec')
|
|
||||||
except SyntaxError:
|
|
||||||
print("#ERROR: script does not compile")
|
|
||||||
continue
|
|
||||||
exec(code)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user