Skip to content

Commit 4cde481

Browse files
quozlTomeu Vizoso
authored andcommitted
ignore logging cleanup fail, sugarlabs.org #1720 laptop.org #9623
reinstates a design feature that was in sugar-session last year that was removed during rework.
1 parent 8e51010 commit 4cde481

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

bin/sugar-session

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def cleanup_logs():
7272
if os.path.isfile(path):
7373
backup_logs.append(f)
7474
elif os.path.isdir(path):
75-
backup_dirs.append(path)
75+
backup_dirs.append(path)
7676

7777
if len(backup_dirs) > 3:
7878
backup_dirs.sort()
@@ -161,7 +161,7 @@ def setup_keyboard_cb():
161161
for layout in layouts:
162162
layouts_list.append(layout.split('(')[0])
163163
variants_list.append(layout.split('(')[1][:-1])
164-
164+
165165
if layouts_list is not None and layouts_list is not [] \
166166
and variants_list is not None and variants_list is not []:
167167
configrec.set_layouts(layouts_list)
@@ -175,7 +175,7 @@ def setup_keyboard_cb():
175175
options = gconf_client.get_list(\
176176
'/desktop/sugar/peripherals/keyboard/options', gconf.VALUE_STRING)
177177
if options is not [] and options is not None:
178-
configrec.set_options(options)
178+
configrec.set_options(options)
179179

180180
configrec.activate(engine)
181181
except Exception:
@@ -214,7 +214,12 @@ def set_fonts():
214214
settings.set_property("gtk-font-name", "%s %f" % (face, size))
215215

216216
def main():
217-
cleanup_logs()
217+
try:
218+
cleanup_logs()
219+
except OSError, e:
220+
# logs cleanup is not critical; it should not prevent sugar from
221+
# starting if (for example) the disk is full or read-only.
222+
print 'logs cleanup failed: %s' % e
218223
logger.start('shell')
219224

220225
client = gconf.client_get_default()

0 commit comments

Comments
 (0)