Пример #1
0
   for o in out: print o
sender_port = rec.find("port")
if sender_port:
   sender_port = int(sender_port.string)
else: 
   for o in out: print o
# Put actions together
actions = {}
for action in rec.findAll("action"):
   source = action.find("source")
   if source:
      source = source.string.encode('utf-8','ignore')
   else: source=""
   target = action.find("target")
   if target:
      target = target.string.encode('utf-8','ignore')
   else: target=""
   if source and target: actions[source] = target
# Grab subscriber info
sender = bs.find("sender")
my_port = sender.find("port")
if my_port: my_port = int(my_port.string)
else: sys.exit()
my_ip = sender.find("ip")
if my_ip: my_ip = my_ip.string 
else: sys.exit()
# Create Loosey Client
loosey = LooseyClient(who, sender_ip, sender_port, actions, my_ip, my_port, triggerconfigfile, trialconfigfile)
# Send script!
loosey.send_script(out,burrito_word_count=burrito_word_count,act_number=act_number)