Skip to content

Commit 337ade4

Browse files
committed
Skip dotfiles when organizing files based on creation date
Running command "classifier" in something like Dropbox, Syncthing or your $HOME folder and using '-dt' option also moves invisible dotfiles. Should it? Might be issue for some files like: - .dropbox - .DS_Store - .gitignore - .htaccess - .picasa.ini - ... and more For me, created issue with Syncthing - after .stfolder file was moved, it stopped syncing the folder: tanel@~/Downloads/test$ tree -a . ├── .stfolder ├── image1.jpg ├── text1.txt └── text2.txt tanel@~/Downloads/test$ classifier -dt Scanning Files Done! tanel@~/Downloads/test$ tree -a . └── 02-02-2016 ├── .stfolder ├── image1.jpg ├── text1.txt └── text2.txt 1 directory, 4 files Please ignore if it's not a big issue ;)
1 parent 4a39338 commit 337ade4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

classifier/classifier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def classify_by_date(date_format, output_dir):
4747
print("Scanning Files")
4848

4949
directory = os.getcwd()
50-
files = os.listdir(directory)
50+
files = [x for x in os.listdir(directory) if not x.startswith('.')]
5151
creation_dates = map(lambda x: (x, arrow.get(os.path.getctime(x))), files)
5252

5353
for file, creation_date in creation_dates:

0 commit comments

Comments
 (0)