Definition at line 26 of file ContentCheck.py.
◆ __init__()
def app.ContentCheck.ContentCheck.__init__ |
( |
|
self | ) |
|
◆ checkUrlObj()
def app.ContentCheck.ContentCheck.checkUrlObj |
( |
|
self, |
|
|
|
urlObj, |
|
|
|
checkType = CHECK_TYPE_SIMPLE |
|
) |
| |
Definition at line 66 of file ContentCheck.py.
66 def checkUrlObj(self, urlObj, checkType=CHECK_TYPE_SIMPLE):
68 if checkType == self.CHECK_TYPE_SIMPLE:
69 if urlObj.tagsCount <= 3:
◆ checkUrlPutObj()
def app.ContentCheck.ContentCheck.checkUrlPutObj |
( |
|
self, |
|
|
|
urlPutObj, |
|
|
|
checkType = CHECK_TYPE_SIMPLE , |
|
|
|
metricProperty = None |
|
) |
| |
Definition at line 80 of file ContentCheck.py.
80 def checkUrlPutObj(self, urlPutObj, checkType=CHECK_TYPE_SIMPLE, metricProperty=None):
82 useMetricProperty =
False 84 dataBuf = base64.b64decode(urlPutObj.putDict[
"data"])
85 if dataBuf
is not None:
86 dataElem = json.loads(dataBuf)
87 if dataElem
is not None:
88 Metrics.fillMetricModulesList()
89 metricsBuf = dataElem[0][
"metrics"]
90 metrics = json.loads(metricsBuf)
91 if metrics
is not None and isinstance(metrics, dict):
93 localList.append(
TmpObj(metrics=metrics))
95 if metricProperty
is not None:
97 localMetricProperty = json.loads(metricProperty)
98 for elem
in localMetricProperty[
"contentMetrics"]:
99 localResObjs = Metrics.selectElementsByMetric(localList, elem[
"NAME"], elem[
"LIMIT_MAX"],
101 if localMetricProperty[
"type"] == self.CHECK_TYPE_SIMPLE:
102 resObjs = localResObjs
104 elif localMetricProperty[
"type"] == self.CHECK_TYPE_OR:
105 resObjs += localResObjs
106 elif localMetricProperty[
"type"] == self.CHECK_TYPE_AND:
107 if len(localResObjs) == 0:
108 resObjs = localResObjs
110 useMetricProperty =
True 111 except Exception
as excp:
112 logger.debug(
">>> Wrong metric property = " + str(excp))
113 if not useMetricProperty:
114 if checkType == self.CHECK_TYPE_SIMPLE:
115 resObjs = Metrics.selectElementsByMetric(localList,
"TAGS_NUMBER",
None, 3)
116 if len(resObjs) == 0:
118 except Exception
as excp:
119 logger.debug(
">>> ContentCheck.checkUrlPutObj something wrong, err=" + str(excp))
◆ lookMetricsinContent()
def app.ContentCheck.ContentCheck.lookMetricsinContent |
( |
|
urlPutObj | ) |
|
|
static |
Definition at line 45 of file ContentCheck.py.
45 def lookMetricsinContent(urlPutObj):
48 dataBuf = base64.b64decode(urlPutObj.putDict[
"data"])
49 if dataBuf
is not None:
50 dataElem = json.loads(dataBuf)
51 if dataElem
is not None and len(dataElem) > 0
and "metrics" in dataElem[0]:
52 metricsBuf = dataElem[0][
"metrics"]
53 metrics = json.loads(metricsBuf)
54 if metrics
is not None and isinstance(metrics, dict):
56 except Exception
as excp:
57 logger.debug(
">>> Wrong content checking=" + str(excp))
◆ CHECK_TYPE_AND
int app.ContentCheck.ContentCheck.CHECK_TYPE_AND = 2 |
|
static |
◆ CHECK_TYPE_OR
int app.ContentCheck.ContentCheck.CHECK_TYPE_OR = 1 |
|
static |
◆ CHECK_TYPE_SIMPLE
int app.ContentCheck.ContentCheck.CHECK_TYPE_SIMPLE = 0 |
|
static |
The documentation for this class was generated from the following file: