<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -12,6 +12,7 @@ mode     = 'class'  # 'class' or 'dict'
 lang     = None
 quiet    = None
 template_dir = 'templates'
+use_str  = False
 
 
 class Entry(object):
@@ -91,11 +92,12 @@ class TenjinEntry(Entry):
     #create_template = classmethod(create_template)
 
     def load_library(cls):
-        global tenjin, escape, to_str
+        global tenjin, escape, to_str, use_str
         if globals().get('tenjin'): return
         try:
             tenjin = import_module('tenjin')
             from tenjin.helpers import escape, to_str
+            if use_str: to_str = str
         except ImportError:
             tenjin = None
         return tenjin
@@ -694,7 +696,7 @@ def main(ntimes=1000):
 
     ## parse options
     try:
-        optlist, targets = getopt.getopt(sys.argv[1:], &quot;hpf:n:t:x:Aqm:k:e:l:C&quot;)
+        optlist, targets = getopt.getopt(sys.argv[1:], &quot;hpf:n:t:x:Aqm:k:e:l:C&quot;, ['str'])
         options = dict([(key[1:], val == '' and True or val) for key, val in optlist])
     except Exception:
         ex = sys.exc_info()[1]
@@ -728,8 +730,9 @@ def main(ntimes=1000):
         #tostr_encoding = encoding
         #tmpl_encoding  = None
         #to_str = tenjin.generate_to_str_func(tostr_encoding)
-    ##
-
+    if options.get('-str'):
+        global use_str
+        use_str = True
     ## default targets
     target_list = []
     for cls in Entry.subclasses:
@@ -779,6 +782,7 @@ def print_help(script, ntimes, mode):
     #print &quot;  -k encodng  :  encoding (default None)&quot;
     #print &quot;  -l lang     :  language ('ja') (default None)&quot;
     print &quot;  -C          :  convert numbers in context data into string in advance&quot;
+    print &quot;  --str       :  use 'str()' instead of 'tenjin.helper.to_str()'&quot;
 
 
 def filter_targets(targets, target_list, excludes):</diff>
      <filename>python/benchmark/bench.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ce80519f627bb3591ff22828e750ad2de0256560</id>
    </parent>
  </parents>
  <author>
    <name>makoto kuwata</name>
    <email>kwa@kuwata-lab.com</email>
  </author>
  <url>http://github.com/kwatch/tenjin/commit/a119c14b3d3e69e3cbaec430d5eb39e02abc1a63</url>
  <id>a119c14b3d3e69e3cbaec430d5eb39e02abc1a63</id>
  <committed-date>2009-09-27T03:51:48-07:00</committed-date>
  <authored-date>2009-09-27T03:51:48-07:00</authored-date>
  <message>python: enhance 'bench.py' to support '--str' option (use 'str()' instead of 'to_str()')</message>
  <tree>8074bc9071ee0e747f706594c2d6e4bdf9a18075</tree>
  <committer>
    <name>makoto kuwata</name>
    <email>kwa@kuwata-lab.com</email>
  </committer>
</commit>
