[gnome-schedule] Fix bug: lp: 617873, script[-1] out of range
- From: Gaute Hope <gauteh src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-schedule] Fix bug: lp: 617873, script[-1] out of range
- Date: Fri, 27 Aug 2010 11:22:14 +0000 (UTC)
commit a49ba5073990f9e44feab5fe70f36375035c06e9
Author: Gaute Hope <eg gaute vetsj com>
Date: Wed Aug 18 09:27:22 2010 +0200
Fix bug: lp: 617873, script[-1] out of range
src/at.py | 32 ++------------------------------
1 files changed, 2 insertions(+), 30 deletions(-)
---
diff --git a/src/at.py b/src/at.py
index 87ee49b..e5244c1 100644
--- a/src/at.py
+++ b/src/at.py
@@ -164,17 +164,7 @@ fi
#removing ending newlines, but keep one
#if a date in the past is selected the record is removed by at, this creates an error, and generally if the script is of zero length
# TODO: complain about it as well
-
- if len(script) < 2:
- done = 1
- else:
- done = 0
-
- while done == 0:
- if script[-1] == "\n":
- script = script[0:-1]
- else:
- done = 1
+ script = script.rstrip()
return job_id, date, time, class_id, user, script, title, dangerous, output
@@ -620,25 +610,7 @@ fi
result = result.replace("\n",";")
result = result.replace ("&", "&")
#remove ending newlines, not if result len = 0
- if len(result) < 2:
- done = 1
- else:
- done = 0
- while done == 0:
- if result[-1] == ";":
- result = result[0:-1]
- else:
- done = 1
- #remove beginning newlines
- if len(result) < 2:
- done = 1
- else:
- done = 0
- while done == 0:
- if result[0] == ";":
- result = result[1:]
- else:
- done = 1
+ result = result.strip ()
if len(result) >= preview_len :
result = result + "..."
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]