Merge branch '2.0.x' into devel

Conflicts:
	VERSION
	airtime_mvc/application/models/Schedule.php
	airtime_mvc/application/models/Show.php
	airtime_mvc/public/js/airtime/dashboard/helperfunctions.js
	install_minimal/include/airtime-constants.php
	python_apps/api_clients/api_client.py
	python_apps/pypo/pypocli.py
	python_apps/pypo/pypofetch.py
This commit is contained in:
Martin Konecny 2012-03-12 17:52:17 -04:00
commit 6f270bfb3d
21 changed files with 1664 additions and 293 deletions

View file

@ -81,12 +81,25 @@ try:
print " Found %s (%s) on %s architecture" % (fullname, codename, arch)
print " * Installing Liquidsoap binary"
if (os.path.exists("%s/liquidsoap_%s_%s"%(PATH_LIQUIDSOAP_BIN, codename, arch))):
shutil.copy("%s/liquidsoap_%s_%s"%(PATH_LIQUIDSOAP_BIN, codename, arch), "%s/liquidsoap"%PATH_LIQUIDSOAP_BIN)
else:
print "Unsupported system architecture."
sys.exit(1)
binary_path = os.path.join(PATH_LIQUIDSOAP_BIN, "liquidsoap_%s_%s" % (codename, arch))
try:
shutil.copy(binary_path, "%s/liquidsoap"%PATH_LIQUIDSOAP_BIN)
except IOError, e:
"""
shutil.copy can throw this exception for two reasons. First reason is that it cannot open the source file.
This is when the liquidsoap file we requested does not exist, and therefore tells the user we don't support
their OS/System architecture. The second reason for this exception is the shutil.copy cannot open the target file.
Since this script is being run as root (and we cannot install to a read-only device), this should never happen. So
it is safe to assume this exception is a result of the first case.
Note: We cannot simply use os.path.exists before this, since it sometimes gives us "false" incorrectly
"""
print "Unsupported OS/system architecture."
sys.exit(1)
#generate liquidsoap config file
#access the DB and generate liquidsoap.cfg under /etc/airtime/
ac = api_client.api_client_factory(config)

View file

@ -15,6 +15,7 @@ from threading import Thread
from subprocess import Popen, PIPE
from datetime import datetime
from datetime import timedelta
from Queue import Empty
import filecmp
from api_clients import api_client
@ -478,6 +479,19 @@ class PypoFetch(Thread):
while True:
self.logger.info("Loop #%s", loops)
try:
"""
our simple_queue.get() requires a timeout, in which case we
fetch the Airtime schedule manually. It is important to fetch
the schedule periodically because if we didn't, we would only
get schedule updates via RabbitMq if the user was constantly
using the Airtime interface.
If the user is not using the interface, RabbitMq messages are not
sent, and we will have very stale (or non-existent!) data about the
schedule.
Currently we are checking every 3600 seconds (1 hour)
"""
message = self.fetch_queue.get(block=True, timeout=3600)
self.handle_message(message)
except Exception, e: