[sysadmin-bin: 108/168] Kill useless split_lines function



commit 2ab45e62ac24ae9d9d30fcc6950dc0ed7b51b5ef
Author: Olav Vitters <olav bkor dhs org>
Date:   Thu Jun 11 14:57:19 2009 +0200

    Kill useless split_lines function

 git.py                   |    2 +-
 gnome-post-receive-email |    4 ++--
 util.py                  |    7 -------
 3 files changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/git.py b/git.py
index 63b09d1..b3c7dd8 100644
--- a/git.py
+++ b/git.py
@@ -110,7 +110,7 @@ def git_run(command, *args, **kwargs):
         return None
     else:
         if do_split_lines:
-            return split_lines(output.strip())
+            return output.strip().splitlines()
         else:
             return output.strip()
 
diff --git a/gnome-post-receive-email b/gnome-post-receive-email
index 7efb313..aa7b9c1 100755
--- a/gnome-post-receive-email
+++ b/gnome-post-receive-email
@@ -40,7 +40,7 @@ script_dir = os.path.dirname(script_path)
 sys.path.insert(0, script_dir)
 
 from git import *
-from util import die, split_lines, strip_string as s, start_email, end_email
+from util import die, strip_string as s, start_email, end_email
 
 # When we put a git subject into the Subject: line, where to truncate
 SUBJECT_MAX_SUBJECT_CHARS = 100
@@ -213,7 +213,7 @@ class BranchChange(RefChange):
                 # Exclude commits that are ancestors of all other branches
                 detailed_commit_args.append("^" + branch)
 
-        detailed_commits = split_lines(git.rev_list(*detailed_commit_args))
+        detailed_commits = git.rev_list(*detailed_commit_args).splitlines()
 
         self.detailed_commits = set()
         for id in detailed_commits:
diff --git a/util.py b/util.py
index ed775c8..f350196 100644
--- a/util.py
+++ b/util.py
@@ -27,13 +27,6 @@ def die(message):
     print >>sys.stderr, message
     sys.exit(1)
 
-# Used to split the output of a command that outputs one result per line
-def split_lines(str):
-    if str == "":
-        return []
-    else:
-        return str.split("\n")
-
 # This cleans up our generation code by allowing us to use the same indentation
 # for the first line and subsequent line of a multi-line string
 def strip_string(str):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]