SearchInFiles

Plugins
2004-10-02
2013-04-26
  • Hello,

    I uploaded the new SearchInFiles plugin 1.1.4 beta.
    It is in beta, therefore, I didn't hide 1.1.3.
    I think, it should run, without greater problems,
    but there are a couple of changes, so if anyone
    could test this a little bit, this would be nice.

    If it is allright, I will upload 1.1.5 then.

     
    • I have still some "tuning and setting things", but no radical changes anymore.
      (Perhaps some things would getting to complex, if I put everything in, what I imagined)

      But now, it should be enough ;)

      at the other side: ideas, meanings, improvements, bug reports would interested me much.
      I think, the plugin now isn't to prone to errors anymore, but one don't know ...
      I'm going to release 1.20 soon; then I will clean out the source code, comments, print statements, ...

      a problem is:
        if you call the "create regular" expression button, and you press esc key,
          the whole SearchInFiles dialog will be closed. I don't know a solution for this at this time, some other ... ? ;)
         
      Shall I change the original plugin from Dan to "not hidden"?  and the same also for version 1.1.3?

      Franz

       
    • Ahoy.

      Right now, I think it best to leave the latest stable version of your version up and running (1.1.3).

      I think this is almost ready however.  Here's what I got:

      Traceback (of course):
      hier
      set 1 0
      setted
      Traceback (most recent call last):
        File "/home/daniel/.drpython/plugins/SearchInFiles.py", line 1226, in OnHeaderClick
          self.SortHeader()
        File "/home/daniel/.drpython/plugins/SearchInFiles.py", line 1267, in SortHeader
          self.listctrlresults.EnsureVisible(nItem)
        File "/usr/lib/python2.3/site-packages/wx/_controls.py", line 4451, in EnsureVisible
          return _controls_.ListCtrl_EnsureVisible(*args, **kwargs)
      wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed in ../src/generic/listctrl.cpp(4244): invalid index in EnsureVisible

      Also, use SetSizerAndFit in Prefs Dialog (minor), otherwise half the dialog is not visible on linux.
      height = 480 on linux for find in files dialog, makes the size right for that.

      The statusbar thing persists, not sure what is up.
      Looks like a wxPython bug, so don't worry about it.
      (The statusbar will not show unless you resize the dialog manually.)

      Keep up the good work!

      Dan

       
    • Hi Dan,

      thank you for trying out.

      Ok, a 1.2.0 beta next ;)
      Strange, in MSW, I don't get a traceback, even if
      I set Ensurevisible (-27).
      So:
      nItem = self.listctrlresults.GetNextItem(-1, wx.LIST_NEXT_ALL, wx.LIST_STATE_SELECTED)
      if nitem != -1, then Ensurevisible should be called.
      I did't also see any problems with the statusbar.
      Propably a OnSize or a wxCallAfter OnSize in the Init
      section of the drFindReplaceInFilesDialog could help.
      if wx.plaform == '__WXGTK__' (?)

      >Keep up the good work!
      thank you very much!

      Franz

       
    • Traceback (most recent call last):
        File "C:/Documents and Settings/Daniel/drpython/plugins\SearchInFiles.py", line 2076, in OnFindInFiles
          drFindReplaceInFilesDialog(DrFrame, -1, "Search In Files", name="Search In Files").Show(True)
        File "C:/Documents and Settings/Daniel/drpython/plugins\SearchInFiles.py", line 459, in __init__
          icon.CopyFromBitmap(wx.BitmapFromImage(wx.Image((parent.GetPluginDirectory() + "/bitmaps/drpython_searchinfiles.png"), wx.BITMAP_TYPE_PNG)))
        File "C:\Python22\Lib\site-packages\wx\gdi.py", line 653, in BitmapFromImage
          val = _gdi.new_BitmapFromImage(*args, **kwargs)
      wx.core.PyAssertionError: C++ assertion "wxAssertFailure" failed in ..\..\src\msw\bitmap.cpp(765): invalid image

      The image appears to be corrupt (in 1.1.9.2_beta as well).

      I have not yet tested the threading bit on linux, but I noted you had some oddities with the interface you had to work around in the threading.  Have you looked at wx.PostEvent, and the Thread code from the wx demo?  The only reason I mention this is I added threading to the download plugins bit I am working on.  It ran fine on windows, and proceeded to quietly segfault on linux with an obscure (but concise) GDK error.  By only updating the gui through PostEvent, the problem was completely fixed.  This may not be a problem with your plugin on linux, but it may fix the problem you were running into.

      Cheers,
      Dan

       
    • Well, on linux, this happens when I try to launch the find in files dialog.  No corrupt icon though (unless this comes first of course).

      Traceback (most recent call last):
        File "/home/daniel/.drpython/plugins/SearchInFiles.py", line 2076, in OnFindInFiles
          drFindReplaceInFilesDialog(DrFrame, -1, "Search In Files", name="Search In Files").Show(True)
        File "/home/daniel/.drpython/plugins/SearchInFiles.py", line 512, in __init__
          wx.CallAfter (self.OnSize, evtSize)
      NameError: global name 'evtSize' is not defined

       
    •   Thanks for the info for threading, I will leave it for the time being, as it is, but
        I note it in my SearchInFiles todo list.
        If it run on linux with the thread, as it is, it should be fine.

      I get the same traceback, if I rename the "/bitmaps/drpython_searchinfiles.png"
        I try the install procedure and this file was copied to plugins/bitmap directory
        Does this file exist? did you run the install script?
        if the file is not ok, there is a "corrupt data" message.
      Anyway: I added a try/except for set icon in frame

      The other icons work?: (the arrow up and down in sortig and the loaded file icon)
         I remember, you said in "doclist" the arrow up and down don't work on linux
         (I took them from images from wxpython demo)

       
    • Hi,

      I decided to release this version as beta again (several new stuff) and to
        not update the drpython.plugin.list.dat now.
      I know, the code is getting worse, I will "beautify" it in the next time again.

      Franz

       
    • searchinfiles (1.2.5 beta):
          So I released the last release before the next and for the time being last relase 1.2.6
          I wanted to integrate the number of occurances of a search.
          Because if "Occurances" are on, the search is more slow, so I made this an option,
            and also, because the number of columns is enough now.
          I plan also to write a small help, but because I'm not a native english speaker,
            i want someone to control/change the help text.

      Franz

       
    • Traceback (most recent call last):
        File "C:/Documents and Settings/Daniel/drpython/plugins\SearchInFiles.py", line 2711, in OnFindInFiles
          ReloadOccurances()
        File "C:/Documents and Settings/Daniel/drpython/plugins\SearchInFiles.py", line 2703, in ReloadOccurances
          f = file(DrFrame.homedirectory + "/plugins/SearchInFiles.preferences.dat", 'r')
      IOError: [Errno 2] No such file or directory: 'C:/Documents and Settings/Daniel/drpython/plugins/SearchInFiles.preferences.dat'

      This seems to fix it:

      if not os.path.exists(DrFrame.homedirectory + "/plugins/SearchInFiles.preferences.dat"):
      return

      (With proper indentation, of course).

       
    • Hello Dan,
      thank you for your bug report with fix.

      Franz

       
    • Updated SearchInFiles 1.2.8.
      I was not inclined to change to much anymore, but after working with it, in the practice, it crystallize, that some  changes would be nice for the everyday working.
      - new: With marking a word or if not, the word under cursor can be used to quickly start a new search ('f' key or button 'Find')
      - new: Set Current Path of active document for the directory path (via menu or alt-a)
      I didn't include a button for this, because the panel is almost overfilled by now already

      updated http://mitglied.lycos.de/drpython/     
      SessionsLight Plugin, CompWord updated