changeset 603:7af6ebc30ff8

0.6dev: Use `os.path` instead of `posixpath`.
author osimons
date Thu, 30 Jul 2009 11:11:47 +0000
parents 5e2de07e59f3
children 74618e617c4c
files bitten/build/ctools.py bitten/build/javatools.py bitten/build/monotools.py bitten/build/svntools.py bitten/web_ui.py
diffstat 5 files changed, 10 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- 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'):
--- 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])
--- 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
 
--- 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:
--- 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,
Copyright (C) 2012-2017 Edgewall Software