summaryrefslogtreecommitdiffstats
path: root/pyfirstaidkit
diff options
context:
space:
mode:
authorJoel Andres Granados <jgranado@redhat.com>2008-08-06 16:06:30 +0200
committerJoel Andres Granados <jgranado@redhat.com>2008-08-07 15:20:47 +0200
commit7e334e5e4626d8696e8127e494c9eee2fcbb8474 (patch)
treeabf15a2c6edce89bfd0552307d91a5520363413e /pyfirstaidkit
parent7f2d0899817cd7894b44ab014d1a0744691ac7d0 (diff)
downloadfirstaidkit-7e334e5e4626d8696e8127e494c9eee2fcbb8474.tar.gz
firstaidkit-7e334e5e4626d8696e8127e494c9eee2fcbb8474.tar.xz
firstaidkit-7e334e5e4626d8696e8127e494c9eee2fcbb8474.zip
Initial commit for the Grub plugin.
Nothing was used from the original grub plugin. For now they will both coexists in the code.
Diffstat (limited to 'pyfirstaidkit')
-rw-r--r--pyfirstaidkit/utils/__init__.py11
1 files changed, 11 insertions, 0 deletions
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))