class_docstr: Load templates from python eggs or packages.  It is constructed with
  the name of the python package and the path to the templates in that
  package::
  
      loader = PackageLoader('mypackage', 'views')
  
  If the package path is not given, ``'templates'`` is assumed.
  
  Per default the template encoding is ``'utf-8'`` which can be changed
  by setting the `encoding` parameter to something else.  Due to the nature
  of eggs it's only possible to reload templates if the package was loaded
  from the file system and not a zip file.
class_docstr_tok: ["Load","templates","from","python","eggs","or","packages",".","It","is","constructed","with","the","name","of","the","python","package","and","the","path","to","the","templates","in","that","package",":",":","loader","=","PackageLoader","(","'mypackage","'",",","'views","'",")","If","the","package","path","is","not","given",",","``","'templates","'","``","is","assumed",".","Per","default","the","template","encoding","is","``","'utf-8","'","``","which","can","be","changed","by","setting","the","`","encoding","`","parameter","to","something","else",".","Due","to","the","nature","of","eggs","it","'s","only","possible","to","reload","templates","if","the","package","was","loaded","from","the","file","system","and","not","a","zip","file","."]
code: def get_source(self, environment, template):
      pieces = split_template_path(template)
      p = "/".join((self.package_path,) + tuple(pieces))
  
      if not self.provider.has_resource(p):
          raise TemplateNotFound(template)
  
      filename = uptodate = None
  
      if self.filesystem_bound:
          filename = self.provider.get_resource_filename(
              self.manager, p
          )
          mtime = path.getmtime(filename)
  
          def uptodate():
              try:
                  return path.getmtime(filename) == mtime
              except OSError:
                  return False
  
      source = self.provider.get_resource_string(self.manager, p)
      return source.decode(self.encoding), filename, uptodate
  
imports: import os
  import sys
  import weakref
  from hashlib import sha1
  from os import path
  from types import ModuleType
  from ._compat import abc
  from ._compat import fspath
  from ._compat import iteritems
  from ._compat import string_types
  from .exceptions import TemplateNotFound
  from .utils import internalcode
  from .utils import open_if_exists
label_desc: Use image node_id 2 for calling the PackageLoader obj's underlying member method code with example usage: obj.get_source(environment, template) and returns: source,  filename,  uptodate, unknown, False