Removed OBP refs and code.
This commit is contained in:
parent
e99b23434e
commit
ca535ea763
13 changed files with 0 additions and 512 deletions
|
@ -1,4 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from json import *
|
||||
from status import *
|
|
@ -1,57 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import sys
|
||||
import time
|
||||
import urllib
|
||||
|
||||
import logging
|
||||
|
||||
import telnetlib
|
||||
import json
|
||||
|
||||
import os
|
||||
|
||||
ALLOWED_EXTS = ('mp3')
|
||||
|
||||
class Callable:
|
||||
def __init__(self, anycallable):
|
||||
self.__call__ = anycallable
|
||||
|
||||
class Status:
|
||||
def __init__(self, status_url):
|
||||
self.status_url = status_url
|
||||
def get_obp_version(self):
|
||||
logger = logging.getLogger("status.get_obp_version")
|
||||
# lookup OBP version
|
||||
try:
|
||||
response = urllib.urlopen(self.status_url)
|
||||
response_json = json.loads(response.read())
|
||||
obp_version = int(response_json['version'])
|
||||
logger.debug("OBP Version %s detected", obp_version)
|
||||
|
||||
except Exception, e:
|
||||
print e
|
||||
obp_version = 0
|
||||
logger.error("Unable to detect OBP Version - %s", e)
|
||||
|
||||
|
||||
return obp_version
|
||||
|
||||
|
||||
def check_ls(self, ls_host, ls_port):
|
||||
logger = logging.getLogger("status.get_ls_version")
|
||||
# lookup OBP version
|
||||
try:
|
||||
tn = telnetlib.Telnet(ls_host, ls_port)
|
||||
tn.write("\n")
|
||||
tn.write("version\n")
|
||||
tn.write("exit\n")
|
||||
print tn.read_all()
|
||||
logger.info("liquidsoap connection ok")
|
||||
return 1
|
||||
|
||||
except Exception, e:
|
||||
obp_version = 0
|
||||
logger.error("Unable to connect to liquidsoap")
|
||||
return 0
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue