Skip to content

Instantly share code, notes, and snippets.

@Bidski
Bidski / install.py
Created September 10, 2019 00:36
Only copy data files for a specific host/platform
# Get list of data files
# Only get data files that are for the current target
regex = re.compile(
r"([a-zA-Z_/-]+)(config|scripts)(/(nu|i)gus({})?)?/([a-zA-Z]+\.yaml)".format(target.split(".")[3])
)
data_files = [
data_file.group(0)
for data_file in [regex.match(data_file) for data_file in b.cmake_cache["NUCLEAR_MODULE_DATA_FILES"]]
if data_file is not None
]
@Bidski
Bidski / pngmeta.py
Created March 6, 2019 00:22 — forked from dankrause/pngmeta.py
A command-line tool that manipulates png meta-data in a very Unix-like way. Requires the Python Imaging Library (PIL).
#!/usr/bin/env python
import json, optparse, sys
try:
import PIL.Image, PIL.PngImagePlugin
except:
print >> sys.stderr, "Unable to import Python Imaging Library. Please ensure that it is installed."
sys.exit(1)