# Path: nuka/utils.py
# CHANGED = logging.WARNING + 1
# 
# Path: nuka/gpg.py
# class FileSystemLoader(jinja2.FileSystemLoader):
# 
#     def get_source(self, environment, template):
#         pieces = split_template_path(template)
#         for searchpath in self.searchpath:
#             filename = os.path.join(searchpath, *pieces)
#             f = open_if_exists(filename)
#             if f is None:
#                 continue
#             if filename.endswith('.gpg'):
#                 f.close()
#                 _, contents = decrypt(filename, self.encoding)
#             else:
#                 try:
#                     contents = f.read().decode(self.encoding)
#                 finally:
#                     f.close()
# 
#             mtime = os.path.getmtime(filename)
# 
#             def uptodate():
#                 try:
#                     return os.path.getmtime(filename) == mtime
#                 except OSError:
#                     return False
#             return contents, filename, uptodate
#         raise TemplateNotFound(template)


import tempfile
import logging
import os
import jinja2
import yaml
from nuka.utils import CHANGED
from nuka.gpg import FileSystemLoader
            self['log']['levels']['remote_level'] = logging.WARN
        elif args.verbose == 2:  # pragma: no cover
            self['log']['levels']['stream_level'] = logging.INFO
            self['log']['levels']['file_level'] = logging.DEBUG
            self['log']['levels']['remote_level'] = logging.INFO
        elif args.verbose > 2:
            self['log']['levels']['stream_level'] = logging.DEBUG
            self['log']['levels']['file_level'] = logging.DEBUG
            self['log']['levels']['remote_level'] = logging.DEBUG

        if args.verbose < 3:
            asyncio_logger.setLevel(logging.CRITICAL)

        if args.quiet or 'quiet' not in self['log']:
            self['log']['quiet'] = args.quiet

        if args.connections_delay or 'delay' not in self['connections']:
            self['connections']['delay'] = args.connections_delay

    def get_template_engine(self):
        engine = self.get('template_engine')
        if engine is None:
            templates = self['templates']
            dirname = os.path.join(os.getcwd(), 'templates')
            if os.path.isdir(dirname):  # pragma: no cover
                if dirname not in templates:
                    templates.insert(0, dirname)
            elif os.getcwd() not in templates:
                templates.insert(0, os.getcwd())
            loader = jinja2.ChoiceLoader([

# Path: nuka/utils.py
# CHANGED = logging.WARNING + 1
# 
# Path: nuka/gpg.py
# class FileSystemLoader(jinja2.FileSystemLoader):
# 
#     def get_source(self, environment, template):
#         pieces = split_template_path(template)
#         for searchpath in self.searchpath:
#             filename = os.path.join(searchpath, *pieces)
#             f = open_if_exists(filename)
#             if f is None:
#                 continue
#             if filename.endswith('.gpg'):
#                 f.close()
#                 _, contents = decrypt(filename, self.encoding)
#             else:
#                 try:
#                     contents = f.read().decode(self.encoding)
#                 finally:
#                     f.close()
# 
#             mtime = os.path.getmtime(filename)
# 
#             def uptodate():
#                 try:
#                     return os.path.getmtime(filename) == mtime
#                 except OSError:
#                     return False
#             return contents, filename, uptodate
#         raise TemplateNotFound(template)


# Path: nuka/configuration.py
import tempfile
import logging
import os
import jinja2
import yaml
from nuka.utils import CHANGED
from nuka.gpg import FileSystemLoader

            self['log']['levels']['remote_level'] = logging.WARN
        elif args.verbose == 2:  # pragma: no cover
            self['log']['levels']['stream_level'] = logging.INFO
            self['log']['levels']['file_level'] = logging.DEBUG
            self['log']['levels']['remote_level'] = logging.INFO
        elif args.verbose > 2:
            self['log']['levels']['stream_level'] = logging.DEBUG
            self['log']['levels']['file_level'] = logging.DEBUG
            self['log']['levels']['remote_level'] = logging.DEBUG

        if args.verbose < 3:
            asyncio_logger.setLevel(logging.CRITICAL)

        if args.quiet or 'quiet' not in self['log']:
            self['log']['quiet'] = args.quiet

        if args.connections_delay or 'delay' not in self['connections']:
            self['connections']['delay'] = args.connections_delay

    def get_template_engine(self):
        engine = self.get('template_engine')
        if engine is None:
            templates = self['templates']
            dirname = os.path.join(os.getcwd(), 'templates')
            if os.path.isdir(dirname):  # pragma: no cover
                if dirname not in templates:
                    templates.insert(0, dirname)
            elif os.getcwd() not in templates:
                templates.insert(0, os.getcwd())
            loader = jinja2.ChoiceLoader([

                FileSystemLoader(p) for p in templates