Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/bitstring/__init__.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.3.1, created at 2023-09-25 06:15 +0000

1#!/usr/bin/env python 

2r""" 

3This package defines classes that simplify bit-wise creation, manipulation and 

4interpretation of data. 

5 

6Classes: 

7 

8Bits -- An immutable container for binary data. 

9BitArray -- A mutable container for binary data. 

10ConstBitStream -- An immutable container with streaming methods. 

11BitStream -- A mutable container with streaming methods. 

12Array -- An efficient list-like container where each item has a fixed-length binary format. 

13 

14Functions: 

15 

16pack -- Create a BitStream from a format string. 

17 

18Module Properties: 

19 

20bytealigned -- Determines whether a number of methods default to working only on byte boundaries. 

21lsb0 -- If True, the least significant bit (the final bit) is indexed as bit zero. 

22 

23Exceptions: 

24 

25Error -- Module exception base class. 

26CreationError -- Error during creation. 

27InterpretError -- Inappropriate interpretation of binary data. 

28ByteAlignError -- Whole byte position or length needed. 

29ReadError -- Reading or peeking past the end of a bitstring. 

30 

31https://github.com/scott-griffiths/bitstring 

32""" 

33 

34__licence__ = """ 

35The MIT License 

36 

37Copyright (c) 2006 Scott Griffiths (dr.scottgriffiths@gmail.com) 

38 

39Permission is hereby granted, free of charge, to any person obtaining a copy 

40of this software and associated documentation files (the "Software"), to deal 

41in the Software without restriction, including without limitation the rights 

42to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 

43copies of the Software, and to permit persons to whom the Software is 

44furnished to do so, subject to the following conditions: 

45 

46The above copyright notice and this permission notice shall be included in 

47all copies or substantial portions of the Software. 

48 

49THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 

50IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 

51FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 

52AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 

53LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 

54OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 

55THE SOFTWARE. 

56""" 

57 

58__version__ = "4.1.2" 

59 

60__author__ = "Scott Griffiths" 

61 

62import sys 

63 

64from bitstring.classes import Bits, BitArray, bytealigned, lsb0, _MyModuleType 

65from bitstring.bitstream import ConstBitStream, BitStream 

66from bitstring.methods import pack 

67from bitstring.bitstring_array import Array 

68from bitstring.exceptions import Error, ReadError, InterpretError, ByteAlignError, CreationError 

69 

70 

71sys.modules[__name__].__class__ = _MyModuleType 

72 

73 

74__all__ = ['ConstBitStream', 'BitStream', 'BitArray', 'Array', 

75 'Bits', 'pack', 'Error', 'ReadError', 'InterpretError', 

76 'ByteAlignError', 'CreationError', 'bytealigned', 'lsb0']