This commit is contained in:
Florian Bruhin 2014-05-16 07:49:04 +02:00
parent 480e222d6d
commit 8f58d22ad7
2 changed files with 3 additions and 3 deletions

View File

@ -54,7 +54,7 @@ def elide(text, length):
if len(text) <= length: if len(text) <= length:
return text return text
else: else:
return text[:length-1] + '\u2026' return text[:length - 1] + '\u2026'
def check_overflow(arg, ctype, fatal=True): def check_overflow(arg, ctype, fatal=True):

View File

@ -36,11 +36,11 @@ def remove(path):
"""Remove either a file or directory unless --dry-run is given.""" """Remove either a file or directory unless --dry-run is given."""
if os.path.isdir(path): if os.path.isdir(path):
print("rm -r '{}'".format(path)) print("rm -r '{}'".format(path))
if not '--dry-run' in sys.argv: if '--dry-run' not in sys.argv:
shutil.rmtree(path) shutil.rmtree(path)
else: else:
print("rm '{}'".format(path)) print("rm '{}'".format(path))
if not '--dry-run' in sys.argv: if '--dry-run' not in sys.argv:
os.remove(path) os.remove(path)