Example #1
0
"""
Sample file to clean all server configs
"""

import sys
import os
from itertools import chain
sys.path.append(os.path.dirname(os.path.dirname(__file__)))

from evo import Evo

if __name__ == '__main__':
    server = Evo("127.0.0.1")
    configs = server.listConfig()
    for config_id in [c['configId'] for c in chain(*configs['data'].values())]:
        server.removeConfig(id=config_id)
    print server.listConfig()
Example #2
0
def test_evo_should_list_configs():
    server = Evo("127.0.0.1")
    response = server.listConfig()
    assert response['status'] == 'SUCCESS'
Example #3
0
def on_stream(ip, localStreamname):
    server = Evo(ip)
    return server.pushStream(
        uri=RTMP_ENDPOINT,
        keepAlive="1",
        localStreamname=localStreamname)
Example #4
0
from externaldata import ExternalData
from exchange import Exchange
from evo import Evo

dirName, fileName = os.path.split(os.path.abspath(__file__))
configFileName = dirName + os.path.sep + CONFIG_FILE_NAME

if os.path.isfile(configFileName):
    paramsFile = open(configFileName, 'r+')
    configParams = json.load(paramsFile)
    paramsFile.close()
else:
    print("Config file not found in {0}".format(configFileName))

if not 'external_db' in configParams:
    print('Section "external_db" not found in {0}'.format(configFileName))
    exit()

dataSource = ExternalData(**configParams['external_db'])

evolution = Evo(dataSource)

if not 'evo' in configParams:
    print('Section "evo" not found in {0}'.format(configFileName))
    exit()

evolution.init(**configParams['evo'])

evolution.run()

evolution.report()