diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php
index 9644535b9..02fd5271b 100644
--- a/airtime_mvc/application/forms/AddShowWhen.php
+++ b/airtime_mvc/application/forms/AddShowWhen.php
@@ -209,8 +209,12 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
$interval = 'P21D';
} elseif ($formData["add_show_repeat_type"] == 5) {
$interval = 'P28D';
- } elseif ($formData["add_show_repeat_type"] == 2) {
+ } elseif ($formData["add_show_repeat_type"] == 2 && $formData["add_show_monthly_repeat_type"] == 2) {
$interval = 'P1M';
+ } elseif ($formData["add_show_repeat_type"] == 2 && $formData["add_show_monthly_repeat_type"] == 3) {
+ list($weekNumberOfMonth, $dayOfWeek) =
+ Application_Service_ShowService::getMonthlyWeeklyRepeatInterval(
+ new DateTime($start_time, $showTimezone));
}
/* Check first show
@@ -287,12 +291,26 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
$this->getElement('add_show_duration')->setErrors(array(_('Cannot schedule overlapping shows')));
break 1;
} else {
- $repeatShowStart->setTimezone($showTimezone);
- $repeatShowEnd->setTimezone($showTimezone);
- $repeatShowStart->add(new DateInterval($interval));
- $repeatShowEnd->add(new DateInterval($interval));
- $repeatShowStart->setTimezone($utc);
- $repeatShowEnd->setTimezone($utc);
+ if ($formData["add_show_repeat_type"] == 2 && $formData["add_show_monthly_repeat_type"] == 3) {
+ $monthlyWeeklyStart = new DateTime($repeatShowStart->format("Y-m"),
+ new DateTimeZone("UTC"));
+ $monthlyWeeklyStart->add(new DateInterval("P1M"));
+ $repeatShowStart = clone Application_Service_ShowService::getNextMonthlyWeeklyRepeatDate(
+ $monthlyWeeklyStart,
+ $formData["add_show_timezone"],
+ $formData['add_show_start_time'],
+ $weekNumberOfMonth,
+ $dayOfWeek);
+ $repeatShowEnd = clone $repeatShowStart;
+ $repeatShowEnd->add(new DateInterval("PT".$hours."H".$minutes."M"));
+ } else {
+ $repeatShowStart->setTimezone($showTimezone);
+ $repeatShowEnd->setTimezone($showTimezone);
+ $repeatShowStart->add(new DateInterval($interval));
+ $repeatShowEnd->add(new DateInterval($interval));
+ $repeatShowStart->setTimezone($utc);
+ $repeatShowEnd->setTimezone($utc);
+ }
}
}
}
diff --git a/airtime_mvc/application/models/Webstream.php b/airtime_mvc/application/models/Webstream.php
index a7e7d82b1..007e78938 100644
--- a/airtime_mvc/application/models/Webstream.php
+++ b/airtime_mvc/application/models/Webstream.php
@@ -88,11 +88,19 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
public static function deleteStreams($p_ids, $p_userId)
{
- $leftOver = self::streamsNotOwnedByUser($p_ids, $p_userId);
- if (count($leftOver) == 0) {
- CcWebstreamQuery::create()->findPKs($p_ids)->delete();
+ $userInfo = Zend_Auth::getInstance()->getStorage()->read();
+ $user = new Application_Model_User($userInfo->id);
+ $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
+
+ if (!$isAdminOrPM) {
+ $leftOver = self::streamsNotOwnedByUser($p_ids, $p_userId);
+ if (count($leftOver) == 0) {
+ CcWebstreamQuery::create()->findPKs($p_ids)->delete();
+ } else {
+ throw new WebstreamNoPermissionException;
+ }
} else {
- throw new WebstreamNoPermissionException;
+ CcWebstreamQuery::create()->findPKs($p_ids)->delete();
}
}
diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php
index 5a2f22e63..0ffff6c77 100644
--- a/airtime_mvc/application/services/ShowService.php
+++ b/airtime_mvc/application/services/ShowService.php
@@ -1109,7 +1109,7 @@ SQL;
$start = $this->getNextRepeatingPopulateStartDateTime($showDay);
if (is_null($repeatInterval)&& $repeatType == REPEAT_MONTHLY_WEEKLY) {
- $repeatInterval = $this->getMonthlyWeeklyRepeatInterval($start, $timezone);
+ $repeatInterval = self::getMonthlyWeeklyRepeatInterval($start, $timezone);
}
//DatePeriod in user's local time
@@ -1212,7 +1212,7 @@ SQL;
// We will only need this if the repeat type is MONTHLY_WEEKLY
list($weekNumberOfMonth, $dayOfWeek) =
- $this->getMonthlyWeeklyRepeatInterval(
+ self::getMonthlyWeeklyRepeatInterval(
new DateTime($first_show, new DateTimeZone($timezone)));
$this->repeatType = $showDay->getDbRepeatType();
@@ -1272,7 +1272,7 @@ SQL;
$monthlyWeeklyStart = new DateTime($utcStartDateTime->format("Y-m"),
new DateTimeZone("UTC"));
$monthlyWeeklyStart->add(new DateInterval("P1M"));
- $start = $this->getNextMonthlyWeeklyRepeatDate(
+ $start = self::getNextMonthlyWeeklyRepeatDate(
$monthlyWeeklyStart,
$timezone,
$showDay->getDbStartTime(),
@@ -1294,7 +1294,7 @@ SQL;
* @param string $showStart
* @param string $timezone user's local timezone
*/
- private function getMonthlyWeeklyRepeatInterval($showStart)
+ public static function getMonthlyWeeklyRepeatInterval($showStart)
{
$start = clone $showStart;
$dayOfMonth = $start->format("j");
@@ -1369,7 +1369,7 @@ SQL;
* @param string (i.e. 'first', 'second') $weekNumberOfMonth
* @param string (i.e. 'Monday') $dayOfWeek
*/
- private function getNextMonthlyWeeklyRepeatDate(
+ public static function getNextMonthlyWeeklyRepeatDate(
$start,
$timezone,
$startTime,
diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js
index 4f03e6dfa..139660dd7 100644
--- a/airtime_mvc/public/js/airtime/showbuilder/builder.js
+++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js
@@ -1059,7 +1059,10 @@ var AIRTIME = (function(AIRTIME){
"");
}
- $toolbar.append($menu);
+ if (localStorage.getItem('user-type') != 'G') {
+ $toolbar.append($menu);
+ }
+
$menu = undefined;
$('#timeline-sa').click(function(){mod.selectAll();});
diff --git a/airtime_mvc/tests/application/models/database/datasets/test_checkOverlappingShows.xml b/airtime_mvc/tests/application/models/database/datasets/test_checkOverlappingShows.xml
index a3b746711..c188785f1 100644
--- a/airtime_mvc/tests/application/models/database/datasets/test_checkOverlappingShows.xml
+++ b/airtime_mvc/tests/application/models/database/datasets/test_checkOverlappingShows.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
+
@@ -338,4 +340,4 @@
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_ccShowInsertedIntoDatabase.xml b/airtime_mvc/tests/application/services/database/datasets/test_ccShowInsertedIntoDatabase.xml
index d790f8985..63d708773 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_ccShowInsertedIntoDatabase.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_ccShowInsertedIntoDatabase.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
+
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.xml b/airtime_mvc/tests/application/services/database/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.xml
index 3de4e16d9..3534b110f 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
1
+
@@ -134,4 +136,4 @@
1
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.xml b/airtime_mvc/tests/application/services/database/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.xml
index 7432957b5..9f538785c 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
+
@@ -104,4 +106,4 @@
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createLinkedShow.xml b/airtime_mvc/tests/application/services/database/datasets/test_createLinkedShow.xml
index 871729009..04d650680 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_createLinkedShow.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_createLinkedShow.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
1
+
@@ -134,4 +136,4 @@
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.xml b/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.xml
index b2140cdfd..3b4a2af2f 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
+
@@ -94,4 +96,4 @@
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.xml b/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.xml
index 69b6a471e..57d8453b1 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
+
@@ -94,4 +96,4 @@
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatNoRRShow.xml b/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatNoRRShow.xml
index dc49416a0..112bb8f07 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatNoRRShow.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatNoRRShow.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
+
@@ -84,4 +86,4 @@
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatRRShow.xml b/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatRRShow.xml
index d58ada9f5..32ba5b63e 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatRRShow.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatRRShow.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
+
@@ -248,4 +250,4 @@
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.xml b/airtime_mvc/tests/application/services/database/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.xml
index 854af10eb..4b820e959 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
+
@@ -94,4 +96,4 @@
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.xml b/airtime_mvc/tests/application/services/database/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.xml
index 2eb7e2b75..c14e4550d 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
+
@@ -94,4 +96,4 @@
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatNoEndNoRRShow.xml b/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatNoEndNoRRShow.xml
index b6a7c709b..197f3b635 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatNoEndNoRRShow.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatNoEndNoRRShow.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
+
@@ -134,4 +136,4 @@
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatRRShow.xml b/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatRRShow.xml
index b29bb7388..517a687fe 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatRRShow.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatRRShow.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
+
@@ -270,4 +272,4 @@
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstance.xml b/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstance.xml
index 108680979..84b85c245 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstance.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstance.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
+
@@ -134,4 +136,4 @@
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstanceAndAllFollowing.xml b/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstanceAndAllFollowing.xml
index cdf4f2e37..dfbe6f1ac 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstanceAndAllFollowing.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstanceAndAllFollowing.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
+
@@ -260,4 +262,4 @@
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowChangeNoEndOption.xml b/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowChangeNoEndOption.xml
index 20c281c17..e4923004d 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowChangeNoEndOption.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowChangeNoEndOption.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
+
@@ -94,4 +96,4 @@
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowInstance.xml b/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowInstance.xml
index 860e77eaa..a780eebe8 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowInstance.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowInstance.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
+
@@ -157,4 +159,4 @@
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.xml b/airtime_mvc/tests/application/services/database/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.xml
index 3de4e16d9..3534b110f 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
1
+
@@ -134,4 +136,4 @@
1
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.xml b/airtime_mvc/tests/application/services/database/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.xml
index d5f6ea36d..12be75eb6 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
+
@@ -134,4 +136,4 @@
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_unlinkLinkedShow.xml b/airtime_mvc/tests/application/services/database/datasets/test_unlinkLinkedShow.xml
index 27551bbc7..f279c0a23 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_unlinkLinkedShow.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_unlinkLinkedShow.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
+
@@ -134,4 +136,4 @@
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_weeklyToBiWeekly.xml b/airtime_mvc/tests/application/services/database/datasets/test_weeklyToBiWeekly.xml
index 9e65db067..5270b7acb 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_weeklyToBiWeekly.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_weeklyToBiWeekly.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
+
@@ -104,4 +106,4 @@
-
\ No newline at end of file
+
diff --git a/airtime_mvc/tests/application/services/database/datasets/test_weeklyToNoRepeat.xml b/airtime_mvc/tests/application/services/database/datasets/test_weeklyToNoRepeat.xml
index d1522d546..1076542fb 100644
--- a/airtime_mvc/tests/application/services/database/datasets/test_weeklyToNoRepeat.xml
+++ b/airtime_mvc/tests/application/services/database/datasets/test_weeklyToNoRepeat.xml
@@ -14,6 +14,7 @@
live_stream_pass
linked
is_linkable
+ image_path
1
test show
@@ -28,6 +29,7 @@
1
+
@@ -84,4 +86,4 @@
-
\ No newline at end of file
+
diff --git a/utils/upgrade.py b/utils/upgrade.py
new file mode 100755
index 000000000..d77ab86dc
--- /dev/null
+++ b/utils/upgrade.py
@@ -0,0 +1,54 @@
+#!/usr/bin/python
+
+import ConfigParser
+import argparse
+import requests
+from urlparse import urlparse
+import sys
+
+CONFIG_PATH='/etc/airtime/airtime.conf'
+GENERAL_CONFIG_SECTION = "general"
+
+def read_config_file(config_path):
+ """Parse the application's config file located at config_path."""
+ config = ConfigParser.SafeConfigParser()
+ try:
+ config.readfp(open(config_path))
+ except IOError as e:
+ print "Failed to open config file at " + config_path + ": " + e.strerror
+ exit(-1)
+ except Exception:
+ print e.strerror
+ exit(-1)
+
+ return config
+
+if __name__ == '__main__':
+ config = read_config_file(CONFIG_PATH)
+ api_key = config.get(GENERAL_CONFIG_SECTION, 'api_key')
+ base_url = config.get(GENERAL_CONFIG_SECTION, 'base_url')
+ base_dir = config.get(GENERAL_CONFIG_SECTION, 'base_dir')
+ action = "upgrade"
+ airtime_url = ""
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--downgrade', help='Downgrade the station', action="store_true")
+ parser.add_argument('station_url', help='station URL', nargs='?', default='')
+ args = parser.parse_args()
+
+ if args.downgrade:
+ action = "downgrade"
+
+ if airtime_url == "":
+ airtime_url = "http://%s%s" % (base_url, base_dir)
+
+ # Add http:// if you were lazy and didn't pass a scheme to this script
+ url = urlparse(airtime_url)
+ if not url.scheme:
+ airtime_url = "http://%s" % airtime_url
+
+ print "Requesting %s..." % action
+ r = requests.get("%s/%s" % (airtime_url, action), auth=(api_key, ''))
+ print r.text
+ r.raise_for_status()
+