summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Jehannet <julien.jehannet@logilab.fr>2009-07-10 14:57:13 +0200
committerJulien Jehannet <julien.jehannet@logilab.fr>2009-07-10 14:57:13 +0200
commit22d394fdf7d9651080691cb24efa12acba9ed3c4 (patch)
tree2089fe1f007ddc24a5d4312122683db6fb5adff5
parent5218fa8e566a72f690c13dc3d29d439582ba2e29 (diff)
downloadlogilab-common-22d394fdf7d9651080691cb24efa12acba9ed3c4.tar.gz
fix wrong function call
-rw-r--r--shellutils.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/shellutils.py b/shellutils.py
index b8d850d..ccc5267 100644
--- a/shellutils.py
+++ b/shellutils.py
@@ -25,7 +25,7 @@ try:
except ImportError:
# windows platform
class NoSuchProcess(Exception): pass
-
+
def ProcInfo(pid):
raise NoSuchProcess()
@@ -51,9 +51,8 @@ def chown(path, login=None, group=None):
gid = int(group)
except ValueError:
import grp
- gid = grp.getgrname(group).gr_gid
+ gid = grp.getgrnam(group).gr_gid
os.chown(path, uid, gid)
-
def mv(source, destination, _action=shutil.move):
"""A shell-like mv, supporting wildcards.
@@ -75,7 +74,7 @@ def mv(source, destination, _action=shutil.move):
except OSError, ex:
raise OSError('Unable to move %r to %r (%s)' % (
source, destination, ex))
-
+
def rm(*files):
"""A shell-like rm, supporting wildcards.
"""
@@ -87,13 +86,12 @@ def rm(*files):
shutil.rmtree(filename)
else:
os.remove(filename)
-
+
def cp(source, destination):
"""A shell-like cp, supporting wildcards.
"""
mv(source, destination, _action=shutil.copy)
-
def find(directory, exts, exclude=False, blacklist=STD_BLACKLIST):
"""Recursivly find files ending with the given extensions from the directory.