3 Created on Mar 02, 2016 7 @link: http://hierarchical-cluster-engine.com/ 8 @copyright: Copyright © 2013-2014 IOIX Ukraine 9 @license: http://hierarchical-cluster-engine.com/license/ 36 def __init__(self, config, templ=None, domain=None, processorProperties=None):
38 BaseExtractor.__init__(self, config, templ, domain, processorProperties)
40 self.
name =
"Custom extractor" 44 except Exception
as err:
45 ExceptionLog.handler(logger, err,
"Custom extractor constructor error: possible /tmp not permitted to write", (),
46 {ExceptionLog.LEVEL_NAME_ERROR:ExceptionLog.LEVEL_VALUE_DEBUG})
56 signal.signal(signal.SIGALRM, signal_handler)
60 t = CONSTS.TIME_EXECUTION_LIMIT
62 logger.debug(
"Max execution time signal handler set timeout as: %s", str(t))
65 if resource.raw_html
is not None and isinstance(resource.raw_html, types.DictType):
66 for key
in resource.raw_html:
67 localTagValue = resource.raw_html[key]
if isinstance(resource.raw_html[key], types.ListType)
else \
68 [str(resource.raw_html[key])]
69 self.
addTag(result=reslut, tag_name=key, tag_value=localTagValue)
70 except IOError
as err:
71 ExceptionLog.handler(logger, err,
"Custom extractor file error. It may be unsupported encoding like jp", (), \
72 {ExceptionLog.LEVEL_NAME_ERROR:ExceptionLog.LEVEL_VALUE_DEBUG})
73 except Exception
as err:
74 ExceptionLog.handler(logger, err,
"Custom extractor error", (), \
75 {ExceptionLog.LEVEL_NAME_ERROR:ExceptionLog.LEVEL_VALUE_DEBUG})
def varDump(obj, stringify=True, strTypeMaxLen=256, strTypeCutSuffix='...', stringifyType=1, ignoreErrors=False, objectsHash=None, depth=0, indent=2, ensure_ascii=False, maxDepth=10)