yml2c
changeset 12 fa6d87fbf242
parent 11 7026ccc7a60e
child 20 c936066cff62
equal deleted inserted replaced
11:7026ccc7a60e 12:fa6d87fbf242
    62 
    62 
    63     dirs = os.environ.get('YML_PATH', '.').split(':')
    63     dirs = os.environ.get('YML_PATH', '.').split(':')
    64     backend.includePath.extend(dirs)
    64     backend.includePath.extend(dirs)
    65 
    65 
    66     files = fileinput.input(args, mode="rU", openhook=fileinput.hook_encoded(options.encoding))
    66     files = fileinput.input(args, mode="rU", openhook=fileinput.hook_encoded(options.encoding))
    67     # fileinput suffer from two nasty bugs :
       
    68     # - ignoring open hook with stdin
       
    69     # - iterator requires ctrl-D to be pressed twice on some platform
       
    70     #if args in [[],['-']] :
       
    71     #    files._files=[]
       
    72     #    files._buffer=[unicode(line, options.encoding) for line in sys.stdin.readlines()]
       
    73 
    67 
    74     ymlC = ymlCStyle()
    68     ymlC = ymlCStyle()
    75     result = parse(ymlC, files, True, comment, packrat=True)
    69     result = parse(ymlC, files, True, comment, packrat=True)
    76 
    70 
    77     if options.parseonly:
    71     if options.parseonly: