Changeset View
Changeset View
Standalone View
Standalone View
bin/info.py
1 | ## | 1 | ## | ||
---|---|---|---|---|---|
2 | # | 2 | # | ||
3 | # @package this module contains the information class | 3 | # @package this module contains the information class | ||
4 | 4 | | |||
5 | # the current work here is to access members only | 5 | # the current work here is to access members only | ||
6 | # by methods to be able to separate the access from | 6 | # by methods to be able to separate the access from | ||
7 | # the definition | 7 | # the definition | ||
8 | 8 | | |||
9 | import datetime | 9 | import datetime | ||
10 | import os | 10 | import os | ||
11 | from collections import OrderedDict | 11 | from collections import OrderedDict | ||
12 | 12 | | |||
13 | import EmergeDebug | ||||
13 | import utils | 14 | import utils | ||
14 | import compiler | 15 | import compiler | ||
15 | from options import * | 16 | from options import * | ||
16 | import VersionInfo | 17 | import VersionInfo | ||
17 | 18 | | |||
18 | 19 | | |||
19 | class infoclass(object): | 20 | class infoclass(object): | ||
20 | """this module contains the information class""" | 21 | """this module contains the information class""" | ||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | 105 | def setSVNTargets( self ): | |||
105 | """default method for setting svn targets, override to set individual targets""" | 106 | """default method for setting svn targets, override to set individual targets""" | ||
106 | 107 | | |||
107 | def setBuildTarget( self, buildTarget = None): | 108 | def setBuildTarget( self, buildTarget = None): | ||
108 | """setup current build target""" | 109 | """setup current build target""" | ||
109 | self.buildTarget = self.defaultTarget | 110 | self.buildTarget = self.defaultTarget | ||
110 | if not buildTarget == None: | 111 | if not buildTarget == None: | ||
111 | self.buildTarget = buildTarget | 112 | self.buildTarget = buildTarget | ||
112 | if not self.buildTarget in list(self.targets.keys()) and not self.buildTarget in list(self.svnTargets.keys()) : | 113 | if not self.buildTarget in list(self.targets.keys()) and not self.buildTarget in list(self.svnTargets.keys()) : | ||
113 | utils.debug("build target %s not defined in available targets %s %s setting default target to %s" % (self.buildTarget, list(self.targets.keys()), list(self.svnTargets.keys()), self.defaultTarget), 1) | 114 | EmergeDebug.debug("build target %s not defined in available targets %s %s setting default target to %s" % (self.buildTarget, list(self.targets.keys()), list(self.svnTargets.keys()), self.defaultTarget), 1) | ||
114 | self.buildTarget = self.defaultTarget | 115 | self.buildTarget = self.defaultTarget | ||
115 | 116 | | |||
116 | def setBuildOptions( self ): | 117 | def setBuildOptions( self ): | ||
117 | """default method for setting build options, override to set individual targets""" | 118 | """default method for setting build options, override to set individual targets""" | ||
118 | return | 119 | return | ||
119 | 120 | | |||
120 | @staticmethod | 121 | @staticmethod | ||
121 | def getArchitecture(): | 122 | def getArchitecture(): | ||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Line(s) | 208 | def target( self ): | |||
209 | if self.buildTarget in list(self.targets.keys()): | 210 | if self.buildTarget in list(self.targets.keys()): | ||
210 | return self.targets[self.buildTarget] | 211 | return self.targets[self.buildTarget] | ||
211 | return "" | 212 | return "" | ||
212 | 213 | | |||
213 | def archiveName( self ): | 214 | def archiveName( self ): | ||
214 | """returns the archive file name""" | 215 | """returns the archive file name""" | ||
215 | if self.buildTarget in list(self.archiveNames.keys()): | 216 | if self.buildTarget in list(self.archiveNames.keys()): | ||
216 | return self.archiveNames[self.buildTarget] | 217 | return self.archiveNames[self.buildTarget] | ||
217 | return "" | 218 | return os.path.split(self.targets[self.buildTarget])[-1] | ||
218 | 219 | | |||
219 | def hasMultipleTargets( self ): | 220 | def hasMultipleTargets( self ): | ||
220 | """return whether we used a list of targets""" | 221 | """return whether we used a list of targets""" | ||
221 | return type( self.targets[self.buildTarget] ) == list | 222 | return type( self.targets[self.buildTarget] ) == list | ||
222 | 223 | | |||
223 | def targetCount( self ): | 224 | def targetCount( self ): | ||
224 | """return the number of targets given either in a list, or split by a space character""" | 225 | """return the number of targets given either in a list, or split by a space character""" | ||
225 | if self.hasMultipleTargets(): | 226 | if self.hasMultipleTargets(): | ||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | 279 | def hasInstallPath(self): | |||
280 | return (self.buildTarget in list(self.targets.keys()) or self.buildTarget in list(self.svnTargets.keys())) \ | 281 | return (self.buildTarget in list(self.targets.keys()) or self.buildTarget in list(self.svnTargets.keys())) \ | ||
281 | and self.buildTarget in list(self.targetInstallPath.keys()) | 282 | and self.buildTarget in list(self.targetInstallPath.keys()) | ||
282 | 283 | | |||
283 | def installPath(self): | 284 | def installPath(self): | ||
284 | """return relative path appendable to local install path for the recent target""" | 285 | """return relative path appendable to local install path for the recent target""" | ||
285 | if (self.buildTarget in list(self.targets.keys()) or self.buildTarget in list(self.svnTargets.keys())) \ | 286 | if (self.buildTarget in list(self.targets.keys()) or self.buildTarget in list(self.svnTargets.keys())) \ | ||
286 | and self.buildTarget in list(self.targetInstallPath.keys()): | 287 | and self.buildTarget in list(self.targetInstallPath.keys()): | ||
287 | return self.targetInstallPath[ self.buildTarget ] | 288 | return self.targetInstallPath[ self.buildTarget ] | ||
288 | utils.die("no install path for this build target defined") | 289 | EmergeDebug.die("no install path for this build target defined") | ||
289 | 290 | | |||
290 | def hasMergePath(self): | 291 | def hasMergePath(self): | ||
291 | """return true if relative path appendable to local merge path is given for the recent target""" | 292 | """return true if relative path appendable to local merge path is given for the recent target""" | ||
292 | return (self.buildTarget in list(self.targets.keys()) or self.buildTarget in list(self.svnTargets.keys())) \ | 293 | return (self.buildTarget in list(self.targets.keys()) or self.buildTarget in list(self.svnTargets.keys())) \ | ||
293 | and self.buildTarget in list(self.targetMergePath.keys()) | 294 | and self.buildTarget in list(self.targetMergePath.keys()) | ||
294 | 295 | | |||
295 | def mergePath(self): | 296 | def mergePath(self): | ||
296 | """return relative path appendable to local merge path for the recent target""" | 297 | """return relative path appendable to local merge path for the recent target""" | ||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |