'
- textlength = len(str(condition_dict.get('item')))
- condition_tooltip += '{}
'.format(condition_dict.get('item')) \
- if textlength > self.__textlimit else ''
- info_item = str(condition_dict.get('item'))[:self.__textlimit] + '.. ' * (textlength > self.__textlimit)
- info_eval = str(condition_dict.get('eval'))[:self.__textlimit] + '.. ' * (textlength > self.__textlimit)
- info_value = str(condition_dict.get(compare))[:self.__textlimit] + '.. ' * \
- (len(str(condition_dict.get(compare))) > self.__textlimit)
- info = info_eval if info_item == "None" and info_eval != "None" else info_item
- conditionlist += '{}'.format(info) if not item_none else ''
- textlength = len(str(condition_dict.get('eval')))
- condition_tooltip += '{}
'.format(condition_dict.get('eval')) \
- if textlength > self.__textlimit else ''
- info = info_value if info_item == "None" and info_eval != "None" else info_eval
- conditionlist += '{}'.format(info) if not eval_none and item_none else ''
- conditionlist += ' | '
+ info_status = str(condition_dict.get('status') or '')
+ info_item = str(condition_dict.get('item') or '')
+ info_eval = str(condition_dict.get('eval') or '')
+ info_compare = str(condition_dict.get(compare) or '')
+ if not status_none:
+ textlength = len(info_status)
+ if textlength > self.__textlimit:
+ if tooltip_count > 0:
+ condition_tooltip += '
'
+ tooltip_count += 1
+ condition_tooltip += '{}'.format(condition_dict.get('status'))
+ elif not item_none:
+ textlength = len(info_item)
+ if textlength > self.__textlimit:
+ if tooltip_count > 0:
+ condition_tooltip += '
'
+ tooltip_count += 1
+ condition_tooltip += '{}'.format(condition_dict.get('item'))
+ elif not eval_none:
+ textlength = len(info_eval)
+ if textlength > self.__textlimit:
+ if tooltip_count > 0:
+ condition_tooltip += '
'
+ tooltip_count += 1
+ condition_tooltip += '{}'.format(condition_dict.get('eval'))
+ else:
+ textlength = 0
+
+ info_item = info_item[:self.__textlimit] + '.. ' * int(textlength > self.__textlimit)
+ info_status = info_status[:self.__textlimit] + '.. ' * int(textlength > self.__textlimit)
+ info_eval = info_eval[:self.__textlimit] + '.. ' * int(textlength > self.__textlimit)
+ info_value = info_compare[:self.__textlimit] + '.. ' * \
+ int(len(info_compare) > self.__textlimit)
+ textlength = len(info_compare)
+ if textlength > self.__textlimit:
+ if tooltip_count > 0:
+ condition_tooltip += '
'
+ tooltip_count += 1
+ condition_tooltip += '{}'.format(condition_dict.get(compare))
+
+ if not status_none:
+ info = info_status
+ elif not item_none:
+ info = info_item
+ elif not eval_none:
+ info = info_eval
+ else:
+ info = ""
+ conditionlist += '{}'.format(info)
comparison = ">=" if not min_none and compare == "min"\
else "<=" if not max_none and compare == "max"\
else "older" if not agemin_none and compare == "agemin"\
@@ -199,23 +282,36 @@ def _conditionlabel(self, state, conditionset):
else "not updated by" if (not updatedby_none and compare == "updatedby"
and condition_dict.get('updatedbynegate') == 'True')\
else "updated by" if not updatedby_none and compare == "updatedby"\
+ else "not triggered by" if (not triggeredby_none and compare == "triggeredby"
+ and condition_dict.get('triggeredbynegate') == 'True')\
+ else "triggered by" if not triggeredby_none and compare == "triggeredby"\
else "!=" if (not value_none and compare == "value"
and condition_dict.get('negate') == 'True')\
else "=="
+
+ match_info = ''
+ if match and len(match) > 0:
+ match_info = match.get('value') if compare in ["min", "max", "value"]\
+ else match.get('age') if compare in ["agemin", "agemax", "age"]\
+ else match.get(compare)
conditionlist += '{} | '.format(comparison)
- conditionlist += '"{}"'.format(info) if not item_none and not eval_none else ''
- textlength = len(str(condition_dict.get(compare)))
- condition_tooltip += '{}
'.format(condition_dict.get(compare)) \
- if textlength > self.__textlimit else ''
+ conditionlist += '"{}"'.format(info) if not item_none and not status_none and not eval_none else ''
+
info = info_value
conditionlist += '{}'.format(info) if not condition_dict.get(compare) == 'None' and (
- (eval_none and not item_none) or (not eval_none and item_none)) else ''
+ (eval_none and not item_none) or (eval_none and not status_none) or \
+ (not eval_none and item_none) or (not eval_none and status_none)) else ''
conditionlist += ' (negate)' if condition_dict.get('negate') == 'True' and "age" \
not in compare and not compare == "value" else ''
conditionlist += ' (negate)' if condition_dict.get('agenegate') == 'True' and "age" in compare else ''
- conditionlist += ' |
'
- conditionlist += '