# Path: sprinter/next/compat.py
# def _unicode(s):
#     return s


import codecs
import logging
import os
import re
import shutil
from ..compat import _unicode
        self.wrapper_match = re.compile("\n?#%s\n.*#%s\n" % (wrapper, wrapper), re.DOTALL)
        self.logger = logging.getLogger(logger)
        self.inject_dict = {}
        self.clear_set = set()

    def inject(self, filename, content):
        """ add the injection content to the dictionary """
        # ensure content always has one trailing newline
        content = _unicode(content).rstrip() + "\n"
        if filename not in self.inject_dict:
            self.inject_dict[filename] = ""
        self.inject_dict[filename] += content

    def clear(self, filename):
        """ add the file to the list of files to clear """
        self.clear_set.add(filename)

    def clear_all(self):
        """ Clear all files that are currently prepped to be injected """
        for filename in self.inject_dict:
            self.clear_set.add(filename)

    def commit(self):
        """ commit the injections desired, overwriting any previous injections in the file. """
        self.logger.debug("Starting injections...")
        self.logger.debug("Injections dict is:")
        self.logger.debug(self.inject_dict)
        self.logger.debug("Clear list is:")
        self.logger.debug(self.clear_set)
        for filename, content in self.inject_dict.items():

# Path: sprinter/next/compat.py
# def _unicode(s):
#     return s


# Path: sprinter/next/environment/injections.py
import codecs
import logging
import os
import re
import shutil
from ..compat import _unicode

        self.wrapper_match = re.compile("\n?#%s\n.*#%s\n" % (wrapper, wrapper), re.DOTALL)
        self.logger = logging.getLogger(logger)
        self.inject_dict = {}
        self.clear_set = set()

    def inject(self, filename, content):
        """ add the injection content to the dictionary """
        # ensure content always has one trailing newline
        content = _unicode(content).rstrip() + "\n"
        if filename not in self.inject_dict:
            self.inject_dict[filename] = ""
        self.inject_dict[filename] += content

    def clear(self, filename):
        """ add the file to the list of files to clear """
        self.clear_set.add(filename)

    def clear_all(self):
        """ Clear all files that are currently prepped to be injected """
        for filename in self.inject_dict:
            self.clear_set.add(filename)

    def commit(self):
        """ commit the injections desired, overwriting any previous injections in the file. """
        self.logger.debug("Starting injections...")
        self.logger.debug("Injections dict is:")
        self.logger.debug(self.inject_dict)
        self.logger.debug("Clear list is:")
        self.logger.debug(self.clear_set)
        for filename, content in self.inject_dict.items():

            content = _unicode(content)