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 list_templates(self):
      path = self.package_path
  
      if path[:2] == "./":
          path = path[2:]
      elif path == ".":
          path = ""
  
      offset = len(path)
      results = []
  
      def _walk(path):
          for filename in self.provider.resource_listdir(path):
              fullname = path + "/" + filename
  
              if self.provider.resource_isdir(fullname):
                  _walk(fullname)
              else:
                  results.append(fullname[offset:].lstrip("/"))
  
      _walk(path)
      results.sort()
      return results
  
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 3 for calling the PackageLoader obj's underlying member method code with example usage: obj.list_templates() and returns: results