You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.txt
+19-4Lines changed: 19 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ easy_installable::
71
71
72
72
Alternatively, download and unpack the tarball and install::
73
73
74
-
$ tar zxf grin-1.1.1.tar.gz
74
+
$ tar zxf grin-1.2.tar.gz
75
75
$ python setup.py install
76
76
77
77
On UNIX systems, use sudo for the latter command if you need to install the
@@ -219,6 +219,24 @@ that it preprocesses Python files to extract and normalize just the import
219
219
statements. This lets you conveniently and robustly search for import
220
220
statements. Look at "grinimports.py --help" for more information.
221
221
222
+
examples/grinpython.py allows you to search through Python files and specify whether you want to search through actual Python code, comments or string literals in any combination. For example::
223
+
224
+
$ grinpython.py -i --strings grep grin.py
225
+
grin.py:
226
+
188 : """ Grep a single file for a regex by iterating over the lines in a file.
227
+
292 : """ Do a full grep.
228
+
...
229
+
230
+
$ grinpython.py -i --comments grep grin.py
231
+
grin.py:
232
+
979 : # something we want to grep.
233
+
234
+
$ grinpython.py -i --python-code grep grin.py
235
+
grin.py:
236
+
187 : class GrepText(object):
237
+
291 : def do_grep(self, fp):
238
+
...
239
+
222
240
Similarly, it should be straightforward to write small tools like this which
223
241
extract and search text metadata from binary files.
224
242
@@ -227,9 +245,6 @@ To Do
227
245
-----
228
246
229
247
* Figure out the story for grepping UTF-8, UTF-16 and UTF-32 Unicode text files.
230
-
* Write some more examples of building small tools on top of grin.
231
-
* Investigate ways to speed up searching. GNU grep is wicked-fast, and I'd like
0 commit comments