@@ -72,7 +72,7 @@ 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 ()
@@ -161,7 +161,7 @@ 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 )
@@ -175,7 +175,7 @@ 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 :
@@ -214,7 +214,12 @@ 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 ()
0 commit comments