Example #1
0
 def execute(self, args):
     if args.ADDRESS:
         addrs = args.ADDRESS
     else:
         addrs = self.config['rules'].keys()
     for addr in addrs:
         try:
             rule = self.config['rules'][addr]
         except KeyError:
             print("WARNING: No rule defined to send from address %s (skipping)" %
                     (addr))
         else:
             RuleCls = rules.by_name(rule['action'])
             RuleCls(addr, copy.deepcopy(rule)).execute(self.bitcoind)
Example #2
0
 def show_rules(self, args):
     for addr, rule in self.config['rules'].iteritems():
         rule = rules.by_name(rule['action'])(addr, copy.deepcopy(rule))
         print(rule.description)