当前位置: 首页>>代码示例>>Python>>正文


Python Tc2Config.settingsKeyJoin方法代码示例

本文整理汇总了Python中Tc2Config.settingsKeyJoin方法的典型用法代码示例。如果您正苦于以下问题:Python Tc2Config.settingsKeyJoin方法的具体用法?Python Tc2Config.settingsKeyJoin怎么用?Python Tc2Config.settingsKeyJoin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tc2Config的用法示例。


在下文中一共展示了Tc2Config.settingsKeyJoin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: gocrParamsFromQSettings

# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsKeyJoin [as 别名]
	def gocrParamsFromQSettings(klass, qSettings, settingsKey=None):
		"""reads gocr settings from settings
		@param qSettings: (L{QSettings})
		@param settingsKey: (str, list, None)
		@return:(dict) gocr settings
		"""
		params= {}
		if isinstance(settingsKey,tuple):
			settingsKey = Tc2Config.settingsKeyJoin(*settingsKey)

		chars = unicode(qSettings.value(Tc2Config.settingsKeyJoin(settingsKey, 'Chars'), '').toString().toUtf8(), 'Utf-8')
		params['chars'] = chars if chars else None

		grayLevel, ok = qSettings.value(Tc2Config.settingsKeyJoin(settingsKey, 'GrayLevel'), gocr.GrayLevelAuto).toInt()
		params['grayLevel'] = grayLevel if (ok and grayLevel >= gocr.GrayLevelMin and grayLevel <= gocr.GrayLevelMax) else None

		dustSize,ok = qSettings.value(Tc2Config.settingsKeyJoin(settingsKey, 'DustSize'), gocr.DustSizeAuto).toInt()
		params['dustSize'] = dustSize if (ok and dustSize >= gocr.DustSizeMin and dustSize <= gocr.DustSizeMax) else None

		wordSpacing,ok = qSettings.value(Tc2Config.settingsKeyJoin(settingsKey, 'WordSpacing'), gocr.WordSpacingAuto).toInt()
		params['wordSpacing'] = wordSpacing if (ok and wordSpacing >= gocr.WordSpacingMin and wordSpacing <= gocr.WordSpacingMax) else None

		certainty,ok = qSettings.value(Tc2Config.settingsKeyJoin(settingsKey, 'Certainty'), gocr.CertaintyDefault).toInt()
		params['certainty'] = certainty if (ok and certainty >= gocr.CertaintyMin and dustSize <= gocr.CertaintyMax) else None

		flagLayoutAnalysis = qSettings.value(Tc2Config.settingsKeyJoin(settingsKey, 'FlagLayoutAnalysis'), gocr.FlagLayoutAnalysisDefault).toBool()
		params['flagLayoutAnalysis'] = flagLayoutAnalysis

		flagContextCorrection = qSettings.value(Tc2Config.settingsKeyJoin(settingsKey, 'flagContextCorrection'), gocr.FlagContextCorrectionDefault).toBool()
		params['flagContextCorrection'] = flagContextCorrection

		flagCompareUnrecognizedChars = qSettings.value(Tc2Config.settingsKeyJoin(settingsKey, 'flagCompareUnrecognizedChars'), gocr.FlagCompareUnrecognizedCharsDefault).toBool()
		params['flagCompareUnrecognizedChars'] = flagCompareUnrecognizedChars

		flagCompareUnrecognizedChars = qSettings.value(Tc2Config.settingsKeyJoin(settingsKey, 'flagCompareUnrecognizedChars'), gocr.FlagCompareUnrecognizedCharsDefault).toBool()
		params['flagCompareUnrecognizedChars'] = flagCompareUnrecognizedChars

		flagDivideOverlappingChars = qSettings.value(Tc2Config.settingsKeyJoin(settingsKey, 'flagDivideOverlappingChars'), gocr.FlagDivideOverlappingCharsDefault).toBool()
		params['flagDivideOverlappingChars'] = flagDivideOverlappingChars

		flagPackChars = qSettings.value(Tc2Config.settingsKeyJoin(settingsKey, 'flagPackChars'), gocr.FlagPackCharsDefault).toBool()
		params['flagPackChars'] = flagPackChars

		flagPackChars = qSettings.value(Tc2Config.settingsKeyJoin(settingsKey, 'flagPackChars'), gocr.FlagPackCharsDefault).toBool()
		params['flagPackChars'] = flagPackChars

		flagInvertImage = qSettings.value(Tc2Config.settingsKeyJoin(settingsKey, 'flagInvertImage'), gocr.FlagInvertImageDefault).toBool()
		params['flagInvertImage'] = flagInvertImage

		outputType = unicode(qSettings.value(Tc2Config.settingsKeyJoin(settingsKey, 'OutputType'), gocr.OutputTypeDefault).toString().toUtf8(), 'Utf-8')
		params['outputType'] = outputType if outputType in gocr.OutputTypes else gocr.OutputTypeDefault

		outputPattern = unicode(qSettings.value(Tc2Config.settingsKeyJoin(settingsKey, 'OutputPattern'), '').toString().toUtf8(), 'Utf-8')
		print outputPattern
		params['outputPattern'] = outputPattern

		return params
开发者ID:Kostafun,项目名称:tablecrab,代码行数:59,代码来源:Tc2DialogOcrEditor.py

示例2: gocrParamsToQSettings

# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsKeyJoin [as 别名]
	def gocrParamsToQSettings(klass, params, qSettings, settingsKey=None):
		if isinstance(settingsKey,tuple):
			settingsKey = Tc2Config.settingsKeyJoin(*settingsKey)
		for name, value in params.items():
			key = Tc2Config.settingsKeyJoin(settingsKey, name[0].upper() + name[1:])
			qSettings.setValue(key, QtCore.QVariant(value))
开发者ID:Kostafun,项目名称:tablecrab,代码行数:8,代码来源:Tc2DialogOcrEditor.py


注:本文中的Tc2Config.settingsKeyJoin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。