Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1003)

Unified Diff: appengine/findit/common/repo_util.py

Issue 2432113002: [Findit] Add local_git_repository (Closed)
Patch Set: Fix nits. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/findit/common/repo_util.py
diff --git a/appengine/findit/common/repo_util.py b/appengine/findit/common/repo_util.py
index 644b44aebf6c8f2e08ed3ca57b644cf7604cccc3..860e386090aab701a043a0287c378658df5b9a1b 100644
--- a/appengine/findit/common/repo_util.py
+++ b/appengine/findit/common/repo_util.py
@@ -4,6 +4,7 @@
import json
import re
+import subprocess
import urllib2
CODE_REVIEW_URL_PATTERN = re.compile(
@@ -72,3 +73,18 @@ def GetRevertedRevision(message):
reverted_revision_match = REVERTED_REVISION_PATTERN.match(line)
if reverted_revision_match:
return reverted_revision_match.group(1)
+
+
+# TODO(katesonia): Add local cache for this function.
+def GetCommandOutput(command):
+ """Gets the output stream of executable command.
+
+ Args:
+ command (str): Command to execute to get output.
+
+ Return:
+ Output steam of the command.
+ """
+ p = subprocess.Popen(
+ command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
+ return p.communicate()[0]

Powered by Google App Engine
This is Rietveld 408576698