Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
	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
Ejemplo n.º 3
0
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
Ejemplo n.º 4
0
 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