+from codecs import EncodedFile
+from urllib2 import urlopen
-input = codecs.open('oui.txt', 'r', 'latin-1', errors='replace')
+URI = "http://standards.ieee.org/develop/regauth/oui/oui.txt"
+input = EncodedFile(urlopen(URI), 'latin-1', errors='replace')
output = open('oui.py', 'w')
output.write("""# Copyright (C) 2011 Philipp Bunge
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+\"\"\"Listing of Organizational Unique Idnentifiers (OUIs). An OUI is a
+24-bit globally unique number assigned by the IEEE standards
+organization. Organizations can concatenate their number with another,
+internally issued number, to create a 48-bit or 64-bit identifier to
+uniquelly identify a piece of hardware. This is used, for example, to
+create MAC addresses, Bluetooth device addresses and ethernet addresses.
+The numbers here are a derivation of the IEEE public OUI listing,
-# printf(" 0x%s: \"%s\",\n", hex, name)