summaryrefslogtreecommitdiffstats
path: root/g-ed-it/commitDialog.py
diff options
context:
space:
mode:
authorMatthieu Gautier <mgautier@fedoraproject.org>2009-04-03 07:37:14 +0200
committerMatthieu Gautier <mgautier@fedoraproject.org>2009-04-03 07:37:14 +0200
commitbec3ba59a76c90e3364e6dd2abe794ebb8441d97 (patch)
treecaaae46103d393e8992825270d7f0b5380ff0b40 /g-ed-it/commitDialog.py
parent8cf9b696151d4347a1163bd114048c2d0d88a92b (diff)
downloadg-ed-it-bec3ba59a76c90e3364e6dd2abe794ebb8441d97.zip
g-ed-it-bec3ba59a76c90e3364e6dd2abe794ebb8441d97.tar.gz
g-ed-it-bec3ba59a76c90e3364e6dd2abe794ebb8441d97.tar.xz
Use subprocess instead of os.system to "git commit".
Signed-off-by: Matthieu Gautier <mgautier@fedoraproject.org>
Diffstat (limited to 'g-ed-it/commitDialog.py')
-rw-r--r--g-ed-it/commitDialog.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/g-ed-it/commitDialog.py b/g-ed-it/commitDialog.py
index 0aa03e6..bd1906a 100644
--- a/g-ed-it/commitDialog.py
+++ b/g-ed-it/commitDialog.py
@@ -2,7 +2,6 @@
#-*- coding:utf-8 -*-
import os
-
import subprocess
class CommitDialog (object):
@@ -33,8 +32,10 @@ class CommitDialog (object):
def on_commit_button_clicked(self, close_button):
commit_text_buffer = self.commit_text_box.get_buffer()
- os.system("git-commit -s -m'"+commit_text_buffer.get_text(commit_text_buffer.get_start_iter(),commit_text_buffer.get_end_iter())+"'")
- if self.call_obj :self.call_obj.getDocState()
+ subprocess.call(["git-commit","-m'"+commit_text_buffer.get_text(commit_text_buffer.get_start_iter(),commit_text_buffer.get_end_iter())+"'"],cwd=self.cwd)
+ if self.call_obj :
+ self.call_obj.getDocState()
+ print "callback"
commit_text_buffer.set_text("")
self.commit_dialog.hide()
pass
@@ -46,11 +47,13 @@ class CommitDialog (object):
self.fileName = fileName
self.call_obj = call_obj
if self.fileName:
- templateMsg = subprocess.Popen(["git-status","-s",os.path.basename(fileName)],stdout=subprocess.PIPE,cwd=os.path.dirname(fileName)).communicate()[0]
+ self.cwd = os.path.dirname(fileName)
+ templateMsg = subprocess.Popen(["git-status","-s",os.path.basename(fileName)],stdout=subprocess.PIPE,cwd=self.cwd).communicate()[0]
else:
- cwd = os.path.dirname(self.window.get_active_document().get_uri_for_display())
- templateMsg = subprocess.Popen(["git-status","-s"],stdout=subprocess.PIPE,cwd=cwd).communicate()[0]
+ self.cwd = os.path.dirname(self.window.get_active_document().get_uri_for_display())
+ templateMsg = subprocess.Popen(["git-status","-s"],stdout=subprocess.PIPE,cwd=self.cwd).communicate()[0]
self.commit_text_box.get_buffer().set_text(templateMsg)
self.commit_dialog.show()
+ print "dialog shown"