working help, and checking existing files
This commit is contained in:
1
bin/folderflat
Symbolic link
1
bin/folderflat
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
FolderFlat
|
||||||
1
bin/foldersplit
Symbolic link
1
bin/foldersplit
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
FolderSplit
|
||||||
@@ -64,7 +64,7 @@ def setup_options():
|
|||||||
action="store",
|
action="store",
|
||||||
dest="datefmt",
|
dest="datefmt",
|
||||||
default=None,
|
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(
|
parser.add_argument(
|
||||||
"-n",
|
"-n",
|
||||||
@@ -91,7 +91,7 @@ def setup_options():
|
|||||||
action="store",
|
action="store",
|
||||||
default=".",
|
default=".",
|
||||||
nargs="?",
|
nargs="?",
|
||||||
help="Folder to split.",
|
help="Folder to split. Defaults to current folder.",
|
||||||
)
|
)
|
||||||
options = parser.parse_args()
|
options = parser.parse_args()
|
||||||
if options.regexp != "":
|
if options.regexp != "":
|
||||||
@@ -144,6 +144,9 @@ def linktree(src, dst):
|
|||||||
|
|
||||||
def copyfileorfolder(basename, source, target, move):
|
def copyfileorfolder(basename, source, target, move):
|
||||||
"""Copies a file or folder structure under target folder"""
|
"""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:
|
if move:
|
||||||
shutil.move(os.path.join(source, basename), os.path.join(target, basename))
|
shutil.move(os.path.join(source, basename), os.path.join(target, basename))
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user