예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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)
예제 #4
0
 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
예제 #5
0
 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)
예제 #6
0
 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)
예제 #7
0
 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)
예제 #8
0
파일: __init__.py 프로젝트: Garjy/RIDE
 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
예제 #9
0
 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)
예제 #11
0
 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)
     )
예제 #12
0
 def contains_keyword(self, name):
     if isinstance(name, basestring):
         return utils.eq(self.keyword_name or '', name)
     return name.match(self.keyword_name or '')
예제 #13
0
 def _name_taken(self, name):
     return any(utils.eq(name, item.name, ignore=['_'])
                for item in self._table if item != self._named_ctrl)
예제 #14
0
 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)
예제 #15
0
 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
예제 #16
0
 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
예제 #17
0
 def contains_keyword(self, name):
     return self._contains_keyword(name.match if not isinstance(name, basestring) else lambda i: utils.eq(i, name))