def community(tokeniser): communities = Communities() value = tokeniser() if value == "[": while True: value = tokeniser() if value == "]": break communities.add(_community(value)) else: communities.add(_community(value)) return communities
def community (self, scope, name, command, tokens): communities = Communities() community = tokens.pop(0) try: if community == '[': while True: try: community = tokens.pop(0) except IndexError: return self.error.set(self.syntax) if community == ']': break communities.add(self._parse_community(scope,community)) else: communities.add(self._parse_community(scope,community)) except ValueError: return self.error.set(self.syntax) scope[-1]['announce'][-1].attributes.add(communities) return True
def community(tokeniser): communities = Communities() value = tokeniser() if value == '[': while True: value = tokeniser() if value == ']': break communities.add(_community(value)) else: communities.add(_community(value)) return communities
def community(self, scope, name, command, tokens): communities = Communities() community = tokens.pop(0) try: if community == '[': while True: try: community = tokens.pop(0) except IndexError: return self.error.set(self.syntax) if community == ']': break communities.add(self._parse_community(scope, community)) else: communities.add(self._parse_community(scope, community)) except ValueError: return self.error.set(self.syntax) scope[-1]['announce'][-1].attributes.add(communities) return True