Permalink
Browse files

Return map-files back

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
  • Loading branch information...
1 parent 41bacbf commit 895be3ae9633a375d8be3d6282f24b996495d512 @lemenkov committed Jun 10, 2011
Showing with 8 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +6 −0 priv/make_dict.py
  3. +1 −1 rebar.config
View
1 .gitignore
@@ -1,2 +1,3 @@
*.beam
+priv/dictionary*.map
*~
View
6 priv/make_dict.py
@@ -34,6 +34,7 @@ def parse(Filename):
FdIn = open(BaseDir + Filename)
FdOut = open("./include/" + Filename.replace('.', '_') + ".hrl", 'w')
+ FdOutMap = open("./priv/" + Filename.replace('.', '_') + ".map", 'w')
line = FdIn.readline()
while line:
@@ -43,6 +44,7 @@ def parse(Filename):
if AttrList[0] == 'VENDOR' and len(AttrList) > 2:
Vendor[AttrList[1]] = int(AttrList[2])
FdOut.write("-define( %s , %s ).\n" % (to_atom(AttrList[1]), AttrList[2]))
+ FdOutMap.write("{vendor, %s, \"%s\"}.\n" % (to_atom(AttrList[2]), AttrList[1]))
if AttrList[0] == 'BEGIN-VENDOR' and Vendor != {}:
VendorDefault = True
if AttrList[0] == 'END-VENDOR':
@@ -57,14 +59,18 @@ def parse(Filename):
# Vendor-specific data
if VendorDefault:
FdOut.write("-define( %s , {%s,%d} ).\n" % (to_atom(AttrList[1]), Vendor[Vendor.keys()[0]], to_int(AttrList[2]) ))
+ FdOutMap.write("{attribute, {%s,%d}, %s, \"%s\"}.\n" % (Vendor[Vendor.keys()[0]], to_int(AttrList[2]), AttrList[3], to_atom(AttrList[1])))
else:
FdOut.write("-define( %s , {%s,%d} ).\n" % (to_atom(AttrList[1]), Vendor[AttrList[4]], to_int(AttrList[2]) ))
+ FdOutMap.write("{attribute, {%s,%d}, %s, \"%s\"}.\n" % (Vendor[AttrList[4]], to_int(AttrList[2]), AttrList[3], to_atom(AttrList[1])))
else:
FdOut.write("-define( %s , %d ).\n" % (to_atom(AttrList[1]), to_int(AttrList[2])))
+ FdOutMap.write("{attribute, %d, %s, \"%s\"}.\n" % (to_int(AttrList[2]), AttrList[3], to_atom(AttrList[1])))
line = FdIn.readline()
FdIn.close()
FdOut.close()
+ FdOutMap.close()
DictList = os.listdir(BaseDir)
for i in DictList:
View
2 rebar.config
@@ -1,2 +1,2 @@
{pre_hooks, [{compile, "./priv/make_dict.py"}]}.
-{clean_files, ["ebin/*.beam", "ebin/eradius.app", "include/dictionary*.hrl"]}.
+{clean_files, ["ebin/*.beam", "ebin/eradius.app", "include/dictionary*.hrl", "priv/dictionary*.map"]}.

0 comments on commit 895be3a

Please sign in to comment.