Fab automation (#2)
- Use KiKit for fab automation - Add splitflap scripts for exporting pcb pdfs, and switch to splitflap script for 3d rendering (for consistency with fab automation) - Added support in 3d rendering scripts for soldermask & silkscreen colors, option to skip virtual components - Added silkscreen to base and screen pcbs for commit and date info
This commit is contained in:
32
util/rev_info.py
Normal file
32
util/rev_info.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import datetime
|
||||
import subprocess
|
||||
|
||||
def git_short_rev():
|
||||
try:
|
||||
return subprocess.check_output([
|
||||
'git',
|
||||
'rev-parse',
|
||||
'--short',
|
||||
'HEAD',
|
||||
]).decode('utf-8').strip()
|
||||
except Exception:
|
||||
raise RuntimeError("Could not read git revision. Make sure you have git installed and you're working with a git clone of the repository.")
|
||||
|
||||
def current_date():
|
||||
return datetime.date.today().strftime('%Y-%m-%d')
|
||||
|
||||
def git_date(short=True):
|
||||
try:
|
||||
iso = subprocess.check_output([
|
||||
'git',
|
||||
'log',
|
||||
'-1',
|
||||
'--format=%ci',
|
||||
'HEAD',
|
||||
]).decode('utf-8').strip()
|
||||
if short:
|
||||
return iso.split(' ')[0]
|
||||
else:
|
||||
return iso
|
||||
except Exception:
|
||||
raise RuntimeError("Could not read git commit date. Make sure you have git installed and you're working with a git clone of the repository.")
|
||||
Reference in New Issue
Block a user