Merge branch 'master' of dev.sourcefabric.org:campcaster

Conflicts:
	python_apps/show-recorder/install/recorder-daemontools.sh
This commit is contained in:
naomiaro 2011-03-24 23:10:04 -04:00
commit d5707c514b
13 changed files with 53 additions and 13 deletions

View File

@ -24,6 +24,8 @@ class UserController extends Zend_Controller_Action
$request = $this->getRequest(); $request = $this->getRequest();
$form = new Application_Form_AddUser(); $form = new Application_Form_AddUser();
$this->view->successMessage = "";
if ($request->isPost()) { if ($request->isPost()) {
if ($form->isValid($request->getPost())) { if ($form->isValid($request->getPost())) {
@ -42,6 +44,12 @@ class UserController extends Zend_Controller_Action
$user->save(); $user->save();
$form->reset(); $form->reset();
if (strlen($formdata['user_id']) == 0){
$this->view->successMessage = "<div class='success'>User added successfully!</div>";
} else {
$this->view->successMessage = "<div class='success'>User updated successfully!</div>";
}
} }
} }
} }

View File

@ -72,9 +72,9 @@ class Application_Form_AddUser extends Zend_Form
$select->setAttrib('class', 'input_select'); $select->setAttrib('class', 'input_select');
$select->setAttrib('style', 'width: 40%'); $select->setAttrib('style', 'width: 40%');
$select->setMultiOptions(array( $select->setMultiOptions(array(
"G" => "guest", "G" => "Guest",
"H" => "host", "H" => "Host",
"A" => "admin" "A" => "Admin"
)); ));
$select->setRequired(true); $select->setRequired(true);
$this->addElement($select); $this->addElement($select);

View File

@ -14,7 +14,7 @@
<div class="now-playing-info show"> <div class="now-playing-info show">
<div class="recording-show" style="display: none;"></div> <div class="recording-show" style="display: none;"></div>
<span id="playlist"></span> <span id="playlist"></span>
<span class="lenght">00:00</span> <span id="show-length" class="show-length"></span>
</div> </div>
<div class="progressbar"> <div class="progressbar">
<div class="progress-show" id='progress-show' style="width:0%;"></div> <div class="progress-show" id='progress-show' style="width:0%;"></div>

View File

