From 7e334e5e4626d8696e8127e494c9eee2fcbb8474 Mon Sep 17 00:00:00 2001 From: Joel Andres Granados Date: Wed, 6 Aug 2008 16:06:30 +0200 Subject: Initial commit for the Grub plugin. Nothing was used from the original grub plugin. For now they will both coexists in the code. --- pyfirstaidkit/utils/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'pyfirstaidkit') diff --git a/pyfirstaidkit/utils/__init__.py b/pyfirstaidkit/utils/__init__.py index 94e9279..28eb37e 100644 --- a/pyfirstaidkit/utils/__init__.py +++ b/pyfirstaidkit/utils/__init__.py @@ -16,6 +16,7 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. import os +import os.path import sys import subprocess from backup import * @@ -44,4 +45,14 @@ Returns the subprocess.Popen object""" stderr = subprocess.PIPE) +def join(path1, path2): + """Avoids the os.path.join behavioir. + if a full path is given to os.path.join it ignores the prefious + arguments. The needed behavior is to join two paths with only + one separator. + path1 - being the begining of the path name and + path2 - being the end. + """ + # We strip the paths first and then join them. + return os.path.join(os.sep, path1.strip(os.sep), path2.strip(os.sep)) -- cgit