objdictgen/objdictgen.py
changeset 512 e84806c0ada4
parent 283 e0b3096230e5
child 580 2ae92a99ac10
equal deleted inserted replaced
511:34300a28ad27 512:e84806c0ada4
    55     if fileIn != "" and fileOut != "":
    55     if fileIn != "" and fileOut != "":
    56         manager = NodeManager()
    56         manager = NodeManager()
    57         if os.path.isfile(fileIn):
    57         if os.path.isfile(fileIn):
    58             print "Parsing input file"
    58             print "Parsing input file"
    59             result = manager.OpenFileInCurrent(fileIn)
    59             result = manager.OpenFileInCurrent(fileIn)
    60             if type(result) != UnicodeType:
    60             if not isinstance(result, (StringType, UnicodeType)):
    61                 Node = result
    61                 Node = result
    62             else:
    62             else:
    63                 print result
    63                 print result
    64                 sys.exit(-1)
    64                 sys.exit(-1)
    65         else:
    65         else:
    66             print "%s is not a valid file!"%fileIn
    66             print "%s is not a valid file!"%fileIn
    67             sys.exit(-1)
    67             sys.exit(-1)
    68         print "Writing output file"
    68         print "Writing output file"
    69         result = manager.ExportCurrentToCFile(fileOut)
    69         result = manager.ExportCurrentToCFile(fileOut)
    70         if type(result) == UnicodeType:
    70         if isinstance(result, (UnicodeType, StringType)):
    71             print result
    71             print result
    72             sys.exit(-1)
    72             sys.exit(-1)
    73         print "All done"
    73         print "All done"
    74     
    74