Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpgritti@gmail.com>2008-10-05 18:43:52 (GMT)
committer Marco Pesenti Gritti <mpgritti@gmail.com>2008-10-05 18:43:52 (GMT)
commit009fcfc42f492ae0e305c6c67ef8faa1907236f6 (patch)
tree04fb13cc61a11c576a9ca5db27104604e7b2a589
parent6c5fb7c319889566a00944a3520cb0ff806fa752 (diff)
Move journal startup to sugar-shell.
Remove unused shell view method.
-rw-r--r--bin/sugar-shell19
-rw-r--r--src/jarabe/view/shell.py25
2 files changed, 19 insertions, 25 deletions
diff --git a/bin/sugar-shell b/bin/sugar-shell
index 5e3abf5..fb3f96d 100644
--- a/bin/sugar-shell
+++ b/bin/sugar-shell
@@ -19,6 +19,9 @@ import sys
import os
import gettext
import logging
+import time
+import shutil
+
import gtk
import gobject
import dbus.glib
@@ -28,6 +31,8 @@ dbus.glib.threads_init()
from sugar import logger
from sugar.profile import get_profile
+from sugar.datastore import datastore
+from sugar import env
from jarabe.view import shell
from jarabe.shellservice import ShellService
@@ -37,6 +42,7 @@ from jarabe.session import get_session_manager
from jarabe.nmservice import NMService
from jarabe.model import sound
from jarabe.model import screen
+from jarabe.journal import journalactivity
from jarabe import logsmanager
from jarabe import config
@@ -47,6 +53,19 @@ def _shell_started_cb():
home_box = shell.get_instance().home_window.get_home_box()
home_box.show_software_updates_alert()
+ # Mount the datastore in internal flash
+ ds_path = env.get_profile_path('datastore')
+ try:
+ datastore.mount(ds_path, [], timeout=120)
+ except Exception, e:
+ # Don't explode if there's corruption; move the data out of the way
+ # and attempt to create a store from scratch.
+ logging.error(e)
+ shutil.move(ds_path, os.path.abspath(ds_path) + str(time.time()))
+ datastore.mount(ds_path, [], timeout=120)
+
+ journalactivity.start()
+
def main():
gobject.idle_add(_shell_started_cb)
diff --git a/src/jarabe/view/shell.py b/src/jarabe/view/shell.py
index 8f445fc..58a41bb 100644
--- a/src/jarabe/view/shell.py
+++ b/src/jarabe/view/shell.py
@@ -15,9 +15,6 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import logging
-import os
-import time
-import shutil
import gobject
import gtk
@@ -26,12 +23,9 @@ import wnck
from sugar.activity.activityhandle import ActivityHandle
from sugar import activity
from sugar.activity import activityfactory
-from sugar.datastore import datastore
-from sugar import env
from jarabe.view.launchwindow import LaunchWindow
from jarabe.model import shell
-from jarabe.journal import journalactivity
class Shell(gobject.GObject):
def __init__(self):
@@ -56,22 +50,6 @@ class Shell(gobject.GObject):
self._model.connect('launch-failed', self.__launch_failed_cb)
self._model.connect('launch-completed', self.__launch_completed_cb)
- gobject.idle_add(self._start_journal_idle)
-
- def _start_journal_idle(self):
- # Mount the datastore in internal flash
- ds_path = env.get_profile_path('datastore')
- try:
- datastore.mount(ds_path, [], timeout=120)
- except Exception, e:
- # Don't explode if there's corruption; move the data out of the way
- # and attempt to create a store from scratch.
- logging.error(e)
- shutil.move(ds_path, os.path.abspath(ds_path) + str(time.time()))
- datastore.mount(ds_path, [], timeout=120)
-
- journalactivity.start()
-
def __launch_started_cb(self, home_model, home_activity):
if home_activity.is_journal():
return
@@ -99,9 +77,6 @@ class Shell(gobject.GObject):
else:
logging.error('Launcher for %s is missing' % activity_id)
- def get_model(self):
- return self._model
-
def get_frame(self):
return self._frame