aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJauhien Piatlicki (jauhien) <piatlicki@gmail.com>2013-07-13 16:47:17 +0200
committerJauhien Piatlicki (jauhien) <piatlicki@gmail.com>2013-07-13 16:47:17 +0200
commita7191bbbaf263a317b5d3e9b11b413c74bdbf21b (patch)
tree460e127e83e34431c9f18d110847d65d4c6decb2 /g_sorcery/fileutils.py
parentebuild string substitution modified as suggested by Brian Dolbec (diff)
downloadg-sorcery-a7191bbbaf263a317b5d3e9b11b413c74bdbf21b.tar.gz
g-sorcery-a7191bbbaf263a317b5d3e9b11b413c74bdbf21b.tar.bz2
g-sorcery-a7191bbbaf263a317b5d3e9b11b413c74bdbf21b.zip
get_pkgpath modified as suggested by Brian Dolbec
Diffstat (limited to 'g_sorcery/fileutils.py')
-rw-r--r--g_sorcery/fileutils.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/g_sorcery/fileutils.py b/g_sorcery/fileutils.py
index 72b2355..1db9dc9 100644
--- a/g_sorcery/fileutils.py
+++ b/g_sorcery/fileutils.py
@@ -141,14 +141,15 @@ def wget(uri, directory):
"""
return os.system('wget -P ' + directory + ' ' + uri)
-def get_pkgpath():
+def get_pkgpath(root = None):
"""
Get package path.
Returns:
Package path.
"""
- root = __file__
+ if not root:
+ root = __file__
if os.path.islink(root):
root = os.path.realpath(root)
return os.path.dirname(os.path.abspath(root))