Commits

Florian Wesch committed a8dec91

pygtksourceview2 compatibility. fixes issue 4. Thanks pochu27!

git-svn-id: http://infon.googlecode.com/svn/trunk@2688171fb75-e542-0410-96e4-03d5dd800671

  • Participants
  • Parent commits 37f10db

Comments (0)

Files changed (3)

File contrib/infon-devel/debian/changelog

+infon-devel (0~r218-1) unstable; urgency=low
+
+  * pygtksourceview is deprecated, use pygtksourceview2 instead
+    thanks to Emilio Pozuelo Monfort for the patch. (Closes: #532894)
+
+ -- Joachim Breitner <nomeata@debian.org>  Fri, 12 Jun 2009 20:11:23 +0200
+
 infon-devel (0~r144-1) unstable; urgency=low
 
   * Initial Release

File contrib/infon-devel/debian/control

 Build-Depends: debhelper (>= 5.0.38), python-all-dev (>= 2.3.5-11), python-central (>= 0.5.6)
 XS-Python-Version: all
 Standards-Version: 3.7.2
+Homepage: http://infon.dividuum.de/
 XS-Vcs-Svn: http://infon.dividuum.de/svn/infon/trunk/contrib/infon-devel
 
 Package: infon-devel
 Architecture: all
 Suggests: infon-server
 Recommends: infon-viewer
-Depends: ${python:Depends}, python-gnome2-desktop
+Depends: ${python:Depends}, python-gtksourceview2
 XB-Python-Version: ${python:Versions}
 Description: Develop bots for the infon game
  Infon is a game which simulates the live of simple bugs who eat,
  This package contains a graphical lua editor with integration into
  the infon server and allows easy uploading of the code. It also
  marks the currently executed line of code.
- .
- Homepage: http://infon.dividuum.de/
-

File contrib/infon-devel/infon-devel.py

 pygtk.require('2.0')
 import gtk
 import gobject
-import gtksourceview
+import gtksourceview2
 
 import os
 import sys
             ('ShowNumbers', None, 'Show _Line Numbers', None, 'Toggle visibility of line numbers in the left margin', 
                             lambda a, s: s.set_show_line_numbers(a.get_active())),
             ('ShowMarkers', None, 'Show _Markers', None, 'Toggle visibility of markers in the left margin',
-                            lambda a, s: s.set_show_line_markers(a.get_active())),
+                            lambda a, s: s.set_show_line_marks(a.get_active())),
             ('AutoIndent', None, 'Enable _Auto Indent', None, 'Toggle automatic auto indentation of text', 
                             lambda a, s: s.set_auto_indent(a.get_active())),
             #('InsertSpaces', None, 'Insert _Spaces Instead of Tabs', None, 'Whether to insert space characters when inserting tabulations', 
         action = actions.get_action('ShowNumbers')
         action.set_active(self.bugview.get_show_line_numbers())
         action = actions.get_action('ShowMarkers')
-        action.set_active(self.bugview.get_show_line_markers())
+        action.set_active(self.bugview.get_show_line_marks())
         action = actions.get_action('AutoIndent')
         action.set_active(self.bugview.get_auto_indent())
         #action = actions.get_action('InsertSpaces')
         self.ui.insert_action_group(actions,0)
 
     def setup_bugview(self):
-        self.bugbuf = gtksourceview.SourceBuffer()
-        lm = gtksourceview.SourceLanguagesManager()
-        lang = lm.get_language_from_mime_type("text/x-lua")
-        self.bugbuf.set_highlight(True)
+        self.bugbuf = gtksourceview2.Buffer()
+        lm = gtksourceview2.LanguageManager()
+        lang = lm.guess_language(None, "text/x-lua")
+        self.bugbuf.set_highlight_syntax(True)
         self.bugbuf.set_language(lang)
 
         def set_bt_markers(blubb):
             begin, end = self.bugbuf.get_bounds()
-            markers = self.bugbuf.get_markers_in_region(begin, end)
-            map(self.bugbuf.delete_marker, markers)
+            self.bugbuf.remove_source_marks(begin, end)
 
             for creature, line in self.conn.bt:
                 if line:
-                    pos = self.bugbuf.get_iter_at_line(line)
-                    self.bugbuf.create_marker(None, "bt", pos)
+                    self.bugbuf.create_source_mark(None, "bt", line)
         self.conn.connect("new_bt",set_bt_markers)
 
-        self.bugview = gtksourceview.SourceView(self.bugbuf)
-        self.bugview.props.show_line_numbers = True 
-        self.bugview.props.show_line_markers = True 
+        self.bugview = gtksourceview2.View(self.bugbuf)
+        self.bugview.props.show_line_numbers = True
+        self.bugview.props.show_line_marks = True
         self.bugview.props.auto_indent = True
         #self.bugview.props.insert_spaces_instead_of_tabs = True
 
         icon = gtk.gdk.pixbuf_new_from_file(PREFIX + 'marker.png')
-        self.bugview.set_marker_pixbuf("bt",icon)
+        self.bugview.set_mark_category_pixbuf("bt",icon)
 
     def setup_connview(self):
         self.connview = connview.ConnView()