@staticmethod
def _split_quotes(s):
    """ A generator for a splitting a string allowing for quoted spaces.
        """
    s = s.lstrip()
    while s != '':
        quote_stack = []
        i = 0
        for ch in s:
            if ch in '\'"':
                if len(quote_stack) == 0 or quote_stack[-1] != ch:
                    quote_stack.append(ch)
                else:
                    quote_stack.pop()
            elif ch == ' ':
                if len(quote_stack) == 0:
                    break
            i += 1
        yield s[:i]
        s = s[i:].lstrip()
