Changeset 0c6fd4c in ammosreader


Ignore:
Timestamp:
05/28/23 09:52:29 (2 years ago)
Author:
Enrico Schwass <ennoausberlin@…>
Branches:
AmmosSource
Children:
0fcd6da
Parents:
008dcb7
Message:

typo fixed

Location:
ammosreader
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ammosreader/AbstractAmmosReader.py

    r008dcb7 r0c6fd4c  
    2020
    2121        :param source: The source to read Ammos data from
    22         :type source: AmmosSource 
     22        :type source: AmmosSource
    2323        """
    2424        self.__source = source
     
    9292        """My descendents have to implement this."""
    9393        return self.__source.read_bytes(bytes_to_read)
    94    
     94
    9595    @abstractmethod
    9696    def read_next_global_frame_body(self, data_header_length):
     
    106106        """
    107107        global_frame_header = self.read_next_global_frame_header()
    108 
    109         if global_frame_header is None:
    110             return None
    111108
    112109        if global_frame_header is None:
     
    136133            global_frame_body = self.read_next_global_frame_body(global_frame_header.data_header_length)
    137134            if global_frame_body is None:
     135                logger.info("Can not read global frame body for audio data stream")
    138136                return None
    139137            return AmmosSingleFrame(global_frame_header, global_frame_body)
     
    143141            global_frame_body = self.read_next_global_frame_body(global_frame_header.data_header_length)
    144142            if global_frame_body is None:
     143                logger.info("Can not read global frame body for IF data stream")
    145144                return None
    146145            return AmmosSingleFrame(global_frame_header, global_frame_body)
    147146
    148147        if global_frame_body is None:
     148            logger.info("Can not read global frame body")
    149149            return None
    150150
  • ammosreader/AmmosSocketSource.py

    r008dcb7 r0c6fd4c  
     1"""I provide a source to read AMMOS data from a socket."""
     2
    13import socket
    24
    35from ammosreader.AmmosSource import AmmosSource
     6from ammosreader import logger
     7
    48
    59class AmmosSocketSource(AmmosSource):
     10    """I implement a descendent of AmmosSource that reads from a socket."""
    611
    712    def read_bytes(self, bytes_to_read):
     
    1823                logger.info("Got %s bytes of %s remaining", len(new_bytes), bytes_to_read - len(b''.join(byte_array)))
    1924                byte_array.append(new_bytes)
    20         except: TimeOutError:
     25        except TimeoutError:
    2126            return None
    2227        return b''.join(byte_array)
Note: See TracChangeset for help on using the changeset viewer.