pyloxi: generate subdirectory from version name
diff --git a/py_gen/codegen.py b/py_gen/codegen.py
index bbf9c5d..3b0988e 100644
--- a/py_gen/codegen.py
+++ b/py_gen/codegen.py
@@ -33,14 +33,6 @@
 import util
 from loxi_ir import *
 
-# Map from wire version to directory name
-versions = {
-    1: "of10",
-    2: "of11",
-    3: "of12",
-    4: "of13",
-}
-
 # Map from inheritance root to module name
 roots = {
     'of_header': 'message',
@@ -85,8 +77,8 @@
     render('pp.py')
     render('generic_util.py')
 
-    for wire_version, subdir in versions.items():
-        version = loxi_globals.OFVersions.from_wire(wire_version)
+    for version in loxi_globals.OFVersions.all_supported:
+        subdir = 'of' + version.version.replace('.', '')
         modules = build_ofclasses(version)
 
         render(os.path.join(subdir, '__init__.py'), template_name='init.py',