From 70192ad7c961a1fa218062166355bf43dabb5c6c Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 18 Sep 2012 18:19:29 -0400 Subject: [PATCH 1/7] update liquidsoap generation scripts --- dev_tools/fabric/fab_liquidsoap_compile.cfg | 2 +- dev_tools/fabric/fab_liquidsoap_compile.py | 90 ++++++++++++--------- 2 files changed, 51 insertions(+), 41 deletions(-) diff --git a/dev_tools/fabric/fab_liquidsoap_compile.cfg b/dev_tools/fabric/fab_liquidsoap_compile.cfg index 8b99725c3..81a2dcfa2 100644 --- a/dev_tools/fabric/fab_liquidsoap_compile.cfg +++ b/dev_tools/fabric/fab_liquidsoap_compile.cfg @@ -1,2 +1,2 @@ [main] -liquidsoap_tar_url = http://dl.dropbox.com/u/256410/airtime/liquidsoap-1.0.1-full.tar.gz +liquidsoap_tar_url = http://dl.dropbox.com/u/256410/airtime/savonet.tar.gz diff --git a/dev_tools/fabric/fab_liquidsoap_compile.py b/dev_tools/fabric/fab_liquidsoap_compile.py index 0db5ed501..b21d2de95 100644 --- a/dev_tools/fabric/fab_liquidsoap_compile.py +++ b/dev_tools/fabric/fab_liquidsoap_compile.py @@ -23,7 +23,7 @@ env.host_string env.vm_download_url = "http://host.sourcefabric.org/vms/VirtualBox" -#fab -f fab_setup.py ubuntu_lucid_64 airtime_182_tar airtime_190_tar +#fab -f fab_setup.py ubuntu_lucid_64 airtime_182_tar airtime_190_tar def do_sudo(command): result = sudo(command) @@ -33,7 +33,7 @@ def do_sudo(command): sys.exit(1) else: return result - + def do_run(command): result = run(command) if result.return_code != 0: @@ -42,7 +42,7 @@ def do_run(command): sys.exit(1) else: return result - + def do_local(command, capture=True): result = local(command, capture) if result.return_code != 0: @@ -55,11 +55,11 @@ def do_local(command, capture=True): def shutdown(): do_sudo("poweroff") time.sleep(30) - + def download_if_needed(vdi_dir, xml_dir, vm_name, vm_vdi_file, vm_xml_file): if not os.path.exists(vdi_dir): os.makedirs(vdi_dir) - + if os.path.exists(os.path.join(vdi_dir, vm_vdi_file)): print "File %s already exists. No need to re-download" % os.path.join(vdi_dir, vm_vdi_file) else: @@ -67,24 +67,24 @@ def download_if_needed(vdi_dir, xml_dir, vm_name, vm_vdi_file, vm_xml_file): tmpPath = do_local("mktemp", capture=True) do_local("wget %s/%s/%s -O %s"%(env.vm_download_url, vm_name, vm_vdi_file, tmpPath)) os.rename(tmpPath, os.path.join(vdi_dir, vm_vdi_file)) - + if os.path.exists(os.path.join(xml_dir, vm_xml_file)): print "File %s already exists. No need to re-download" % os.path.join(xml_dir, vm_xml_file) else: - do_local("wget %s/%s/%s -O %s"%(env.vm_download_url, vm_name, vm_xml_file, os.path.join(xml_dir, vm_xml_file))) - + do_local("wget %s/%s/%s -O %s"%(env.vm_download_url, vm_name, vm_xml_file, os.path.join(xml_dir, vm_xml_file))) + def create_fresh_os(vm_name, debian=False): - + vm_vdi_file = '%s.vdi'%vm_name vm_xml_file = '%s.xml'%vm_name vdi_dir = os.path.expanduser('~/tmp/vms/%s'%vm_name) vdi_snapshot_dir = os.path.expanduser('~/tmp/vms/%s/Snapshots'%vm_name) xml_dir = os.path.expanduser('~/.VirtualBox') vm_xml_path = os.path.join(xml_dir, vm_xml_file) - + download_if_needed(vdi_dir, xml_dir, vm_name, vm_vdi_file, vm_xml_file) - + if not os.path.exists("%s/vm_registered"%vdi_dir): do_local("VBoxManage registervm %s"%os.path.join(xml_dir, vm_xml_file), capture=True) @@ -98,7 +98,7 @@ def create_fresh_os(vm_name, debian=False): do_local('VBoxManage modifyvm "%s" --bridgeadapter1 eth0'%vm_name) do_local('VBoxManage startvm %s'%vm_name) print "Please wait while attempting to acquire IP address" - + time.sleep(15) try_again = True @@ -107,16 +107,16 @@ def create_fresh_os(vm_name, debian=False): triple = ret.partition(':') ip_addr = triple[2].strip(' \r\n') print "Address found %s"%ip_addr - + try_again = (len(ip_addr) == 0) time.sleep(1) - + env.hosts.append(ip_addr) env.host_string = ip_addr - + if debian: append('/etc/apt/sources.list', "deb http://www.debian-multimedia.org squeeze main non-free", use_sudo=True) - + def ubuntu_lucid_32(fresh_os=True): if (fresh_os): create_fresh_os('Ubuntu_10.04_32') @@ -124,7 +124,7 @@ def ubuntu_lucid_32(fresh_os=True): def ubuntu_lucid_64(fresh_os=True): if (fresh_os): create_fresh_os('Ubuntu_10.04_64') - + def ubuntu_maverick_32(fresh_os=True): if (fresh_os): create_fresh_os('Ubuntu_10.10_32') @@ -136,44 +136,44 @@ def ubuntu_maverick_64(fresh_os=True): def ubuntu_natty_32(fresh_os=True): if (fresh_os): create_fresh_os('Ubuntu_11.04_32') - + def ubuntu_natty_64(fresh_os=True): if (fresh_os): create_fresh_os('Ubuntu_11.04_64') - + def ubuntu_oneiric_32(fresh_os=True): if (fresh_os): create_fresh_os('Ubuntu_11.10_32') - + def ubuntu_oneiric_64(fresh_os=True): if (fresh_os): create_fresh_os('Ubuntu_11.10_64') - + def ubuntu_precise_64(fresh_os=True): if (fresh_os): create_fresh_os('Ubuntu_12.04_64') - + def ubuntu_precise_32(fresh_os=True): if (fresh_os): create_fresh_os('Ubuntu_12.04_32') - + def debian_squeeze_32(fresh_os=True): if (fresh_os): create_fresh_os('Debian_Squeeze_32', debian=True) - + def debian_squeeze_64(fresh_os=True): if (fresh_os): create_fresh_os('Debian_Squeeze_64', debian=True) def compile_liquidsoap(filename="liquidsoap"): - + config = ConfigParser() config.readfp(open('fab_liquidsoap_compile.cfg')) url = config.get('main', 'liquidsoap_tar_url') - + print "Will get liquidsoap from " + url - + do_sudo('apt-get update') do_sudo('apt-get upgrade -y --force-yes') do_sudo('apt-get install -y --force-yes ocaml-findlib libao-ocaml-dev libportaudio-ocaml-dev ' + \ @@ -181,22 +181,32 @@ def compile_liquidsoap(filename="liquidsoap"): 'libspeex-dev libspeexdsp-dev speex libladspa-ocaml-dev festival festival-dev ' + \ 'libsamplerate-dev libxmlplaylist-ocaml-dev libxmlrpc-light-ocaml-dev libflac-dev ' + \ 'libxml-dom-perl libxml-dom-xpath-perl patch autoconf libmp3lame-dev ' + \ - 'libcamomile-ocaml-dev libcamlimages-ocaml-dev libtool libpulse-dev libjack-dev camlidl') - + 'libcamomile-ocaml-dev libcamlimages-ocaml-dev libtool libpulse-dev libjack-dev camlidl libfaad-dev') + root = '/home/martin/src' do_run('mkdir -p %s' % root) - + tmpPath = do_local("mktemp", capture=True) do_run('wget %s -O %s' % (url, tmpPath)) do_run('mv %s %s/liquidsoap.tar.gz' % (tmpPath, root)) do_run('cd %s && tar xzf liquidsoap.tar.gz' % root) - - do_run('cd %s/liquidsoap-1.0.1-full && cp PACKAGES.minimal PACKAGES' % root) - sed('%s/liquidsoap-1.0.1-full/PACKAGES' % root, '#ocaml-portaudio', 'ocaml-portaudio') - sed('%s/liquidsoap-1.0.1-full/PACKAGES' % root, '#ocaml-alsa', 'ocaml-alsa') - sed('%s/liquidsoap-1.0.1-full/PACKAGES' % root, '#ocaml-pulseaudio', 'ocaml-pulseaudio') - sed('%s/liquidsoap-1.0.1-full/PACKAGES' % root, '#ocaml-faad', 'ocaml-faad') - do_run('cd %s/liquidsoap-1.0.1-full && ./bootstrap' % root) - do_run('cd %s/liquidsoap-1.0.1-full && ./configure' % root) - do_run('cd %s/liquidsoap-1.0.1-full && make' % root) - get('%s/liquidsoap-1.0.1-full/liquidsoap-1.0.1/src/liquidsoap' % root, filename) + + #do_run('cd %s/liquidsoap-1.0.1-full && cp PACKAGES.minimal PACKAGES' % root) + #sed('%s/liquidsoap-1.0.1-full/PACKAGES' % root, '#ocaml-portaudio', 'ocaml-portaudio') + #sed('%s/liquidsoap-1.0.1-full/PACKAGES' % root, '#ocaml-alsa', 'ocaml-alsa') + #sed('%s/liquidsoap-1.0.1-full/PACKAGES' % root, '#ocaml-pulseaudio', 'ocaml-pulseaudio') + #sed('%s/liquidsoap-1.0.1-full/PACKAGES' % root, '#ocaml-faad', 'ocaml-faad') + #do_run('cd %s/liquidsoap-1.0.1-full && ./bootstrap' % root) + #do_run('cd %s/liquidsoap-1.0.1-full && ./configure' % root) + #do_run('cd %s/liquidsoap-1.0.1-full && make' % root) + #get('%s/liquidsoap-1.0.1-full/liquidsoap-1.0.1/src/liquidsoap' % root, filename) + + do_run('cd %s/savonet && cp PACKAGES.minimal PACKAGES' % root) + sed('%s/savonet/PACKAGES' % root, '#ocaml-portaudio', 'ocaml-portaudio') + sed('%s/savonet/PACKAGES' % root, '#ocaml-alsa', 'ocaml-alsa') + sed('%s/savonet/PACKAGES' % root, '#ocaml-pulseaudio', 'ocaml-pulseaudio') + sed('%s/savonet/PACKAGES' % root, '#ocaml-faad', 'ocaml-faad') + do_run('cd %s/savonet && ./bootstrap' % root) + do_run('cd %s/savonet && ./configure' % root) + do_run('cd %s/savonet && make' % root) + get('%s/savonet/liquidsoap/src/liquidsoap' % root, filename) From a9eefe21fa4d5c13c63eff500a018a2ccb43ce69 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Tue, 18 Sep 2012 18:20:33 -0400 Subject: [PATCH 2/7] cc-4304: Add call to save after each file reassignment --- airtime_mvc/application/controllers/UserController.php | 1 + airtime_mvc/application/models/airtime/CcFiles.php | 1 + 2 files changed, 2 insertions(+) diff --git a/airtime_mvc/application/controllers/UserController.php b/airtime_mvc/application/controllers/UserController.php index cf9d58b02..b05b76d84 100644 --- a/airtime_mvc/application/controllers/UserController.php +++ b/airtime_mvc/application/controllers/UserController.php @@ -140,6 +140,7 @@ class UserController extends Zend_Controller_Action //$new_owner_id = $this->_getParam("new_owner"); //$new_owner = new Application_Model_User($new_owner_id); $user->donateFilesTo( $new_owner ); + Logging::info("Reassign to user {$new_owner->getDbId()}"); } # Finally delete the user $this->view->entries = $user->delete(); diff --git a/airtime_mvc/application/models/airtime/CcFiles.php b/airtime_mvc/application/models/airtime/CcFiles.php index 0e17aef74..e7dd34a22 100644 --- a/airtime_mvc/application/models/airtime/CcFiles.php +++ b/airtime_mvc/application/models/airtime/CcFiles.php @@ -42,6 +42,7 @@ class CcFiles extends BaseCcFiles { public function reassignTo($user) { $this->setDbOwnerId( $user->getDbId() ); + $this->save(); } } // CcFiles From be4e02cbf1a7bfc9b4d7f349be26e900c7643126 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 18 Sep 2012 21:13:31 -0400 Subject: [PATCH 3/7] multiline comment on liquidsoap dev scripts --- dev_tools/fabric/fab_liquidsoap_compile.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dev_tools/fabric/fab_liquidsoap_compile.py b/dev_tools/fabric/fab_liquidsoap_compile.py index b21d2de95..a9548756f 100644 --- a/dev_tools/fabric/fab_liquidsoap_compile.py +++ b/dev_tools/fabric/fab_liquidsoap_compile.py @@ -176,12 +176,12 @@ def compile_liquidsoap(filename="liquidsoap"): do_sudo('apt-get update') do_sudo('apt-get upgrade -y --force-yes') - do_sudo('apt-get install -y --force-yes ocaml-findlib libao-ocaml-dev libportaudio-ocaml-dev ' + \ - 'libmad-ocaml-dev libtaglib-ocaml-dev libalsa-ocaml-dev libtaglib-ocaml-dev libvorbis-ocaml-dev ' + \ - 'libspeex-dev libspeexdsp-dev speex libladspa-ocaml-dev festival festival-dev ' + \ - 'libsamplerate-dev libxmlplaylist-ocaml-dev libxmlrpc-light-ocaml-dev libflac-dev ' + \ - 'libxml-dom-perl libxml-dom-xpath-perl patch autoconf libmp3lame-dev ' + \ - 'libcamomile-ocaml-dev libcamlimages-ocaml-dev libtool libpulse-dev libjack-dev camlidl libfaad-dev') + do_sudo('''apt-get install -y --force-yes ocaml-findlib libao-ocaml-dev libportaudio-ocaml-dev +libmad-ocaml-dev libtaglib-ocaml-dev libalsa-ocaml-dev libtaglib-ocaml-dev libvorbis-ocaml-dev +libspeex-dev libspeexdsp-dev speex libladspa-ocaml-dev festival festival-dev +libsamplerate-dev libxmlplaylist-ocaml-dev libxmlrpc-light-ocaml-dev libflac-dev +libxml-dom-perl libxml-dom-xpath-perl patch autoconf libmp3lame-dev +libcamomile-ocaml-dev libcamlimages-ocaml-dev libtool libpulse-dev libjack-dev camlidl libfaad-dev''') root = '/home/martin/src' do_run('mkdir -p %s' % root) From 7036036a866bfe2ba7e473f7b9b63590d11a9466 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 18 Sep 2012 21:29:02 -0400 Subject: [PATCH 4/7] CC-4476: Make all green notification boxes fade out after 5 seconds -fixed --- airtime_mvc/public/js/airtime/common/common.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/airtime_mvc/public/js/airtime/common/common.js b/airtime_mvc/public/js/airtime/common/common.js index bd162f980..aa449dddf 100644 --- a/airtime_mvc/public/js/airtime/common/common.js +++ b/airtime_mvc/public/js/airtime/common/common.js @@ -5,6 +5,10 @@ $(document).ready(function() { afterDetachCSSClass: "floated-panel", savePanelSpace: true }); + + + //this statement tells the browser to fade out any success message after 5 seconds + setTimeout(function(){$(".success").fadeOut("slow", function(){$(this).empty()});}, 5000); }); function adjustDateToServerDate(date, serverTimezoneOffset){ From fb4f7c1cb52c353c3f26ac64f8a4308fb2884c8d Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Wed, 19 Sep 2012 10:23:54 -0400 Subject: [PATCH 5/7] psr --- airtime_mvc/application/models/airtime/CcFiles.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/airtime/CcFiles.php b/airtime_mvc/application/models/airtime/CcFiles.php index e7dd34a22..329635152 100644 --- a/airtime_mvc/application/models/airtime/CcFiles.php +++ b/airtime_mvc/application/models/airtime/CcFiles.php @@ -40,7 +40,8 @@ class CcFiles extends BaseCcFiles { return $this; } - public function reassignTo($user) { + public function reassignTo($user) + { $this->setDbOwnerId( $user->getDbId() ); $this->save(); } From 58620203cf889b3ac78530bb733eca48f2e09305 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Wed, 19 Sep 2012 10:24:45 -0400 Subject: [PATCH 6/7] line wrap --- airtime_mvc/application/models/airtime/CcFiles.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/airtime/CcFiles.php b/airtime_mvc/application/models/airtime/CcFiles.php index 329635152..5e35d4790 100644 --- a/airtime_mvc/application/models/airtime/CcFiles.php +++ b/airtime_mvc/application/models/airtime/CcFiles.php @@ -30,7 +30,8 @@ class CcFiles extends BaseCcFiles { $dt = new DateTime($v); } catch (Exception $x) { - throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x); + throw new PropelException('Error parsing date/time value: ' . + var_export($v, true), $x); } } From 20b79374e2f230609e9aaad133609c5c1280a8b2 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Wed, 19 Sep 2012 10:25:29 -0400 Subject: [PATCH 7/7] Removed empty method --- airtime_mvc/application/controllers/UserController.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/airtime_mvc/application/controllers/UserController.php b/airtime_mvc/application/controllers/UserController.php index b05b76d84..9c09ceecb 100644 --- a/airtime_mvc/application/controllers/UserController.php +++ b/airtime_mvc/application/controllers/UserController.php @@ -13,10 +13,6 @@ class UserController extends Zend_Controller_Action ->initContext(); } - public function indexAction() - { - } - public function addUserAction() { global $CC_CONFIG;