aboutsummaryrefslogtreecommitdiffstats
path: root/min4.py
diff options
context:
space:
mode:
Diffstat (limited to 'min4.py')
-rw-r--r--min4.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/min4.py b/min4.py
index 081dfaa..f16218c 100644
--- a/min4.py
+++ b/min4.py
@@ -7,6 +7,7 @@ import os
from subprocess import call
import glob
from datetime import datetime
+from sys import argv
_OLD = datetime.now().year - 4
@@ -27,7 +28,19 @@ def organise_dir(directory):
call(['rm', '-rf', src])
def main():
- d = next(os.walk('.'))[1]
+ try:
+ path = argv[1]
+ except:
+ path = '.'
+
+ if path[-1] != '/':
+ path += '/'
+
+ d_temp = next(os.walk(path))[1]
+ d = []
+ for item in d_temp:
+ d.append(path + item)
+
for sd in d:
organise_dir(sd)
return 0