sbsv2/raptor/python/raptor_api.py
author kelvzhu
Tue, 27 Jul 2010 13:00:43 +0800
changeset 621 96fee2635b19
parent 591 22486c9c7b15
child 625 a1925fb7753a
permissions -rw-r--r--
Fixed Bug 2413 for evalid
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
591
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
     1
#
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
     2
# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
     3
# All rights reserved.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
     4
# This component and the accompanying materials are made available
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
     6
# which accompanies this distribution, and is available
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
     8
#
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
     9
# Initial Contributors:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    11
#
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    12
# Contributors:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    13
#
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    14
# Description: 
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    15
#
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    16
# raptor_api module
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    17
#
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    18
# Python API for Raptor. External code should interact with Raptor via this
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    19
# module only, as it is the only programatic interface considered public. The
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    20
# command line --query option is also implemented using this module.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    21
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    22
# constants
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    23
ALL = 1
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    24
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    25
# objects
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    26
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    27
class Reply(object):
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    28
	"""object to return values from API calls.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    29
	"""
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    30
	def __init__(self, text=""):
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    31
		self.text = text
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    32
	
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    33
	def __str__(self):
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    34
		name = type(self).__name__.lower()
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    35
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    36
		string = "<" + name
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    37
		children = []
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    38
		longend = False
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    39
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    40
		for attribute,value in self.__dict__.items():
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    41
			if attribute != "text":
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    42
				if isinstance(value, Reply):
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    43
					children.append(value)
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    44
				else:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    45
					string += " %s='%s'" % (attribute, value)
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    46
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    47
		if children or self.text:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    48
			string += ">"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    49
			longend = True
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    50
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    51
		if self.text:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    52
			string += self.text
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    53
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    54
		if children:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    55
			string += "\n"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    56
				
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    57
		for c in children:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    58
			string += str(c)
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    59
			
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    60
		if longend:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    61
			string += "</%s>\n" % name
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    62
		else:	
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    63
			string += "/>\n"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    64
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    65
		return string
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    66
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    67
class Alias(Reply):
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    68
	def __init__(self, name, meaning):
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    69
		super(Alias,self).__init__()
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    70
		self.name = name
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    71
		self.meaning = meaning
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    72
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    73
class Config(Reply):
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    74
	def __init__(self, fullname, outputpath):
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    75
		super(Config,self).__init__()
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    76
		self.fullname = fullname
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    77
		self.outputpath = outputpath
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    78
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    79
class Product(Reply):
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    80
	def __init__(self, name):
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    81
		super(Product,self).__init__()
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    82
		self.name = name
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    83
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    84
import generic_path
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    85
import raptor
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    86
import raptor_data
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    87
import re
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    88
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    89
class Context(object):
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    90
	"""object to contain state information for API calls.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    91
	
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    92
	For example,
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    93
	
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    94
	api = raptor_api.Context()
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    95
	val = api.getaliases("X")
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    96
	"""
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    97
	def __init__(self, initialiser=None):
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    98
		# this object has a private Raptor object that can either be
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    99
		# passed in or created internally.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   100
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   101
		if initialiser == None:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   102
			self.__raptor = raptor.Raptor()
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   103
		else:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   104
			self.__raptor = initialiser
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   105
			
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   106
	def stringquery(self, query):
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   107
		"""turn a string into an API call and execute it.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   108
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   109
		This is a convenience method for "lazy" callers.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   110
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   111
		The return value is also converted into a well-formed XML string.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   112
		"""
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   113
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   114
		if query == "aliases":
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   115
			aliases = self.getaliases()
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   116
			return "".join(map(str, aliases)).strip()
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   117
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   118
		elif query == "products":
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   119
			variants = self.getproducts()
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   120
			return "".join(map(str, variants)).strip()
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   121
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   122
		elif query.startswith("config"):
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   123
			match = re.match("config\[(.*)\]", query)
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   124
			if match:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   125
				config = self.getconfig(match.group(1))
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   126
				return str(config).strip()
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   127
			else:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   128
				raise BadQuery("syntax error")
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   129
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   130
		raise BadQuery("unknown query")
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   131
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   132
	def getaliases(self, type=""):
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   133
		"""extract all aliases of a given type.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   134
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   135
		the default type is "".
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   136
		to get all aliases pass type=ALL
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   137
		"""
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   138
		aliases = []
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   139
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   140
		for a in self.__raptor.cache.aliases.values():
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   141
			if type == ALL or a.type == type:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   142
				# copy the members we want to expose
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   143
				aliases.append( Alias(a.name, a.meaning) )
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   144
			
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   145
		return aliases
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   146
	
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   147
	def getconfig(self, name):
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   148
		"""extract the values for a given configuration.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   149
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   150
		'name' should be an alias or variant followed optionally by a
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   151
		dot-separated list of variants. For example "armv5_urel" or
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   152
		"armv5_urel.savespace.vasco".
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   153
		"""
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   154
		names = name.split(".")
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   155
		if names[0] in self.__raptor.cache.aliases:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   156
			x = self.__raptor.cache.FindNamedAlias(names[0])
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   157
			
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   158
			if len(names) > 1:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   159
				fullname = x.meaning + "." + ".".join(names[1:])
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   160
			else:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   161
				fullname = x.meaning
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   162
				
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   163
		elif names[0] in self.__raptor.cache.variants:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   164
			fullname = name
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   165
			
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   166
		else:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   167
			raise BadQuery("'%s' is not an alias or a variant" % names[0])
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   168
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   169
		# create an evaluator for the named configuration
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   170
		tmp = raptor_data.Alias("tmp")
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   171
		tmp.SetProperty("meaning", fullname)
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   172
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   173
		units = tmp.GenerateBuildUnits(self.__raptor.cache)
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   174
		evaluator = self.__raptor.GetEvaluator(None, units[0])
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   175
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   176
		# get the outputpath
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   177
		# this is messy as some configs construct the path inside the FLM
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   178
		# rather than talking it from the XML: usually because of some
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   179
		# conditional logic... but maybe some refactoring could avoid that.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   180
		releasepath = evaluator.Get("RELEASEPATH")
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   181
		if not releasepath:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   182
			raise BadQuery("could not get RELEASEPATH for config '%s'" % name)
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   183
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   184
		variantplatform = evaluator.Get("VARIANTPLATFORM")
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   185
		varianttype = evaluator.Get("VARIANTTYPE")
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   186
		featurevariantname = evaluator.Get("FEATUREVARIANTNAME")
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   187
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   188
		platform = evaluator.Get("TRADITIONAL_PLATFORM")
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   189
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   190
		if platform == "TOOLS2":
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   191
			outputpath = releasepath
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   192
		else:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   193
			if not variantplatform:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   194
				raise BadQuery("could not get VARIANTPLATFORM for config '%s'" % name)
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   195
			
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   196
			if featurevariantname:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   197
				variantplatform += featurevariantname
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   198
				
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   199
			if not varianttype:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   200
				raise BadQuery("could not get VARIANTTYPE for config '%s'" % name)
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   201
			
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   202
			outputpath = str(generic_path.Join(releasepath, variantplatform, varianttype))
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   203
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   204
		return Config(fullname, outputpath)
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   205
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   206
	def getproducts(self):
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   207
		"""extract all product variants."""
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   208
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   209
		variants = []
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   210
		
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   211
		for v in self.__raptor.cache.variants.values():
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   212
			if v.type == "product":
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   213
				# copy the members we want to expose
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   214
				variants.append( Product(v.name) )
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   215
			
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   216
		return variants
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   217
	
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   218
class BadQuery(Exception):
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   219
	pass
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   220
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   221
# end of the raptor_api module