Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pippy_app.py
diff options
context:
space:
mode:
authorSimon Schampijer <erikos@localhost.localdomain>2008-06-05 14:15:23 (GMT)
committer Simon Schampijer <erikos@localhost.localdomain>2008-06-05 14:15:23 (GMT)
commit69a2c015679c7b31d8c4664e18ab987ad2f63464 (patch)
treeea51bc6a66d1811fefc8c2ea3b326550641bcce5 /pippy_app.py
parentec7397f65a65019128a49fbb71b84fc06dbe857b (diff)
Add check to not fail on new gtksourceview2 API
Diffstat (limited to 'pippy_app.py')
-rw-r--r--pippy_app.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/pippy_app.py b/pippy_app.py
index 15d13b0..99ee682 100644
--- a/pippy_app.py
+++ b/pippy_app.py
@@ -115,13 +115,20 @@ class PippyActivity(ViewSourceActivity):
global text_buffer
text_buffer = gtksourceview2.Buffer()
lang_manager = gtksourceview2.language_manager_get_default()
- langs = lang_manager.list_languages()
+ if hasattr(lang_manager, 'list_languages'):
+ langs = lang_manager.list_languages()
+ else:
+ lang_ids = lang_manager.get_language_ids()
+ langs = [lang_manager.get_language(lang_id) for lang_id in lang_ids]
for lang in langs:
for m in lang.get_mime_types():
if m == "text/x-python":
text_buffer.set_language(lang)
- text_buffer.set_highlight(True)
+ if hasattr(text_buffer,'set_highlight'):
+ text_buffer.set_highlight(True)
+ else:
+ text_buffer.set_highlight_syntax(True)
# The GTK source view window
self.text_view = gtksourceview2.View(text_buffer)