'Given 1 config resource returns list of included files
(recursively) with the original one as well
Simple loops are taken care about'

def __getIncludesUncached(self, resource, seen=[]):

    SCPWI = SafeConfigParserWithIncludes
    try:
        (parser, i) = self._getSharedSCPWI(resource)
        if (not i):
            return []
    except UnicodeDecodeError as e:
        logSys.error(("Error    decoding    config    file    '%s':    %s" % (resource, e)))
        return []
    resourceDir = os.path.dirname(resource)
    newFiles = [('before', []), ('after', [])]
    if (SCPWI.SECTION_NAME in parser.sections()):
        for (option_name, option_list) in newFiles:
            if (option_name in parser.options(SCPWI.SECTION_NAME)):
                newResources = parser.get(SCPWI.SECTION_NAME, option_name)
                for newResource in newResources.split('\n'):
                    if os.path.isabs(newResource):
                        r = newResource
                    else:
                        r = os.path.join(resourceDir, newResource)
                    if (r in seen):
                        continue
                    s = (seen + [resource])
                    option_list += self._getIncludes(r, s)
    return ((newFiles[0][1] + [resource]) + newFiles[1][1])
