Skip to content

Commit 8ca6cdb

Browse files
committed
Merge pull request #36 from halflings/master
Print as a function (Python 3 compat) and some whitespace fixes
2 parents 98e9a18 + 47c6079 commit 8ca6cdb

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

classifier/classifier.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ def moveto(file, from_folder, to_folder):
1818
from_file = os.path.join(from_folder, file)
1919
to_file = os.path.join(to_folder, file)
2020

21-
#to move only files, not folders
22-
if(os.path.isfile(from_file)):
21+
# to move only files, not folders
22+
if os.path.isfile(from_file):
2323
if not os.path.exists(to_folder):
2424
os.makedirs(to_folder)
25-
2625
os.rename(from_file, to_file)
2726

2827

@@ -45,7 +44,7 @@ def classify(formats, output):
4544

4645

4746
def classify_by_date(date_format, output_dir):
48-
print "Scanning Files"
47+
print("Scanning Files")
4948

5049
directory = os.getcwd()
5150
files = os.listdir(directory)
@@ -55,7 +54,7 @@ def classify_by_date(date_format, output_dir):
5554
folder = creation_date.format(date_format)
5655
moveto(file, directory, folder)
5756

58-
print "Done!"
57+
print("Done!")
5958

6059

6160
def main():

0 commit comments

Comments
 (0)