title: getopts Values class and Template.Substitute don't (immediately) work together
body: <p>I have python code something like:</p>
  
  <pre><code>from string import Template
  import optparse
  
  def main():
    usage = "usage: %prog options outputname"
    p = optparse.OptionParser(usage)
    p.add_option('--optiona', '-a', default="")
    p.add_option('--optionb', '-b', default="")
    options, arguments = p.parse_args()
    t = Template('Option a is ${optiona} option b is ${optionb}')
    print t.substitute(options)
  </code></pre>
  
  <p>But that gives me</p>
  
  <pre><code>AttributeError: Values instance has no attribute '__getitem__'
  </code></pre>
  
  <p>Because <code>options</code> is a Values and not a dictionary.</p>
  
  <p>How do I neatly make this work?</p>
  
  <p>(any other suggestions welcome, my pythonic sense is still being nurtured...)</p>