~ubuntu-branches/ubuntu/karmic/pida/karmic

« back to all changes in this revision

Viewing changes to pida/utils/culebra/svbase.py

  • Committer: Bazaar Package Importer
  • Author(s): Jan Luebbe
  • Date: 2007-09-05 17:54:09 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070905175409-ty9f6qpuctyjv1sd
Tags: 0.5.1-2
* Depend on librsvg2-common, which is not pulled in by the other depends
  (closes: #394860)
* gvim is no alternative for python-gnome2 and python-gnome2-extras
  (closes: #436431)
* Pida now uses ~/.pida2, so it can no longer be confused by old
  configurations (closes: #421378)
* Culebra is no longer supported by upstream (closes: #349009)
* Update manpage (closes: #440375)
* Update watchfile (pida is now called PIDA)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
import gtksourceview
3
 
from rat import text
4
 
 
5
 
LANG_MANAGER = gtksourceview.SourceLanguagesManager()
6
 
 
7
 
class BaseView(gtksourceview.SourceView):
8
 
    def __init__(self):
9
 
        super(BaseView, self).__init__()
10
 
        self.set_auto_indent(True)
11
 
        self.set_show_line_numbers(True)
12
 
        self.set_show_line_markers(True)
13
 
        self.set_tabs_width(4)
14
 
        self.set_margin(80)
15
 
        self.set_show_margin(True)
16
 
        self.set_smart_home_end(True)
17
 
        self.set_highlight_current_line(True)
18
 
        self.set_insert_spaces_instead_of_tabs(True)
19
 
        text.make_source_view_indentable(self)
20
 
 
21
 
 
22
 
class BaseBuffer(gtksourceview.SourceBuffer):
23
 
 
24
 
    def __init__(self):
25
 
        super(BaseBuffer, self).__init__()
26
 
        self.languages_manager = LANG_MANAGER
27
 
        self.set_highlight(True)
28
 
 
29
 
    def set_mime_type(self, mtype):
30
 
        mts = '/'.join(mtype)
31
 
        lang = self.languages_manager.get_language_from_mime_type(mts)
32
 
        if lang is not None:
33
 
            self.set_language(lang)