Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8d382f0

Browse files
committed
Minor style update
1 parent a475116 commit 8d382f0

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

lib/core/purge.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def purge(directory):
2323
logger.warn(warnMsg)
2424
return
2525

26-
infoMsg = "purging content of directory ('%s'). Please wait as this could take a while" % directory
26+
infoMsg = "purging content of directory '%s'..." % directory
2727
logger.info(infoMsg)
2828

2929
filepaths = []
@@ -33,14 +33,14 @@ def purge(directory):
3333
dirpaths.extend([os.path.abspath(os.path.join(rootpath, _)) for _ in directories])
3434
filepaths.extend([os.path.abspath(os.path.join(rootpath, _)) for _ in filenames])
3535

36-
logger.debug("changing file attributes...")
36+
logger.debug("changing file attributes")
3737
for filepath in filepaths:
3838
try:
3939
os.chmod(filepath, stat.S_IREAD | stat.S_IWRITE)
4040
except:
4141
pass
4242

43-
logger.debug("writing random data to files...")
43+
logger.debug("writing random data to files")
4444
for filepath in filepaths:
4545
try:
4646
filesize = os.path.getsize(filepath)
@@ -49,15 +49,15 @@ def purge(directory):
4949
except:
5050
pass
5151

52-
logger.debug("truncating files...")
52+
logger.debug("truncating files")
5353
for filepath in filepaths:
5454
try:
5555
with open(filepath, 'w') as f:
5656
pass
5757
except:
5858
pass
5959

60-
logger.debug("renaming filenames to random values...")
60+
logger.debug("renaming filenames to random values")
6161
for filepath in filepaths:
6262
try:
6363
os.rename(filepath, os.path.join(os.path.dirname(filepath), "".join(random.sample(string.letters, random.randint(4, 8)))))
@@ -66,13 +66,13 @@ def purge(directory):
6666

6767
dirpaths.sort(cmp=lambda x, y: y.count(os.path.sep) - x.count(os.path.sep))
6868

69-
logger.debug("renaming directory names to random values...")
69+
logger.debug("renaming directory names to random values")
7070
for dirpath in dirpaths:
7171
try:
7272
os.rename(dirpath, os.path.join(os.path.dirname(dirpath), "".join(random.sample(string.letters, random.randint(4, 8)))))
7373
except:
7474
pass
7575

76-
logger.debug("deleting the whole directory tree...")
76+
logger.debug("deleting the whole directory tree")
7777
os.chdir(os.path.join(directory, ".."))
7878
shutil.rmtree(directory)

0 commit comments

Comments
 (0)