Ticket #2006: 0001-file-exisits-check.patch

File 0001-file-exisits-check.patch, 877 bytes (added by walter, 14 years ago)

check to see if file exists before trying to remove it

  • extensions/cpsection/touchpad/model.py

    From 3f52994220944760786a161c8046c2fbbd7ca89a Mon Sep 17 00:00:00 2001
    From: Walter Bender <walter@sugarlabs.org>
    Date: Fri, 21 May 2010 11:08:06 -0400
    Subject: [PATCH] file exisits check
    
    ---
     extensions/cpsection/touchpad/model.py |    3 ++-
     1 files changed, 2 insertions(+), 1 deletions(-)
    
    diff --git a/extensions/cpsection/touchpad/model.py b/extensions/cpsection/touchpad/model.py
    index 77eefa4..8c17cb9 100644
    a b def get_touchpad(): 
    3838def set_touchpad(touchpad):
    3939    """Set the touchpad mode."""
    4040    if touchpad == _CAPACITIVE:
    41         system("rm %s" % (_flag_path))
     41        if path.exisits(_flag_path):
     42            system("rm %s" % (_flag_path))
    4243        system("echo 0 > %s" % (_node_path))
    4344    else:
    4445        system("touch %s" % (_flag_path))