Changeset 314 for proto


Ignore:
Timestamp:
Sep 25, 2009, 5:22:10 PM (10 years ago)
Author:
ksherdy
Message:

Move readfile to bitutil.py. Revert transpose_streams method name.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/u8u16.py

    r310 r314  
    1919
    2020import byteclass
    21 
    22 def readfile(filename):
    23         f = open(filename, 'r')
    24         contents = f.read()
    25         f.close()
    26         return contents
    27 
    2821
    2922def ShiftBack(stream):
     
    199192                outfile = open(sys.argv[2],"w")
    200193        else: outfile = sys.stdout
    201         u8data = readfile(sys.argv[1])
     194        u8data = bitutil.readfile(sys.argv[1])
    202195        u8len = len(u8data)
    203         (u8bit, EOF_mask) = bitutil.transpose_u8_byte_streams(u8data)
     196        (u8bit, EOF_mask) = bitutil.transpose_streams(u8data)
    204197        (u8, control, lex) = byteclass.classify_bytes(u8bit)
    205198        u8 = validate_utf8(u8)
Note: See TracChangeset for help on using the changeset viewer.