def showImportDialog(self): filename = str(QFileDialog.getOpenFileName(self, 'Open file', '/home', 'CSV-Dateien (*.csv)')) if filename != "": self.parse(filename) self.draw(self.projname + ".svg") self.svg_tree = svgparser.lade_svg(self.projname + ".svg") self.scene.setSvg_tree(self.svg_tree)
def opan(self): #self.iface.newProject() filename = str(QFileDialog.getOpenFileName(self, 'Open project file', '/home', 'stratisfaction project files (*.spf)')) if filename != "": projpath = filename.rsplit(".", 1) self.draw(projpath[0] + ".svg") self.svg_tree = svgparser.lade_svg(projpath[0] + ".svg") self.scene.setSvg_tree(self.svg_tree) fobj = open(filename, "r") for line in fobj: eintrag = line.split("="); if eintrag[0] == "layer_path": print str(eintrag[1]) #self.iface.addVectorLayer(eintrag[1], "Ausgrabung", "ogr") elif eintrag[0] == "connection": connection = eintrag[1].split("-") self.connections.add((int(connection[0]), int(connection[1]))) print self.connections