nephos.recorder.channels
index
/media/hdd/Essentials/Chapter_Kgp_WOrk/GSoC/projectnephos_gsoc18/GSoC18Nephos/nephos/recorder/channels.py

Manages all operations related to channels, including adding, deleting and updating channel data

 
Modules
       
os
subprocess

 
Classes
       
builtins.object
ChannelHandler

 
class ChannelHandler(builtins.object)
    Class unifying all channel concerned methods
 
  Methods defined here:
add_channel(self)
Provides CLI to add a single channel
 
Returns
-------
channel_id
    type: int
    the unique id for the channel
display_channel(self)
Displays list of channels currently stored in the database
 
Returns
-------

Static methods defined here:
delete_channel()
Deletes channel from the database
 
Returns
-------
grab_ch_list()
Extracts the table of currently stored channels
 
Returns
-------
type: tuple
tuple containing column values for all the channels
insert_channels(ch_data)
Adds channels to the database
 
Parameters
----------
ch_data
    type: dict
    dict of channels' data to be appended to the channel table
 
Returns
-------
record_stream(ip_addr, addr, duration_secs, test=False)
Function to record stream from the ip address for the given duration,
and in the given addr.
 
Parameters
----------
ip_addr
    type: str
    IP address of the stream, format "host:port"
addr
    type: str
    absolute file path, without ".ts", to save the recording
duration_secs
    type: int
    duration to record the show in seconds
test
    type: bool
    True if run by channel online check test, False otherwise
 
Returns
-------
type: bool
True if successful, False otherwise

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Data
        CH_STAT_INDEX = 6
CMD_GET_CHANNELS = 'SELECT * FROM channels'
LOG = <logging.Logger object>
MIN_BYTES = 1024
__recording_dir__ = '/home/thealpha/Nephos/recordings'