diff options
author | flavio <fdanesse@gmail.com> | 2013-06-25 21:20:08 (GMT) |
---|---|---|
committer | flavio <fdanesse@gmail.com> | 2013-06-25 21:20:08 (GMT) |
commit | e4b87976b36ffb363720bbaeddd6f05f2ba60089 (patch) | |
tree | 0176bfda10d77558703ae4d34c370497a609ab7a /Widgets.py | |
parent | 8705ed1fd29c21bfbf03f2ad25faa645b65d6026 (diff) |
Corrección para devolución de grep en archivos.
Diffstat (limited to 'Widgets.py')
-rw-r--r-- | Widgets.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -2024,7 +2024,7 @@ class BusquedaGrep(Gtk.Dialog): import commands if os.path.isdir(self.path): - result = commands.getoutput("grep -r -n %s %s" % (text, self.path)) + result = commands.getoutput("grep -R -n %s %s" % (text, self.path)) result = result.splitlines() elif os.path.isfile(self.path): @@ -2035,8 +2035,12 @@ class BusquedaGrep(Gtk.Dialog): for line in result: dat = line.split(":") - if len(dat) == 3: items.append([dat[0], dat[1], dat[2].strip()]) + if os.path.isdir(self.path): + if len(dat) == 3: items.append([dat[0], dat[1], dat[2].strip()]) + elif os.path.isfile(self.path): + if len(dat) == 2: items.append([self.path, dat[0], dat[1].strip()]) + self.treeview.limpiar() self.treeview.agregar_items(items) |