Enigma2-{Network,NetworkWizard,WirelessLan}: more work on wireless lan / networking...
[enigma2.git] / lib / actions / parseactions.py
index 683febd9a13f68c328696ccd465b56009972abd2..cad432a7e6f868a016db152a064411293f225e5a 100644 (file)
@@ -1,6 +1,6 @@
 # takes a header file, outputs action ids
 
-import token, tokenize, os, sys, string
+import tokenize, sys, string
 
 def filter(g):
        while 1:
@@ -48,6 +48,11 @@ def do_file(f, mode):
                if t == "enum" and state == classstate + 1:
                        actionname = tokens.next()
                        
+                       if actionname == "{":
+                               while tokens.next() != "}":
+                                       pass
+                               continue
+                       
                        if actionname[-7:] == "Actions":
                                if tokens.next() != "{":
                                        try:
@@ -60,7 +65,7 @@ def do_file(f, mode):
                                        except:
                                                pass
                                
-                                       raise "action enum must be simple."
+                                       raise Exception("action enum must be simple.")
                        
                                counter = 0
                        
@@ -77,14 +82,14 @@ def do_file(f, mode):
                                        
                                        if counter:
                                                if t != ",":
-                                                       raise "no comma"
+                                                       raise Exception("no comma")
                                                t = tokens.next()
                                
                                        if firsthit:
 
                                                if mode == "include":
                                                        # hack hack hack!!
-                                                       print "#include <lib" + f[2:] + ">"
+                                                       print "#include <lib/" + '/'.join(f.split('/')[-2:]) + ">"
                                                else:
                                                        print "\t// " + f