Thursday 21 July 2011

FileBrowser Context Menu Bug

So the FileBrowser plugin for gedit has a bug where it doesn't properly remove items from its context menu. This makes it difficult for me to add special git context menu items when you have a git file selected, and then replace them with special svn context menu items when you have an svn item selected.

A workaround I have now is to have generic context menu items that apply to all repository types and just disable or enable them if they are relevant to the selected files.

I'll have to get back to the gedit team to get a bug fix in.

Thursday 24 March 2011

Giterdone 1.2.3 released!

This contains some minor fixes relating to Mac OSX version where Filebrowser plugin is sometimes disabled. There are also some bug fixes on how giterdone parses git status output. Overall this is a stability release.

Tuesday 15 March 2011

Python Threads in Giterdone

I would have loved to use python threads to do a lot of the heavy lifting while monitoring VCS repositories. However, due to the way gedit launches its python plugins or at least the python runtime doesn't allow these plugins to run their own threads. See this thread:


So they finally implemented it but it was too late to get into Ubuntu 11.04. So for now I will have to stick to some tricky event handling to monitor the repositories. So far its working fine. The only downside is that giterdone can't pick up any changes that don't trigger any gtk event.

Looking at the change log here:


It looks like python threading was enabled in version 2.31.2, but then python plugins were disabled all together in 2.31.4. So I'm not sure when I'll be able to start using giterdone with the new threading model. Ubuntu 11.10?

(Empty) Row

Clicking on the (Empty) row caused this traceback:

Traceback (most recent call last):
File "/home/rltoscano/.gnome2/gedit/plugins/giterdone/filebrowsercontroller.py", line 169, in _on_fb_selection_changed
paths = self._get_selected_paths(selection)
File "/home/rltoscano/.gnome2/gedit/plugins/giterdone/filebrowsercontroller.py", line 245, in _get_selected_paths
return [model[row][2][len('file://'):] for row in rows]
TypeError: 'NoneType' object is unsubscriptable

Remote Files

Traceback (most recent call last):
File "/home/rltoscano/.gnome2/gedit/plugins/giterdone/filebrowsercontroller.py", line 169, in _on_fb_selection_changed
paths = self._get_selected_paths(selection)
File "/home/rltoscano/.gnome2/gedit/plugins/giterdone/filebrowsercontroller.py", line 245, in _get_selected_paths
return [model[row][2][len('file://'):] for row in rows]
TypeError: '__main__.GDaemonFile' object is unsubscriptable

Happens when I have a remote filesystem in the file browser. Maybe model[row] returns something else than I expect or maybe its model[row][2] that returns a non-string. Solution would be to ignore the _on_fb_selection_changed event if root is not local, or make a runtime type check on the objects in model.