CC-4029: Pypo Notify script incorrectly attempts to use pypo.log log file (should use notify log file)
-fixed
This commit is contained in:
parent
0a0e873ef9
commit
d6a5200d58
2 changed files with 25 additions and 38 deletions
|
@ -10,4 +10,4 @@ SCRIPT=`readlink -f $0`
|
||||||
# Absolute path this script is in
|
# Absolute path this script is in
|
||||||
SCRIPTPATH=`dirname $SCRIPT`
|
SCRIPTPATH=`dirname $SCRIPT`
|
||||||
|
|
||||||
cd ${SCRIPTPATH}/../ && python pypo-notify.py "$@"
|
cd ${SCRIPTPATH}/../ && python pyponotify.py "$@"
|
||||||
|
|
|
@ -15,19 +15,9 @@ Main case:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# python defaults (debian default)
|
from optparse import OptionParser
|
||||||
import time
|
|
||||||
import os
|
|
||||||
import traceback
|
|
||||||
from optparse import *
|
|
||||||
import sys
|
import sys
|
||||||
import time
|
|
||||||
import datetime
|
|
||||||
import logging
|
|
||||||
import logging.config
|
import logging.config
|
||||||
import urllib
|
|
||||||
import urllib2
|
|
||||||
import string
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
# additional modules (should be checked)
|
# additional modules (should be checked)
|
||||||
|
@ -38,9 +28,6 @@ from configobj import ConfigObj
|
||||||
from api_clients import *
|
from api_clients import *
|
||||||
from std_err_override import LogWriter
|
from std_err_override import LogWriter
|
||||||
|
|
||||||
# Set up command-line options
|
|
||||||
parser = OptionParser()
|
|
||||||
|
|
||||||
# help screeen / info
|
# help screeen / info
|
||||||
usage = "%prog [options]" + " - notification gateway"
|
usage = "%prog [options]" + " - notification gateway"
|
||||||
parser = OptionParser(usage=usage)
|
parser = OptionParser(usage=usage)
|
||||||
|
@ -60,7 +47,7 @@ parser.add_option("-y", "--source-status", help="source connection stauts", meta
|
||||||
|
|
||||||
# configure logging
|
# configure logging
|
||||||
logging.config.fileConfig("logging.cfg")
|
logging.config.fileConfig("logging.cfg")
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger('notify')
|
||||||
LogWriter.override_std_err(logger)
|
LogWriter.override_std_err(logger)
|
||||||
|
|
||||||
#need to wait for Python 2.7 for this..
|
#need to wait for Python 2.7 for this..
|
||||||
|
@ -85,9 +72,9 @@ class Notify:
|
||||||
logger.debug('#################################################')
|
logger.debug('#################################################')
|
||||||
logger.debug('# Calling server to update about what\'s playing #')
|
logger.debug('# Calling server to update about what\'s playing #')
|
||||||
logger.debug('#################################################')
|
logger.debug('#################################################')
|
||||||
logger.debug('data = '+ str(data))
|
logger.debug('data = ' + str(data))
|
||||||
response = self.api_client.notify_media_item_start_playing(data, media_id)
|
response = self.api_client.notify_media_item_start_playing(data, media_id)
|
||||||
logger.debug("Response: "+json.dumps(response))
|
logger.debug("Response: " + json.dumps(response))
|
||||||
|
|
||||||
# @pram time: time that LS started
|
# @pram time: time that LS started
|
||||||
def notify_liquidsoap_status(self, msg, stream_id, time):
|
def notify_liquidsoap_status(self, msg, stream_id, time):
|
||||||
|
@ -96,9 +83,9 @@ class Notify:
|
||||||
logger.debug('#################################################')
|
logger.debug('#################################################')
|
||||||
logger.debug('# Calling server to update liquidsoap status #')
|
logger.debug('# Calling server to update liquidsoap status #')
|
||||||
logger.debug('#################################################')
|
logger.debug('#################################################')
|
||||||
logger.debug('msg = '+ str(msg))
|
logger.debug('msg = ' + str(msg))
|
||||||
response = self.api_client.notify_liquidsoap_status(msg, stream_id, time)
|
response = self.api_client.notify_liquidsoap_status(msg, stream_id, time)
|
||||||
logger.debug("Response: "+json.dumps(response))
|
logger.debug("Response: " + json.dumps(response))
|
||||||
|
|
||||||
def notify_source_status(self, source_name, status):
|
def notify_source_status(self, source_name, status):
|
||||||
logger = logging.getLogger("notify")
|
logger = logging.getLogger("notify")
|
||||||
|
@ -106,9 +93,9 @@ class Notify:
|
||||||
logger.debug('#################################################')
|
logger.debug('#################################################')
|
||||||
logger.debug('# Calling server to update source status #')
|
logger.debug('# Calling server to update source status #')
|
||||||
logger.debug('#################################################')
|
logger.debug('#################################################')
|
||||||
logger.debug('msg = '+ str(source_name) + ' : ' + str(status))
|
logger.debug('msg = ' + str(source_name) + ' : ' + str(status))
|
||||||
response = self.api_client.notify_source_status(source_name, status)
|
response = self.api_client.notify_source_status(source_name, status)
|
||||||
logger.debug("Response: "+json.dumps(response))
|
logger.debug("Response: " + json.dumps(response))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print
|
print
|
Loading…
Add table
Add a link
Reference in a new issue