Menu

#35 import file crashes under ubuntu 10.10

closed-works-for-me
None
5
2012-01-29
2010-10-28
carlopav
No

hi, the import command still causes pycad to crash under ubuntu 10.10
bug seems to be in cadwindow.py row 356
carlo

Discussion

  • Matteo Boscolo

    Matteo Boscolo - 2010-10-29

    could you post part of the code

    Regards,
    Matteo

     
  • carlopav

    carlopav - 2010-10-29

    def _onImportDrawing(self):
    drawing = QtGui.QFileDialog.getOpenFileName(parent=self, caption="Import Drawing", directory=self.lastDirectory, filter="Dxf (*.dxf)");
    # open a document and load the drawing
    if len(drawing)>0:
    self.lastDirectory=os.path.split(drawing)[0]
    self.mdiArea.activeSubWindow().importExternalFormat(drawing) <<<<<<<<<<<<<it crashes here
    return

    saying "unhandled attribute error"
    none type object has no attribute "importExternalFormat"

    regards
    carlo

     
  • Matteo Boscolo

    Matteo Boscolo - 2010-10-30

    it seems a problem with the self.mdiArea.activeSubWindow() that is None .
    It seems that you do not have any active drawing ..opened ..

    witch version of pyqt are you using ?
    dose the open file with dxf extension works well ?

    we can manage this error controlling the code like this:
    def _onImportDrawing(self):
    drawing = QtGui.QFileDialog.getOpenFileName(parent=self, caption="Import Drawing", directory=self.lastDirectory, filter="Dxf (*.dxf)");
    # open a document and load the drawing
    if len(drawing)>0:
    self.lastDirectory=os.path.split(drawing)[0]
    if self.mdiArea.activeSubWindow() != None:
    self.mdiArea.activeSubWindow()importExternalFormat(drawing)
    else:
    print "active sub windows is none"
    return

    but I do not think that you can open a dxf file anymore :-)

    Regards,
    Matteo

     
  • Matteo Boscolo

    Matteo Boscolo - 2011-01-17

    is this bug still open ?

     
  • Matteo Boscolo

    Matteo Boscolo - 2011-01-17
    • assigned_to: nobody --> matteoboscolo
    • status: open --> open-works-for-me
     
  • Matteo Boscolo

    Matteo Boscolo - 2012-01-29
    • status: open-works-for-me --> closed-works-for-me
     
MongoDB Logo MongoDB