Example #1
0
    def prototype_files(self):
        # All Shape files in the all direct subdir we can find.
        result = {}
        for root, dirs, files, level in util.walk2(self.map_dir):
            if level == 1:
                for f in [(os.path.split(f)[1].split('_')[0], os.path.join(root, f)) for f in files if os.path.splitext(f)[1] == self.file_extension]:
                              result[f[0]] = f[1]

        return result.values()
Example #2
0
    def data_files(self):
        result = []
        for root, dirs, files, level in util.walk2(self.map_dir):
            if level == 1:
                # All Shape files except tl_*.shp and tx_*.shp
                result += [os.path.join(root, f) for f in files if os.path.splitext(f)[1] == self.file_extension \
                    and not (os.path.split(f)[1].startswith('tl_') or os.path.split(f)[1].startswith('tx_'))]
            elif level > 1:
                # Should only be Shape files in "gis_text"
                result += [os.path.join(root, f) for f in files if os.path.splitext(f)[1] == self.file_extension]

        return result