Skip to content
Snippets Groups Projects
Select Git revision
  • 7e436cb0ebddf1f60c1f39a89182beaee08ea34b
  • master default protected
  • wdt-fix
  • appDb-store-timing
  • wdt
  • koalo/bhi160
  • genofire/ble-rewrite
  • rahix/simple_menu
  • ch3/splashscreen
  • koalo/bhi160-works-but-dirty
  • ios-workarounds
  • koalo/wip/i2c-for-python
  • renze/safe_mode
  • renze/hatchery_apps
  • schneider/fundamental-test
  • koalo/factory-reset
  • msgctl/gfx_rle
  • msgctl/faultscreen
  • msgctl/textbuffer_api
  • schneider/bonding
  • schneider/bootloader-update-9a0d158
  • v1.3
  • v1.2
  • v1.1
  • v1.0
  • release-1
  • bootloader-v1
  • v0.0
28 results

col_deque.py

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    buffered_writer.py 560 B
    import uio as io
    
    try:
        io.BytesIO
        io.BufferedWriter
    except AttributeError:
        import sys
        print('SKIP')
        sys.exit()
    
    bts = io.BytesIO()
    buf = io.BufferedWriter(bts, 8)
    
    buf.write(b"foobar")
    print(bts.getvalue())
    buf.write(b"foobar")
    # CPython has different flushing policy, so value below is different
    print(bts.getvalue())
    buf.flush()
    print(bts.getvalue())
    buf.flush()
    print(bts.getvalue())
    
    # special case when alloc is a factor of total buffer length
    bts = io.BytesIO()
    buf = io.BufferedWriter(bts, 1)
    buf.write(b"foo")
    print(bts.getvalue())