Ejemplo n.º 1
0
def get_include_files(fpath):
    include_files = list()

    basedir = os.path.dirname(fpath)
    with open(fpath, 'r') as fp:
        while 1:
            line = fp.readline()
            if not line:
                break

            if line.startswith('*INCLUDE'):
                fields = line.split(',')
                if len(fields) > 1:
                    item = fields[-1].split('=')[-1].strip()
                    include_files.append(
                        common_utils.get_abspath(basedir, item))

    return include_files
Ejemplo n.º 2
0
def get_include_files(fpath):
    include_files = list()

    basedir = os.path.dirname(fpath)
    with open(fpath, 'r') as fp:
        line_process_switch = False
        while 1:
            line = fp.readline()
            if not line:
                break

            line = line.strip()
            line_upper = line.upper()
            if line_upper.startswith('*INCLUDE'):
                line_process_switch = True
            elif line_upper.startswith('*'):
                line_process_switch = False

            if line_process_switch and not line.startswith('*'):
                fname = line.strip()
                include_files.append(common_utils.get_abspath(basedir, fname))

    return include_files