def _kw_name_match(self, item, expected): if isinstance(expected, basestring): return utils.eq(item, expected) or ( self._GIVEN_WHEN_THEN_MATCHER.match(item) and utils.eq( self._GIVEN_WHEN_THEN_MATCHER.sub('', item), expected)) return expected.match(item)
def contains_keyword(self, name): if PY2: istring = isinstance(name, basestring) or isinstance(name, unicode) elif PY3: istring = isinstance(name, basestring) matcher = name.match if not istring else lambda i: utils.eq(i, name) return self._contains_keyword(matcher)
def _validate(self, name): if self._orig_name is not None and utils.eq( name, self._orig_name, ignore=['_']): return '' return self._validation_method(name).error_message
def find_node_with_label(self, node, label): matcher = lambda n: utils.eq(self._tree.GetItemText(n), label) return self._find_node_with_predicate(node, matcher)
def contains_keyword(self, name): matcher = name.match if not isinstance(name, basestring) \ else lambda i: utils.eq(i, name) return self._contains_keyword(matcher)
def contains_keyword(self, name): return utils.eq(self.keyword_name or "", name)
def _name_taken(self, name): return any(utils.eq(name, item.name, ignore=['_']) for item in self._table if item != self._named_ctrl)
def _kw_name_match(self, item, expected): return utils.eq(item, expected) or ( self._GIVEN_WHEN_THEN_MATCHER.match(item) and utils.eq(self._GIVEN_WHEN_THEN_MATCHER.sub("", item), expected) )
def contains_keyword(self, name): if isinstance(name, basestring): return utils.eq(self.keyword_name or '', name) return name.match(self.keyword_name or '')
def contains_keyword(self, name): istring = isinstance(name, str) matcher = name.match if not istring else lambda i: utils.eq(i, name) return self._contains_keyword(matcher)
def validate_name(self, name): for uk in self.data.keyword_table.keywords: if uk != name and utils.eq(uk.name, name): return 'User keyword with this name already exists.' return None
def contains_keyword(self, name): return self._contains_keyword(name.match if not isinstance(name, basestring) else lambda i: utils.eq(i, name))