Coverage for casanova/casanova/defaults.py: 100%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

5 statements  

1# ============================================================================= 

2# Casanova Global Defaults 

3# ============================================================================= 

4# 

5# Global mutable defaults used by casanova classes. 

6# 

7DEFAULTS = { 

8 'prebuffer_bytes': None 

9} 

10 

11 

12def set_default_prebuffer_bytes(value): 

13 global DEFAULTS 

14 

15 if value is not None and (not isinstance(value, int) or value < 1): 

16 raise TypeError('expecting a positive integer') 

17 

18 DEFAULTS['prebuffer_bytes'] = value