Hi,<br><br>I am trying to close open items listed over here: <a href="http://wiki.sugarlabs.org/go/Features/GTK3/Shell">http://wiki.sugarlabs.org/go/Features/GTK3/Shell</a><br>-To Remove hardcoding styles from files like "aboutcomputer/view.py" by referring to <a href="http://wiki.sugarlabs.org/go/Features/GTK3/Theme">http://wiki.sugarlabs.org/go/Features/GTK3/Theme. </a> I have created sugar-theme.css within "aboutcomputer" directory which is referring to CSS present at "sugar-artwork/gtk3/theme/gtk.css"<br>
<br>Then I made changes to aboutcomputer/view.py to load the CSS: (changes are highlighted in bold): <br><br>from gettext import gettext as _<br><br>#import GTK<br><br>from sugar.graphics import style<br><br>from jarabe import config<br>
from jarabe.controlpanel.sectionview import SectionView<br><br><b>from gi.repository import GTK</b><br><br><br><b>USE_LOCAL_CSS = True</b><br><br>class AboutComputer(SectionView):<br> def __init__(self, model, alerts=None):<br>
SectionView.__init__(self)<br><br> self._model = model<br><br> self.set_border_width(style.DEFAULT_SPACING * 2)<br> self.set_spacing(style.DEFAULT_SPACING)<br><br> self._group = GTK.SizeGroup(GTK.SIZE_GROUP_HORIZONTAL)<br>
<br> scrollwindow = GTK.ScrolledWindow()<br> scrollwindow.set_policy(GTK.POLICY_NEVER, GTK.POLICY_AUTOMATIC)<br> self.pack_start(scrollwindow, expand=True)<br> scrollwindow.show()<br><br> self._vbox = GTK.VBox()<br>
scrollwindow.add_with_viewport(self._vbox)<br> self._vbox.show()<br><br> self._setup_identity()<br><br> self._setup_software()<br> self._setup_copyright()<br><b><br> if USE_LOCAL_CSS:<br>
css_provider = GTK.CssProvider()<br> css_provcss_provider.load_from_path('sugar-theme.css')<br> context = GTK.StyleContext()<br> context.add_provider_for_screen(screen, css_provider,<br>
GTK.STYLE_PROVIDER_PRIORITY_USER)</b><br><br>Now when I view click on "My Computer" under "My Settings", I can see error in shell.log.<br>The error is like :<br><br>File "/home/kartik/Sugar_Build_Repo/sugar-build/install/lib/python2.7/site-packages/jarabe/controlpanel/gui.py", line 223, in show_section_view<br>
globals(), locals(), ['view'])<br> File "/home/kartik/Sugar_Build_Repo/sugar-build/install/share/sugar/extensions/cpsection/aboutcomputer/view.py", line 28, in <module><br> from gi.repository import GTK<br>
File "/home/kartik/Sugar_Build_Repo/sugar-build/install/lib/python2.7/site-packages/gi/__init__.py", line 23, in <module><br> from ._gi import _API, Repository<br><b><span style="color:rgb(0,0,0)">ImportError: could not import gobject (error was: ImportError('When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject".',))</span></b><br>
<br>I even tried to change the statement within /sugar-build/install/lib/python2.7/site-packages/gi/__init__.py<br>from : <b>import gi._gobject</b><br>to this : <b>from gi.repository import GObject</b><br><br>But of no use. It is giving the same error.<br>
I am using Sugar 0.96<br><br>Can anyone please provide pointers? Any help will be greatly appreciated :)<br><br><br>Cheers!<br>Kartik Perisetla<br><br>