def export_to_shapefiles(self):
        for t in self.local_repo.trees:
            if t.path not in ("layer_statistics", "views_layer_statistics", "virts_layer_statistics"):
                self.local_repo.exportshp('HEAD', t.path, os.path.join('HEAD', t.path,
                                                                       os.path.join(self.path, t.path) + '.shp'))
                # layer = qgis.utils.iface.addVectorLayer(os.path.join(self.path, t.path) + '.shp', t.path, "ogr")
                vl = QgsVectorLayer("Point", "temporary_points", "memory")
                print layer.geometryType()
                pr = vl.dataProvider()
                layer = qgis.utils.iface.addVectorLayer(os.path.join(self.path, t.path) + '.shp', t.path, "ogr")

                # layers = QgsMapLayerRegistry.instance().mapLayers()
                # for name, layer in layers.iteritems():
                #     print 'name: ' + str(name), 'layer type: ' + str(layer.geometryType())


                my_dir = self.path
                print 'deleting %s' % my_dir
                for fname in os.listdir(my_dir):
                    if fname.startswith(t.path):
                        os.remove(os.path.join(my_dir, fname))