@add_argument('<STR_LIT>',<EOL>metavar='<STR_LIT>',<EOL>help="<STR_LIT>"<EOL>"<STR_LIT>")<EOL>@add_argument('<STR_LIT>',<EOL>help="<STR_LIT>"<EOL>"<STR_LIT>")<EOL>@add_argument('<STR_LIT>', '<STR_LIT>',<EOL>dest='<STR_LIT>',<EOL>action='<STR_LIT:store_true>',<EOL>default=False,<EOL>help="<STR_LIT>")<EOL>def dump_limits(conf_file, limits_file, debug=False):
<EOL>conf = config.Config(conf_file=conf_file)<EOL>db = conf.get_database()<EOL>limits_key = conf['<STR_LIT>'].get('<STR_LIT>', '<STR_LIT>')<EOL>lims = [limits.Limit.hydrate(db, msgpack.loads(lim))<EOL>for lim in db.zrange(limits_key, <NUM_LIT:0>, -<NUM_LIT:1>)]<EOL>root = etree.Element('<STR_LIT>')<EOL>limit_tree = etree.ElementTree(root)<EOL>for idx, lim in enumerate(lims):<EOL><INDENT>if debug:<EOL><INDENT>print("<STR_LIT>" % (idx, lim), file=sys.stderr)<EOL><DEDENT>make_limit_node(root, lim)<EOL><DEDENT>if limits_file == '<STR_LIT:->':<EOL><INDENT>limits_file = sys.stdout<EOL><DEDENT>if debug:<EOL><INDENT>print("<STR_LIT>" % limits_file, file=sys.stderr)<EOL><DEDENT>limit_tree.write(limits_file, xml_declaration=True, encoding='<STR_LIT>',<EOL>pretty_print=True)<EOL>
Dump the current limits from the Redis database.

:param conf_file: Name of the configuration file, for connecting
                  to the Redis database.
:param limits_file: Name of the XML file that the limits will be
                    dumped to.  Use '-' to dump to stdout.
:param debug: If True, debugging messages are emitted while
              dumping the limits.