Commit acef43d5 authored by Stephen Kennedy's avatar Stephen Kennedy

Reenable deprecation warnings and update code which uses them

parent 17876772
......@@ -75,9 +75,9 @@ if gtk.pygtk_version < pygtkver:
missing_reqs("pygtk", pygtkver)
# Ignore deprecation warnings from pygtk > 2.6
if gtk.pygtk_version >= (2,8,0):
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
#if gtk.pygtk_version >= (2,8,0):
# import warnings
# warnings.filterwarnings("ignore", category=DeprecationWarning)
gtk.glade.bindtextdomain("meld", paths.locale_dir())
gtk.glade.textdomain("meld")
......
......@@ -23,6 +23,7 @@
import os
import re
import subprocess
from gettext import gettext as _
# ignored, new, normal, ignored changes,
......@@ -186,3 +187,7 @@ class CachedVc(Vc):
if self._tree_cache is None:
self.cache_inventory(directory)
return self._tree_cache
def popen(cmd, cwd=None):
return subprocess.Popen(cmd, cwd=cwd, stdout=subprocess.PIPE).stdout
......@@ -60,10 +60,10 @@ class Vc(_vc.CachedVc):
return self.root
def _lookup_tree_cache(self, rootdir):
branch_root = os.popen("%s root %s" % (self.CMD, rootdir)).read().rstrip('\n')
branch_root = _vc.popen([self.CMD, "root", rootdir]).read().rstrip('\n')
while 1:
try:
proc = os.popen("%s status %s" % (self.CMD, branch_root))
proc = _vc.popen([self.CMD, status, branch_root])
entries = proc.read().split("\n")[:-1]
break
except OSError, e:
......
......@@ -21,8 +21,6 @@
### (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
### THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import os
import misc
import _vc
import svn
......@@ -38,6 +36,6 @@ class Vc(svn.Vc):
return self.root
def _get_matches(self, directory):
entries = misc.cmdout([self.CMD, "status"], cwd=directory)[0]
entries = _vc.popen([self.CMD, "status"], cwd=directory).read()
for line in entries.split("\n")[1:-1]:
yield line[3:], line[0], ""
......@@ -89,13 +89,12 @@ class Vc(_vc.CachedVc):
def _get_whatsnew(self, boring=False):
whatsnew = {}
commandline = ('%s whatsnew --summary -l --repodir=%s' %
(self.CMD, self.root))
commandline = [self.CMD, "whatsnew", "--summary", "-l" "--repodir="+self.root]
if boring:
commandline = '%s --boring' % commandline
commandline.append("--boring")
while 1:
try:
p = os.popen(commandline)
p = _vc.popen(commandline)
break
except OSError, e:
if e.errno != errno.EAGAIN:
......
......@@ -68,7 +68,7 @@ class Vc(_vc.CachedVc):
def _lookup_tree_cache(self, rootdir):
while 1:
try:
proc = os.popen("cd %s && %s status --untracked-files" % (self.root, self.CMD))
proc = _vc.popen([self.CMD, "status", "--untracked-files"], cwd=self.root)
entries = proc.read().split("\n")[:-1]
break
except OSError, e:
......
......@@ -66,7 +66,7 @@ class Vc(_vc.Vc):
while 1:
try:
entries = os.popen('cd "%s" && %s status -A .' % (directory, self.CMD)).read().split("\n")[:-1]
entries = _vc.popen([self.CMD, "status", "-A", "."], cwd=directory).read().split("\n")[:-1]
break
except OSError, e:
if e.errno != errno.EAGAIN:
......
......@@ -119,11 +119,10 @@ class Vc(_vc.CachedVc):
# for monotone >= 0.26
self.VC_DIR = "_MTN"
self.CMD = "mtn"
cstdin, cstdout, cstderr = os.popen3(self.CMD + " automate interface_version")
self.interface_version = float(cstdout.read())
self.interface_version = float(_vc.popen([self.CMD, "automate", "interface_version"]).read())
if self.interface_version > 9.0:
print "WARNING: Unsupported interface version (please report any problems to the meld mailing list)"
except ValueError:
except (ValueError, OSError):
# for monotone <= 0.25
self.VC_DIR = "MT"
self.CMD = "monotone"
......@@ -150,8 +149,8 @@ class Vc(_vc.CachedVc):
def _lookup_tree_cache(self, rootdir):
while 1:
try:
entries = os.popen("cd %s && %s automate inventory" %
(self.root, self.CMD)).read().split("\n")[:-1]
entries = _vc.popen([self.CMD, "automate", "inventory"],
cwd=self.root).read().split("\n")[:-1]
break
except OSError, e:
if e.errno != errno.EAGAIN:
......
......@@ -69,7 +69,7 @@ class Vc(_vc.Vc):
while 1:
try:
entries = os.popen("%s status -Nv %s" % (self.CMD, directory))
entries = _vc.popen([self.CMD, "status", "-Nv", directory])
break
except OSError, e:
if e.errno != errno.EAGAIN:
......
......@@ -96,10 +96,10 @@ class Vc(_vc.CachedVc):
def _lookup_tree_cache(self, rootdir):
whatsnew = {}
commandline = ('%s changes -d %s' % (self.CMD, self.root))
commandline = [self.CMD, "changes", "-d", self.root]
while 1:
try:
p = os.popen(commandline)
p = _vc.popen(commandline)
break
except OSError, e:
if e.errno != errno.EAGAIN:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment