yml2c
changeset 11 7026ccc7a60e
parent 7 f81a4471bc28
child 12 fa6d87fbf242
equal deleted inserted replaced
10:519fb60037ce 11:7026ccc7a60e
    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 :
    67     # fileinput suffer from two nasty bugs :
    68     # - ignoring open hook with stdin
    68     # - ignoring open hook with stdin
    69     # - iterator requires ctrl-D to be pressed twice on some platform
    69     # - iterator requires ctrl-D to be pressed twice on some platform
    70     if args in [[],['-']] :
    70     #if args in [[],['-']] :
    71         files._files=[]
    71     #    files._files=[]
    72         files._buffer=[unicode(line, options.encoding) for line in sys.stdin.readlines()]
    72     #    files._buffer=[unicode(line, options.encoding) for line in sys.stdin.readlines()]
    73 
    73 
    74     ymlC = ymlCStyle()
    74     ymlC = ymlCStyle()
    75     result = parse(ymlC, files, True, comment, packrat=True)
    75     result = parse(ymlC, files, True, comment, packrat=True)
    76 
    76 
    77     if options.parseonly:
    77     if options.parseonly: