Skip to content

Instantly share code, notes, and snippets.

@chenz
chenz / fix_dupes.py
Created December 4, 2016 16:34
Python script for fixing duplicates in minipro's device database.
#!/usr/bin/env python
# This script parses devices.h and prints a copy to stdout in which
# all duplicate entries are either removed, or renamed with a number
# appended if they have different contents.
import re
import sys
def log(msg):