[projects/git-slug: 21/170] Use os.path.expanduser instead of path.join and getenv(HOME)

glen glen at pld-linux.org
Mon Sep 21 21:40:34 CEST 2015


commit 38d5ebd4433da4e3038b95a685c7058862e1fe5d
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Fri Sep 16 21:35:33 2011 +0100

    Use os.path.expanduser instead of path.join and getenv(HOME)

 slug.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/slug.py b/slug.py
index d5e7fd3..ab1f8a1 100755
--- a/slug.py
+++ b/slug.py
@@ -127,7 +127,7 @@ def fetch_packages(options):
 
 common_options = argparse.ArgumentParser(add_help=False)
 common_options.add_argument('-d', '--packagesdir', help='local directory with git repositories',
-    default=os.path.join(os.getenv('HOME'),'PLD_clone/packages'))
+    default=os.path.expanduser('~/PLD_clone/packages'))
 common_options.add_argument('-u', '--user',
         help='the user name to register for pushes for new repositories')
 
@@ -145,7 +145,7 @@ clone.add_argument('--depth', help='depth of fetch', default=0)
 clone.add_argument('-n', '--newpkgs', help='download packages that do not exist on local side',
         action='store_true')
 clone.add_argument('-r', '--remoterefs', help='repository with list of all refs',
-    default=os.path.join(os.getenv('HOME'),'PLD_clone/Refs.git'))
+    default=os.path.expanduser('~/PLD_clone/Refs.git'))
 clone.add_argument('dirpattern', nargs='?', default = '*')
 clone.set_defaults(func=fetch_packages)
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/git-slug.git/commitdiff/4ed64f73960519a2f4fd04c42950b2c96ae795c5



More information about the pld-cvs-commit mailing list