Classbrowser not working?

2004-06-17
2004-06-25
  • Franz Steinhaeusler

    Hello Daniel and all other Project members,

    first of all: i'm very interested in the development of DrPython; it is a great project.

    My question:
    If I open the class browser, I only see an empty
    frame with the close button at the bottom.
    (before I have already opened a python source file and wanted to see the class structure)

    I looked in the docs and tried: cleanup indentation
    and checked the classbrowser settings in the preferences.

    After that, I restarted drpython, opened for testing drpython.py and following traceback appeared:

    Traceback (most recent call last):
      File "C:\Programme\GNU\WinCvs 1.2\drpython\drpython.py", line 2362, in OnShowC
    lassBrowser
        self.ClassBrowser = drClassBrowserPanel(target, -1, True, (self.prefs.classb
    rowserposition == 1))
      File "C:\Programme\GNU\WinCvs 1.2\drpython\drClassBrowser.py", line 178, in __
    init__
        if not self.Browse():
      File "C:\Programme\GNU\WinCvs 1.2\drpython\drClassBrowser.py", line 260, in Br
    owse
        self.classtree.SortChildren(self.root)
      File "C:\Python23\Lib\site-packages\wx\controls.py", line 4437, in SortChildre
    n
        return _controls.TreeCtrl_SortChildren(*args, **kwargs)
    wx.core.PyAssertionError: C++ assertion "wxAssertFailure" failed in ..\..\src\ms
    w\treectrl.cpp(2078): sorting tree without data doesn't make sense

    Python 2.5.1.5, Win XP, Python 2.3.3.

     
    • Daniel Pozmanter

      Have you tried downloading 3.0.3, and trying it with that?  This could just be a problem with cvs (I have been having some problems with cvs recently).

      If not, I will take another look.

       
    • Daniel Pozmanter

      Ok, I updated cvs.  I found a bug with the classbrowser dialog (the panes are fine).

      I cannot replicate the bug with the pane (works fine for me, on both linux and windows xp, using drpython.py as the litmus).

      So.  Try 3.0.3 with the left or right pane (set in prefs), or try cvs.  Does either work?
      Are you still getting the traceback?

       
    • Franz Steinhaeusler

      Hello Daniel,

      thank you for your answer.

      yes, I downloaded 3.0.3

      but also in former versions, the class browser didn't work
      for me; i don't know, why.

      for the cvs:
      Yes, I saw the problem, of the, i don't know exactly,
      the drpython.png only 6 byte long; every time, i overwrote it with the older original file.

      Normally in class browser, I only have an empty frame
      with the close button below.

      Now, at home (again Winxp), I tried it with the 2.4.5, it works fine with the classbrowser (wxpython 2.5.1.2).

      Now, I downloaded 3.0.3 again and voila:
      class browser window stays empty (also no traceback information)

       
    • Franz Steinhaeusler

      hi,

      I think, we had posted at the same time :)

      I have updated
      with
      cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/drpython co drpython
      a few minutes ago; but it was the same behavior.
      Now i change in preferences left and: yes, it works
      but if I adjust dialog, the window stays empty.

      regards

       
    • Daniel Pozmanter

      So are you saying it is just the dialog that does not work?

      Cause that is fine.  I fixed the dialog, then decided to remove it anyway for 3.0.4 (which should be out shortly).

      Turns out drpython does not handle the classbrowser well if you try and use it on more than one file at a time.

      Using only the left or right pane cuts down on code.
      I fixed it up so close on activate works with the panes, and the panes are now members of txtDocument.  I also updated the plugins.

      I will upload the changes shortly, but knowing that the panes work ok means that the bug has been fixed.  (Did the panes work ok before, or was it just the dialog)?

       
    • Franz Steinhaeusler

      >So are you saying it is just the dialog that does not work?

      yes, so it is

      small inconvience:
      If i adjust for example on the right side=> save=> restart => open a python source file => show classbrowser, then I see the classbrowser window
      not before I resize the window.
      Also the class browser don't use the whole space in the vertically direction.

      I think, if I choose class browser, it should be also
      available default for the next file, i want to open.
      (I have again to turn class browser on)

      >Turns out drpython does not handle the
      >classbrowser well if you try and use it on more than
      >one file at a time.

      I observed, if I open a third file, thee classbrowser pane is not available anymore.

      >(Did the panes work ok before, or was it just the dialog)?
      I tried 3.0.0, and it was also ok with the left and right pane and it was also ok.

       
    • Daniel Pozmanter

      Please state what version you are working with (3.0.0, 3.0.4, cvs), otherwise I don't know if this is a current problem, or something that has been addressed.

      "If i adjust for example on the right side=> save=> restart => open a python source file => show classbrowser, then I see the classbrowser window
      not before I resize the window."
      Are you saying if you change the right corner (drag the sash), restart, open a file, then use the classbrowser, you need to resize the WHOLE window to see the classbrowser?  What version?

      "I think, if I choose class browser, it should be also
      available default for the next file, i want to open.
      (I have again to turn class browser on)":  This COULD be an option (class browser persists).  What do other folks think?

      "I observed, if I open a third file, thee classbrowser pane is not available anymore."
      This makes me think you aren't using 3.0.4 (that was fixed).  Try it out, I think these problems are solved.

       
    • Franz Steinhaeusler

      Sorry, I was not exact enough.

      Now, I use the latest version 3.0.5 from CVS.

      >...you need to resize the WHOLE window to see the classbrowser?

      so it was.

      >What version?
      I made the mistake not using the latest version.
      It works now in this new version, as expected.

      >This COULD be an option (class browser persists)
      I would like it; Additionally maybe to save the state, if class browser was turned off or on.
      the shortcut is (default) ctrl-shift-c.
      What do you think of "toggling" class browser
      ctrl-shift-c: show class browser
      next time ctrl-shift-c: hide class browser

      BTW: is there a possibility to change only with
      the keyboard to class browser pane and again
      back to the editor window?

      >"I observed, if I open a third file, thee classbrowser
      >pane is not available anymore."

      It works now.

      thank you and regards

      Francesco

       
    • Daniel Pozmanter

      It only made sense to do the whole "show" thing rather than "toggle" when there was a dialog.  Without the dialog, the toggle makes more sense, so it's in (3.0.5).  I also implemented the persitance option through "Visible By Default" for the class browser.  It is called on startup, and in "OnNew".
      I just realized I need to call it from the Open too.  (oops, that will make it into the next version).

      Best,
      Dan

       
    • Franz Steinhaeusler

      Hello Dan,

      thank you ;)
      (I saw you updated drpython just now (3.0.7)).

      One issue: (all this happens only with "sorted: alphabetical" in classbrowser options):

      1st Traceback: try to open a file from recent list

      Traceback (most recent call last):
        File "C:\Eigene Dateien\python\drpython\drpython.py", line 2100, in OnOpenRecentFile
          self.OpenFile(filename, False)
        File "C:\Eigene Dateien\python\drpython\drpython.py", line 2684, in OpenFile
          self.ShowClassBrowser()
        File "C:\Eigene Dateien\python\drpython\drpython.py", line 2856, in ShowClassBrowser
          self.txtDocument.ClassBrowser.Browse()
        File "C:\Eigene Dateien\python\drpython\drClassBrowser.py", line 256, in Browse
          self.classtree.SortChildren(self.root)
        File "C:\Python23\Lib\site-packages\wx\controls.py", line 4437, in SortChildren
          return _controls.TreeCtrl_SortChildren(*args, **kwargs)
      wx.core.PyAssertionError: C++ assertion "wxAssertFailure" failed in ..\..\src\ms
      w\treectrl.cpp(2078): sorting tree without data doesn't make sense

      2nd              : try to open a file from bookmarks.

      Traceback (most recent call last):
        File "C:\eigene dateien\python\drpython\drBookmarksMenu.py", line 110, in OnBookmark
          self.parent.OnOpen(event)
        File "C:\Eigene Dateien\python\drpython\drpython.py", line 2072, in OnOpen
          self.OpenFile(filename, True)
        File "C:\Eigene Dateien\python\drpython\drpython.py", line 2684, in OpenFile
          self.ShowClassBrowser()
        File "C:\Eigene Dateien\python\drpython\drpython.py", line 2851, in ShowClassBrowser
          self.txtDocument.ClassBrowser = drClassBrowserPanel(target, -1, (self.prefs.classbrowserpane == 0))
        File "C:\Eigene Dateien\python\drpython\drClassBrowser.py", line 178, in __init__
          if not self.Browse():
        File "C:\Eigene Dateien\python\drpython\drClassBrowser.py", line 256, in Browse
          self.classtree.SortChildren(self.root)
        File "C:\Python23\Lib\site-packages\wx\controls.py", line 4437, in SortChildren
          return _controls.TreeCtrl_SortChildren(*args, **kwargs)
      wx.core.PyAssertionError: C++ assertion "wxAssertFailure" failed in ..\..\src\ms
      w\treectrl.cpp(2078): sorting tree without data doesn't make sense

      regards,

      Francesco

       
    • Franz Steinhaeusler

      I think, I found it.
      I looked in the wxpython demo, and found the
      function SetPyData.
      I inserted this immediatly after:
                                  Roots.append(self.classtree.AppendItem(Roots[currentRoot], t))
      self.classtree.SetPyData(Roots[-1], None)

      and the classbrowser tree is shown alphabetically.

       
    • Daniel Pozmanter

      Thanks for the report, and the fix!  It's in 3.0.7, which is out now.

      Cheers,
      Dan

       
    • Daniel Pozmanter

      By the by, when you said "i'm very interested in the development of DrPython; it is a great project.", did you mean you wanted to join as a tester or developer?

       
    • Franz Steinhaeusler

      >By the by, when you said "i'm very interested in the
      >development of DrPython; it is a great project.", did
      >you mean you wanted to join as a tester or developer?

      YES, I hestitated until now to ask you.

      I had also added some scripts in the other forum yesterday; (hope, they are a bit useful).
      I have a couple of ideas to extend drpython.
      I have also another wxpython project "wxpyatol".
      It growed rather big and I didn't get any support, so
      I have stopped it for the time being.
      I also contributed to pype and extended pype for myself, so I think, I could contribute as tester and as developer.

      Thank you for your offer. Should I send you an email
      for the detailed course and suggestions?

      (btw: sorry for my english)

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks