From: Jonathan Corbet Date: Thu, 22 Jul 2010 20:43:43 +0000 (-0600) Subject: Use os.path.join() to prepend the directory name X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ea23ca50c0d3ba5e51a5d00c4811b99b889a521a;p=people%2Flarsk%2Fxenproject-org-gitdm.git Use os.path.join() to prepend the directory name ...that way we get the right result regardless of whether slashes have been provided. Signed-off-by: Jonathan Corbet --- diff --git a/ConfigFile.py b/ConfigFile.py index 1fc8823..4b7a9ce 100644 --- a/ConfigFile.py +++ b/ConfigFile.py @@ -4,13 +4,13 @@ # # This code is part of the LWN git data miner. # -# Copyright 2007-8 LWN.net -# Copyright 2007-8 Jonathan Corbet +# Copyright 2007-10 LWN.net +# Copyright 2007-10 Jonathan Corbet # # This file may be distributed under the terms of the GNU General # Public License, version 2. # -import sys, re, datetime +import sys, re, datetime, os.path import database # @@ -107,13 +107,13 @@ def ConfigFile (name, confdir): if len (sline) < 2: croak ('Funky config line: "%s"' % (line)) if sline[0] == 'EmailAliases': - ReadEmailAliases (confdir + sline[1]) + ReadEmailAliases (os.path.join (confdir, sline[1])) elif sline[0] == 'EmailMap': - ReadEmailEmployers (confdir + sline[1]) + ReadEmailEmployers (os.path.join (confdir, sline[1])) elif sline[0] == 'GroupMap': if len (sline) != 3: croak ('Funky group map line "%s"' % (line)) - ReadGroupMap (confdir + sline[1], sline[2]) + ReadGroupMap (os.path.join (confdir, sline[1]), sline[2]) else: croak ('Unrecognized config line: "%s"' % (line)) line = ReadConfigLine (file)