include

Untitled

Jan 2nd, 2014
549
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import bottle
  2.  
  3. from bottle import jinja2_template as template
  4. from jinja2 import Environment
  5.  
  6.  
  7. def cut(value):
  8.     return value[:7]
  9.  
  10. env = Environment()
  11. env.filters['ss'] = cut
  12.  
  13.  
  14. @bottle.route('/')
  15. def test():
  16.     foo = "klsjadlkjdalkdjdaskldjad007"
  17.     return template('''
  18.  
  19. foo value: {{ ss(foo) }}
  20. and {{ foo|ss }}
  21. ''', foo=foo)
  22.  
  23.  
  24. bottle.run(host='localhost', port=9090, debug=True, reloader=True)
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×