MagMax-en

Language

Projects

Contact

Mail me
Please, supress words between colons (":")

Projects‎ > ‎

Pygrep

The Python Graphical (GUI) Grep-like Tool.

Description

Pygrep is a graphical tool or GUI similar to GNU grep.

Usually, when you are developping a big application, you must battle with a lot of sources, and you need to search a lot of words (variables, function names, constants and so on). A lot of times, "grep" is powerful enougth to help you in your searchs, but other times it is not.

This program tries to help you in these cases:

  • It will allow to save a profile with different configurations of search directories.
  • You'll be able to click on the found labels and open the file on your default (or not) editor.
  • You can decide if you want to search only in the files that was obtained in the last search. Notice that it is not the same as "$ grep word|grep word2", but may be similar to "$ grep word2 `grep -H word|cut -f1 -d':'`"
  • It will be possible to show the line before/after/both the expresion to search (the match expresion will be highlighted)
  • Well... I have no more requisites, but when people will use it, they could give their experiences.

License

This program is Free Software. I prefer to use the Spanish word "Libre" better than "Free", because it is "Free of Freedom, not Free of free beer".

You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

See the license advisement for more information.

Manual

Sorry, but I have no time to be writen more documentation. Here you are the basics of GUI:

Introduction

The first thing you have to know is the screen distribution. You have a window with an entry box and two button over some tabs. Whenever you want, you can write something in the box and click "Search", "Search Again" or press Enter to begin the search. In addition, the "Search" tab will be shown.

Now I'm going to describe each tab.


Search Tab

You will see two tables: upper one has the files that matched with the number of matches in the file. Below, you can see the lines that matches inside the file you have selected in the upper table.

You can double-click on the files to open them or on the lines to open the files directly on the selected line.

You can choose between using pygrep or grep engine.

Directories Tab

There are two tabs for configuration: directories and options. I separated them to avoid to see too much information. 

You will see 3 tables:

  • Top one: directories you want to search in. Be careful: Pygrep launchs a thread by each entry, so do not add more than 3 or 4 directories or the search will be slower.
  • Bottom left table: files to include. You can add "*" and "?" to match "everything" or "a letter". I'm afraid I'm checking all the pathname, so please, insert an "*" at the beginning in all sentences. It will be changed in next versions. Pygrep will search only in these files. If table is empty, pygrep will search in all the files.
  • Bottom right table: directories and filenames to exclude. It is good to optimize the searchs.

Options Tab

You can configure your Pygrep searchs here. If you want ignore case, search as a regular expresion or search complete words. You can ignore big files too.

The difficult part is the "Command to execute". Here you have a lot of help: you must insert the command you want to execute when you click one file/line in the "Search Tab". You have to change the line in order to configure your favourite editor. Some examples are provided. There are some letters that will be translated; they are shown in the right column.

History Tab

Each time you search anything during a session, a new entry will appear in this table. Ok, It's true that words will complete as you type them at the search-entry, but it is possible that you don't know how it begins. In addition for the future, this table will make possible more options (like statistics, sort by usefully, ...).

Screencasts

I have forgotten that some time ago I saved a screencast, and you may want to have a look on it. It is here: Screencast pygrep, the python grep gui.

Final

Well... I wrote Pygrep because I needed it. If it can help you, fine!; if it cannot, please, tell me what you need and I will study your proposal. Maybe you want to write your improvements: help is welcome.

Thank you for using Pygrep and for tell me your opinion.

More Information

Yes, just at the Savannah project.

Download it!!

You can use the last package I made or to go directly to the CVS repository.