@ -26,6 +26,7 @@
</div> </div>
</div> </div>
<div class="user-data simple-formblock" id="user_details"> <div class="user-data simple-formblock" id="user_details">
<?php echo $this->successMessage ?>
<fieldset class="padded"> <fieldset class="padded">
<?php echo $this->form ?> <?php echo $this->form ?>
</fieldset> </fieldset>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 990 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -184,7 +184,7 @@ select {
.progressbar .progress-show-error { .progressbar .progress-show-error {
background:#d40000 url(images/progressbar_show_error.png) repeat-x 0 0; background:#d40000 url(images/progressbar_show_error.png) repeat-x 0 0;
} }
.now-playing-info .lenght { .now-playing-info .show-length {
color:#c4c4c4; color:#c4c4c4;
padding-left:6px; padding-left:6px;
} }
@ -196,6 +196,7 @@ select {
.time-info-block { .time-info-block {
padding:0 14px 0 2px; padding:0 14px 0 2px;
background:url(images/masterpanel_spacer.png) no-repeat right 0; background:url(images/masterpanel_spacer.png) no-repeat right 0;
min-width:105px;
} }
.time-info-block ul { .time-info-block ul {
margin:0; margin:0;
@ -1218,6 +1219,16 @@ ul.errors li {
margin-bottom:2px; margin-bottom:2px;
border:1px solid #c83f3f; border:1px solid #c83f3f;
} }
div.success{
color:#3B5323;
font-size:11px;
padding:2px 4px;
background:#93DB70;
margin-bottom:2px;
border:1px solid #488214;
}
.collapsible-header { .collapsible-header {
border: 1px solid #8f8f8f; border: 1px solid #8f8f8f;
background-color: #cccccc; background-color: #cccccc;
@ -1479,7 +1490,7 @@ ul.errors li {
} }
.small-icon { .small-icon {
display:block; display:block;
width:21px; width:20px;
height:10px; height:10px;
float:right; float:right;
margin-left:3px; margin-left:3px;
@ -1491,3 +1502,17 @@ ul.errors li {
background:url(images/icon_rebroadcast.png) no-repeat 0 0; background:url(images/icon_rebroadcast.png) no-repeat 0 0;
} }
.medium-icon {
display:block;
width:25px;
height:12px;
float:right;
margin-left:4px;
}
.medium-icon.recording {
background:url(images/icon_record_m.png) no-repeat 0 0;
}
.medium-icon.rebroadcast {
background:url(images/icon_rebroadcast_m.png) no-repeat 0 0;
}

View File

@ -2,6 +2,7 @@ function populateForm(entries){
//$('#user_details').show(); //$('#user_details').show();
$('.errors').remove(); $('.errors').remove();
$('.success').remove();
$('#user_id').val(entries.id); $('#user_id').val(entries.id);
$('#login').val(entries.login); $('#login').val(entries.login);

View File

@ -165,11 +165,12 @@ function updatePlaybar(){
/* Column 1 update */ /* Column 1 update */
$('#playlist').text("Current Show:"); $('#playlist').text("Current Show:");
var recElem = $('.recording-show');
if (currentShow.length > 0){ if (currentShow.length > 0){
$('#playlist').text(currentShow[0].name); $('#playlist').text(currentShow[0].name);
var recElem = $('.recording-show');
(currentShow[0].record == "1") ? recElem.show(): recElem.hide(); (currentShow[0].record == "1") ? recElem.show(): recElem.hide();
} else {
recElem.hide();
} }
$('#show-length').empty(); $('#show-length').empty();

View File

@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
recorder_user="pypo" recorder_user="pypo"
export HOME="/home/pypo/" export HOME="/home/pypo/"
export TERM=xterm
# Location of pypo_cli.py Python script # Location of pypo_cli.py Python script
recorder_path="/opt/recorder/bin/" recorder_path="/opt/recorder/bin/"
recorder_script="testrecordscript.py" recorder_script="testrecordscript.py"
@ -8,8 +9,8 @@ recorder_script="testrecordscript.py"
api_client_path="/opt/pypo/" api_client_path="/opt/pypo/"
echo "*** Daemontools: starting daemon" echo "*** Daemontools: starting daemon"
cd ${recorder_path}
exec 2>&1 exec 2>&1
# Note the -u when calling python! we need it to get unbuffered binary stdout and stderr # Note the -u when calling python! we need it to get unbuffered binary stdout and stderr
sudo PYTHONPATH=${api_client_path} -u ${recorder_user} python -u ${recorder_path}${recorder_script} -f sudo PYTHONPATH=${api_client_path} -u ${recorder_user} python -u ${recorder_path}${recorder_script} -f
# EOF # EOF

View File

@ -13,7 +13,8 @@ from poster.encode import multipart_encode
from poster.streaminghttp import register_openers from poster.streaminghttp import register_openers
import urllib2 import urllib2
from subprocess import call #from subprocess import call
from subprocess import Popen, PIPE
from threading import Thread from threading import Thread
# For RabbitMQ # For RabbitMQ
@ -56,8 +57,10 @@ class ShowRecorder(Thread):
filename = self.filename.replace(" ", "-") filename = self.filename.replace(" ", "-")
filepath = "%s%s.%s" % (config["base_recorded_files"], filename, self.filetype) filepath = "%s%s.%s" % (config["base_recorded_files"], filename, self.filetype)
command = "ecasound -i alsa -o %s -t:%s" % (filepath, length) command = ("ecasound -i alsa -o %s -t:%s" % (filepath, length)).split(' ')
call(command, shell=True) print(command)
Popen(command, stdout=PIPE)
#call(command, shell=False)
return filepath return filepath