From f35d0978963c83c932313d552e400ae486b99138 Mon Sep 17 00:00:00 2001
From: James Cameron <quozl@laptop.org>
Date: Thu, 11 Feb 2010 13:39:42 +1100
Subject: [PATCH] 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.
---
bin/sugar-session | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/bin/sugar-session b/bin/sugar-session
index 471d878..0c3fbcd 100644
a
|
b
|
def cleanup_logs(): |
72 | 72 | if os.path.isfile(path): |
73 | 73 | backup_logs.append(f) |
74 | 74 | elif os.path.isdir(path): |
75 | | backup_dirs.append(path) |
| 75 | backup_dirs.append(path) |
76 | 76 | |
77 | 77 | if len(backup_dirs) > 3: |
78 | 78 | backup_dirs.sort() |
… |
… |
def setup_keyboard_cb(): |
161 | 161 | for layout in layouts: |
162 | 162 | layouts_list.append(layout.split('(')[0]) |
163 | 163 | variants_list.append(layout.split('(')[1][:-1]) |
164 | | |
| 164 | |
165 | 165 | if layouts_list is not None and layouts_list is not [] \ |
166 | 166 | and variants_list is not None and variants_list is not []: |
167 | 167 | configrec.set_layouts(layouts_list) |
… |
… |
def setup_keyboard_cb(): |
175 | 175 | options = gconf_client.get_list(\ |
176 | 176 | '/desktop/sugar/peripherals/keyboard/options', gconf.VALUE_STRING) |
177 | 177 | if options is not [] and options is not None: |
178 | | configrec.set_options(options) |
| 178 | configrec.set_options(options) |
179 | 179 | |
180 | 180 | configrec.activate(engine) |
181 | 181 | except Exception: |
… |
… |
def set_fonts(): |
214 | 214 | settings.set_property("gtk-font-name", "%s %f" % (face, size)) |
215 | 215 | |
216 | 216 | 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 |
218 | 223 | logger.start('shell') |
219 | 224 | |
220 | 225 | client = gconf.client_get_default() |