def list_rules(self, chain):
        """ List current rules as commands"""

        if self.user_is_root():
            if len(chain) > 0:
                print chain
                # Check chain
                if not self.is_valid_chain(chain):
                    return

                chains = [chain]
            else:
                chains = self.current_table.iterkeys()

            # Output buffer
            output = []

            for chain in chains:
                output.append(chain % "-P %s ACCEPT")

            # Done
            self.writeln_and_exit(output)
        else:
            self.no_permission()
dataset/ETHPy150Open basilfx/kippo-extra/kippo_extra/commands/iptables.py/command_iptables.list_rules/swapped operands of `%`