def buildOptionsColorCode(self):
		optionBands = []
		if(self.component == CAPACITOR_STR):
			## Check to make sure that the user specified their own values, and don't just append the defaults in.
			if(helpers.kwargExists("voltage", self.kwargs)):
				optionBands.append(RGB_COLORS[VOLTAGE_COLORS[self.voltage]])
			if(helpers.kwargExists("temperature", self.kwargs)):
				optionBands.append(RGB_COLORS[TEMPERATURE_COLORS[self.temperature]])

		return optionBands
    def buildOptionsColorCode(self):
        optionBands = []
        if (self.component == CAPACITOR_STR):
            ## Check to make sure that the user specified their own values, and don't just append the defaults in.
            if (helpers.kwargExists("voltage", self.kwargs)):
                optionBands.append(RGB_COLORS[VOLTAGE_COLORS[self.voltage]])
            if (helpers.kwargExists("temperature", self.kwargs)):
                optionBands.append(
                    RGB_COLORS[TEMPERATURE_COLORS[self.temperature]])

        return optionBands
 def __init__(self, **kwargs):
     self.sheetHeight = helpers.kwargExists("sheetHeight", kwargs)
     self.sheetWidth = helpers.kwargExists("sheetWidth", kwargs)
     self.upperMargin = helpers.kwargExists("upperMargin", kwargs)
     self.leftMargin = helpers.kwargExists("leftMargin", kwargs)
     self.middlePadding = helpers.kwargExists("middlePadding", kwargs)
     self.labelHeight = helpers.kwargExists("labelHeight", kwargs)
     self.labelWidth = helpers.kwargExists("labelWidth", kwargs)
     self.rows = helpers.kwargExists("rows", kwargs)
     self.cols = helpers.kwargExists("columns", kwargs)
    def __init__(self, dataObj, **kwargs):
        self.dataObj = dataObj
        self.kwargs = kwargs
        self.bandCount = helpers.kwargExists("bandCount", kwargs)
        self.condense = helpers.setBoolKwarg("condense", kwargs,
                                             CONDENSE_VALUE)
        self.showColorCodes = helpers.setBoolKwarg("showColorCodes", kwargs,
                                                   SHOW_COLOR_CODES)
        self.showTolerance = helpers.setBoolKwarg("showTolerance", kwargs,
                                                  SHOW_TOLERANCE)
        self.voltage = helpers.kwargExists("voltage", kwargs)
        self.temperature = helpers.kwargExists("temperature", kwargs)

        ## With all other data set, try to guess which component it is.
        self.component = helpers.kwargExists("component",
                                             kwargs) or self.guessComponent()

        ## With the component set, set the tolerance and then apply the user's units or pick them based off of the component.
        self.tolerance = helpers.kwargExists("tolerance", kwargs)
        self.unitName = helpers.kwargExists("unitName",
                                            kwargs) or self.setUnits()

        self._labels = []

        for value in self.dataObj.dataLines:
            text, colorCode = self.buildComponentLabel(value)
            self.labels.append(label.Label(text, colorCode))
	def __init__(self, sheetConfig, labels, **kwargs):
		## Load scale first so that it can be used to modify other incoming values
		self.scale = helpers.kwargExists("scale", kwargs)
		
		self.sheetConfig = sheetConfig
		self.labels = labels

		self.outputType = helpers.kwargExists("outputType", kwargs)
		self.font = helpers.kwargExists("font", kwargs)
		self.fontSize = helpers.kwargExists("fontSize", kwargs)
		self.boxSize = helpers.kwargExists("boxSize", kwargs)
		self.boxSpacerWidth = helpers.kwargExists("boxSpacerWidth", kwargs)
		self.labelsPerSticker = helpers.kwargExists("labelsPerSticker", kwargs)
		self.labelTextOffset = helpers.kwargExists("labelTextOffset", kwargs)
		self.labelColorCodeOffset = helpers.kwargExists("labelColorCodeOffset", kwargs)
		self.debug = helpers.setBoolKwarg("debug", kwargs, DEBUG)
		self.show = helpers.setBoolKwarg("show", kwargs, SHOW)
		self.dryRun = helpers.setBoolKwarg("dryRun", kwargs, DRY_RUN)

		self.drawSheet()
    def __init__(self, sheetConfig, labels, **kwargs):
        ## Load scale first so that it can be used to modify other incoming values
        self.scale = helpers.kwargExists("scale", kwargs)

        self.sheetConfig = sheetConfig
        self.labels = labels

        self.outputType = helpers.kwargExists("outputType", kwargs)
        self.font = helpers.kwargExists("font", kwargs)
        self.fontSize = helpers.kwargExists("fontSize", kwargs)
        self.boxSize = helpers.kwargExists("boxSize", kwargs)
        self.boxSpacerWidth = helpers.kwargExists("boxSpacerWidth", kwargs)
        self.labelsPerSticker = helpers.kwargExists("labelsPerSticker", kwargs)
        self.labelTextOffset = helpers.kwargExists("labelTextOffset", kwargs)
        self.labelColorCodeOffset = helpers.kwargExists(
            "labelColorCodeOffset", kwargs)
        self.debug = helpers.setBoolKwarg("debug", kwargs, DEBUG)
        self.show = helpers.setBoolKwarg("show", kwargs, SHOW)
        self.dryRun = helpers.setBoolKwarg("dryRun", kwargs, DRY_RUN)

        self.drawSheet()
	def __init__(self, dataObj, **kwargs):
		self.dataObj = dataObj
		self.kwargs = kwargs
		self.bandCount = helpers.kwargExists("bandCount", kwargs)
		self.condense = helpers.setBoolKwarg("condense", kwargs, CONDENSE_VALUE)
		self.showColorCodes = helpers.setBoolKwarg("showColorCodes", kwargs, SHOW_COLOR_CODES)
		self.showTolerance = helpers.setBoolKwarg("showTolerance", kwargs, SHOW_TOLERANCE)
		self.voltage = helpers.kwargExists("voltage", kwargs)
		self.temperature = helpers.kwargExists("temperature", kwargs)

		## With all other data set, try to guess which component it is.
		self.component = helpers.kwargExists("component", kwargs) or self.guessComponent()

		## With the component set, set the tolerance and then apply the user's units or pick them based off of the component.
		self.tolerance = helpers.kwargExists("tolerance", kwargs)
		self.unitName = helpers.kwargExists("unitName", kwargs) or self.setUnits()

		self._labels = []

		for value in self.dataObj.dataLines:
			text, colorCode = self.buildComponentLabel(value)
			self.labels.append(label.Label(text, colorCode))
 def guessComponent(self):
     if (helpers.kwargExists("voltage", self.kwargs)
             or helpers.kwargExists("temperature", self.kwargs)):
         return CAPACITOR_STR
     else:
         return RESISTOR_STR
	def guessComponent(self):
		if(helpers.kwargExists("voltage", self.kwargs) or helpers.kwargExists("temperature", self.kwargs)):
			return CAPACITOR_STR
		else:
			return RESISTOR_STR