@event(u'manager.initialize')
def make_environment(manager):
 global environment
 environment = Environment(undefined=StrictUndefined, loader=ChoiceLoader([PackageLoader(u'flexget'), FileSystemLoader(os.path.join(manager.config_base, u'templates'))]), extensions=[u'jinja2.ext.loopcontrols'])
 environment.template_class = FlexGetTemplate
 for (name, filt) in list(globals().items()):
  if name.startswith(u'filter_'):
   environment.filters[name.split(u'_', 1)[1]] = filt

@ event ( u'manager.initialize' ) def make_environment ( manager ) : global environment environment = Environment ( undefined = StrictUndefined , loader = ChoiceLoader ( [ PackageLoader ( u'flexget' ) , FileSystemLoader ( os . path . join ( manager . config_base , u'templates' ) ) ] ) , extensions = [ u'jinja2.ext.loopcontrols' ] ) environment . template_class = FlexGetTemplate for ( name , filt ) in list ( globals ( ) . items ( ) ) : if name . startswith ( u'filter_' ) : environment . filters [ name . split ( u'_' , 1 ) [ 1 ] ] = filt
create our environment and add our custom filters .