-changed references from campcaster to airtime in pypo/ directory

This commit is contained in:
mkonecny 2011-01-05 12:31:49 -05:00
parent 20c392343b
commit dcec6bf4b1
5 changed files with 25 additions and 25 deletions

View File

@ -1,4 +1,4 @@
project.home = /home/naomiaro/dev-campcaster/campcaster project.home = /path/to/airtime
project.build = ${project.home}/build project.build = ${project.home}/build
#Database driver #Database driver

View File

@ -14,13 +14,13 @@ Setting Up Your VHOST
The following is a sample VHOST you might want to consider for your project. The following is a sample VHOST you might want to consider for your project.
<VirtualHost *:80> <VirtualHost *:80>
DocumentRoot "/home/naomiaro/campcaster-refactor/campcaster/public" DocumentRoot "/home/naomiaro/campcaster-refactor/airtime/public"
ServerName campcaster.local ServerName airtime.local
# This should be omitted in the production environment # This should be omitted in the production environment
SetEnv APPLICATION_ENV development SetEnv APPLICATION_ENV development
<Directory "/home/naomiaro/campcaster-refactor/campcaster/public"> <Directory "/home/naomiaro/campcaster-refactor/airtime/public">
Options Indexes MultiViews FollowSymLinks Options Indexes MultiViews FollowSymLinks
AllowOverride All AllowOverride All
Order allow,deny Order allow,deny

View File

@ -20,8 +20,8 @@ from urlparse import urlparse
def api_client_factory(config): def api_client_factory(config):
if config["api_client"] == "campcaster": if config["api_client"] == "airtime":
return CampcasterApiClient(config) return AirTimeApiClient(config)
elif config["api_client"] == "obp": elif config["api_client"] == "obp":
return ObpApiClient(config) return ObpApiClient(config)
else: else:
@ -100,15 +100,15 @@ class ApiClientInterface:
# nil # nil
################################################################################ ################################################################################
# Campcaster API Client # Airtime API Client
################################################################################ ################################################################################
class CampcasterApiClient(ApiClientInterface): class AirTimeApiClient(ApiClientInterface):
def __init__(self, config): def __init__(self, config):
self.config = config self.config = config
def __get_campcaster_version(self, verbose = True): def __get_airtime_version(self, verbose = True):
logger = logging.getLogger() logger = logging.getLogger()
url = self.config["base_url"] + self.config["api_base"] + self.config["version_url"] url = self.config["base_url"] + self.config["api_base"] + self.config["version_url"]
url = url.replace("%%api_key%%", self.config["api_key"]) url = url.replace("%%api_key%%", self.config["api_key"])
@ -120,7 +120,7 @@ class CampcasterApiClient(ApiClientInterface):
logger.debug("Data: %s", data) logger.debug("Data: %s", data)
response_json = json.read(data) response_json = json.read(data)
version = response_json['version'] version = response_json['version']
logger.debug("Campcaster Version %s detected", version) logger.debug("Airtime Version %s detected", version)
except Exception, e: except Exception, e:
try: try:
if e[1] == 401: if e[1] == 401:
@ -137,7 +137,7 @@ class CampcasterApiClient(ApiClientInterface):
if e[1] == 404: if e[1] == 404:
if (verbose): if (verbose):
print '#####################################' print '#####################################'
print '# Unable to contact the Campcaster-API' print '# Unable to contact the Airtime-API'
print '# ' + url print '# ' + url
print '#####################################' print '#####################################'
return False return False
@ -145,7 +145,7 @@ class CampcasterApiClient(ApiClientInterface):
pass pass
version = 0 version = 0
logger.error("Unable to detect Campcaster Version - %s, Response: %s", e, response) logger.error("Unable to detect Airtime Version - %s, Response: %s", e, response)
return version return version
@ -168,22 +168,22 @@ class CampcasterApiClient(ApiClientInterface):
def is_server_compatible(self, verbose = True): def is_server_compatible(self, verbose = True):
version = self.__get_campcaster_version(verbose) version = self.__get_airtime_version(verbose)
if (version == 0 or version == False): if (version == 0 or version == False):
if (verbose): if (verbose):
print 'Unable to get Campcaster version number.' print 'Unable to get Airtime version number.'
print print
return False return False
elif (version[0:4] != "1.6."): elif (version[0:4] != "1.6."):
if (verbose): if (verbose):
print 'Campcaster version: ' + str(version) print 'Airtime version: ' + str(version)
print 'pypo not compatible with this version of Campcaster.' print 'pypo not compatible with this version of Airtime.'
print print
return False return False
else: else:
if (verbose): if (verbose):
print 'Campcaster version: ' + str(version) print 'Airtime version: ' + str(version)
print 'pypo is compatible with this version of Campcaster.' print 'pypo is compatible with this version of Airtime.'
print print
return True return True

View File

@ -1,9 +1,9 @@
import campcaster_api_client import airtime_api_client
import obp_api_client import obp_api_client
def create_api_client(config): def create_api_client(config):
if config["api_client"] == "campcaster": if config["api_client"] == "airtime":
return campcaster_api_client.CampcasterApiClient(config) return campcaster_api_client.AirtimeApiClient(config)
elif config["api_client"] == "obp": elif config["api_client"] == "obp":
return obp_api_client.ObpApiClient(config) return obp_api_client.ObpApiClient(config)

View File

@ -5,9 +5,9 @@
# Set the type of client you are using. # Set the type of client you are using.
# Currently supported types: # Currently supported types:
# 1) "obp" = Open Broadcast Platform # 1) "obp" = Open Broadcast Platform
# 2) "campcaster" # 2) "airtime"
# #
api_client = "campcaster" api_client = "airtime"
############################################ ############################################
# Directories / Hosts # # Directories / Hosts #
@ -66,7 +66,7 @@ cue_style = 'pre'
################################################################################ ################################################################################
##################### #####################
# Campcaster Config # # Airtime Config #
##################### #####################
# Value needed to access the API # Value needed to access the API
api_key = 'AAA' api_key = 'AAA'