From 17cb614f24e8be78f5dce52dea07a1671b02cf07 Mon Sep 17 00:00:00 2001 From: q Date: Sat, 10 Aug 2024 17:18:07 +0300 Subject: [PATCH] working help, and checking existing files --- bin/folderflat | 1 + bin/foldersplit | 1 + files/FolderSplit.py | 7 +++++-- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 120000 bin/folderflat create mode 120000 bin/foldersplit diff --git a/bin/folderflat b/bin/folderflat new file mode 120000 index 0000000..0607b09 --- /dev/null +++ b/bin/folderflat @@ -0,0 +1 @@ +FolderFlat \ No newline at end of file diff --git a/bin/foldersplit b/bin/foldersplit new file mode 120000 index 0000000..3b15aa9 --- /dev/null +++ b/bin/foldersplit @@ -0,0 +1 @@ +FolderSplit \ No newline at end of file diff --git a/files/FolderSplit.py b/files/FolderSplit.py index 07b9f75..897414a 100755 --- a/files/FolderSplit.py +++ b/files/FolderSplit.py @@ -64,7 +64,7 @@ def setup_options(): action="store", dest="datefmt", default=None, - help="Date format for 'date' split. Defaults to %Y-%m-%d", + help="Date format for 'date' split. Defaults to %%Y-%%m-%%d", ) parser.add_argument( "-n", @@ -91,7 +91,7 @@ def setup_options(): action="store", default=".", nargs="?", - help="Folder to split.", + help="Folder to split. Defaults to current folder.", ) options = parser.parse_args() if options.regexp != "": @@ -144,6 +144,9 @@ def linktree(src, dst): def copyfileorfolder(basename, source, target, move): """Copies a file or folder structure under target folder""" + if os.path.exists(os.path.join(target, basename)): + print("FileExists!: " + os.path.join(target, basename)) + return if move: shutil.move(os.path.join(source, basename), os.path.join(target, basename)) return