Package conary :: Package build :: Module factory
[hide private]
[frames] | no frames]

Source Code for Module conary.build.factory

 1  # 
 2  # Copyright (c) 2008 rPath, Inc. 
 3  # 
 4  # This program is distributed under the terms of the Common Public License, 
 5  # version 1.0. A copy of this license should have been distributed with this 
 6  # source file in a file called LICENSE. If it is not present, the license 
 7  # is always available at http://www.rpath.com/permanent/licenses/CPL-1.0. 
 8  # 
 9  # This program is distributed in the hope that it will be useful, but 
10  # without any warranty; without even the implied warranty of merchantability 
11  # or fitness for a particular purpose. See the Common Public License for 
12  # full details. 
13  # 
14   
15  from conary.build.recipe import RECIPE_TYPE_FACTORY 
16  from conary.build.errors import RecipeFileError 
17   
18 -class FactoryException(RecipeFileError):
19 20 pass
21
22 -class Factory:
23 24 internalAbstractBaseClass = True 25 _recipeType = RECIPE_TYPE_FACTORY 26 _trackedFlags = None 27
28 - def __init__(self, packageName, sourceFiles = [], openSourceFileFn = None):
29 self.packageName = packageName 30 self.sources = sourceFiles 31 self._openSourceFileFn = openSourceFileFn
32 33 @classmethod
34 - def getType(class_):
35 return class_._recipeType
36 37 @classmethod
38 - def validateClass(class_):
39 if class_.version == '': 40 raise ParseError("empty release string")
41
42 - def openSourceFile(self, path):
43 return self._openSourceFileFn(path)
44