Commits

Moises Henriquez committed 446a4a7

Added support syntax highlighting for script viewer

Comments (0)

Files changed (2)

src/vpackager/data/slack-required

 autoconf >= 2.65
 make >= 3.82
 perl >= 5.12.3
-psutil >= 0.2.0
+psutil >= 0.2.0
+pygtksourceview >= 2.10.1

src/vpackager/guitools.py

 import bottools
 import threading
 import time
+import gtksourceview2
 
 
 __author__ = 'M0E-lnx'
     def _get_logview(self):
         scrl = gtk.ScrolledWindow()
         scrl.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
-        textview = gtk.TextView()
+        #textview = gtk.TextView()
+        buf = gtksourceview2.Buffer()
+        buf.set_highlight_syntax(True)
+        mgr = gtksourceview2.LanguageManager()
+        if 'SlackBuild' in self.logpath:
+            lang = mgr.get_language("sh")
+        else:
+            lang = mgr.get_language("classic")
+        buf.set_language(lang)
+        #style_scheme = mgr.get_scheme('classic')
+        #if style_scheme:
+         #   buf.set_style_scheme(style_scheme)
+        textview = gtksourceview2.View(buf)
+        textview.set_show_line_numbers(True)
+        textview.set_auto_indent(True)
+        
         for edge in (gtk.TEXT_WINDOW_LEFT, gtk.TEXT_WINDOW_RIGHT,
                      gtk.TEXT_WINDOW_TOP, gtk.TEXT_WINDOW_BOTTOM):
             textview.set_border_window_size(edge, 4)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.