# HG changeset patch # User osimons # Date 1248952307 0 # Node ID 7af6ebc30ff88117abb6df81671ea52243680273 # Parent 5e2de07e59f33eec6f51ae4c467c014e216858fd 0.6dev: Use `os.path` instead of `posixpath`. diff --git a/bitten/build/ctools.py b/bitten/build/ctools.py --- a/bitten/build/ctools.py +++ b/bitten/build/ctools.py @@ -13,7 +13,6 @@ import logging import re import os -import posixpath import shlex from bitten.build import CommandLine, FileSet @@ -172,7 +171,7 @@ for file_elem in location.children('File'): filepath = file_elem.gettext() if srcdir is not None: - filepath = posixpath.join(srcdir, filepath) + filepath = os.path.join(srcdir, filepath) test.attr['file'] = filepath break for line_elem in location.children('Line'): diff --git a/bitten/build/javatools.py b/bitten/build/javatools.py --- a/bitten/build/javatools.py +++ b/bitten/build/javatools.py @@ -14,7 +14,6 @@ from glob import glob import logging import os -import posixpath import shlex import tempfile @@ -120,7 +119,7 @@ test.attr['duration'] = testcase.attr['time'] if srcdir is not None: cls = testcase.attr['classname'].split('.') - test.attr['file'] = posixpath.join(srcdir, *cls) + \ + test.attr['file'] = os.path.join(srcdir, *cls) + \ '.java' result = list(testcase.children()) @@ -217,7 +216,7 @@ for filename, name in class_names.iteritems(): counter = counters[filename] module = xmlio.Element('coverage', name=name, - file=posixpath.join(srcdir, filename), + file=os.path.join(srcdir, filename), lines=counter.num_lines, percentage=counter.percentage) module.append(xmlio.Element('line_hits')[counter.line_hits]) diff --git a/bitten/build/monotools.py b/bitten/build/monotools.py --- a/bitten/build/monotools.py +++ b/bitten/build/monotools.py @@ -15,7 +15,6 @@ from glob import glob import logging import os -import posixpath import shlex import tempfile diff --git a/bitten/build/svntools.py b/bitten/build/svntools.py --- a/bitten/build/svntools.py +++ b/bitten/build/svntools.py @@ -11,7 +11,6 @@ """Recipe commands for Subversion.""" import logging -import posixpath import re import shutil import os @@ -86,7 +85,7 @@ if revision: args += ['-r', revision] if path: - final_url = posixpath.join(url, path.lstrip('/')) + final_url = os.path.join(url, path.lstrip('/')) else: final_url = url if username: @@ -129,7 +128,7 @@ if revision: args += ['-r', revision] if path: - url = posixpath.join(url, path) + url = os.path.join(url, path) if username: args += ['--username', username] if password: diff --git a/bitten/web_ui.py b/bitten/web_ui.py --- a/bitten/web_ui.py +++ b/bitten/web_ui.py @@ -10,7 +10,7 @@ """Implementation of the Bitten web interface.""" -import posixpath +import os import re from StringIO import StringIO @@ -708,16 +708,16 @@ cache = {} def _replace(m): - filepath = posixpath.normpath(m.group('path').replace('\\', '/')) + filepath = os.path.normpath(m.group('path').replace('\\', '/')) if not cache.get(filepath) is True: parts = filepath.split('/') path = '' for part in parts: - path = posixpath.join(path, part) + path = os.path.join(path, part) if path not in cache: try: - full_path = posixpath.join(config.path, path) - full_path = posixpath.normpath(full_path) + full_path = os.path.join(config.path, path) + full_path = os.path.normpath(full_path) if full_path.startswith(config.path + "/") \ or full_path == config.path: repos.get_node(full_path,