Commit
…ecific directory
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
else: | ||
for subdir, dirs, files in os.walk (currentDirectory): | ||
for file in files: | ||
if os.path.isfile (file): | ||
if os.path.isfile (os.path.join (currentDirectory, file)): | ||
# If file is THIS file, skip | ||
if os.path.basename (__file__) != file: | ||
# Ignore hidden files | ||
|
@@ -22,7 +22,7 @@ | |
# Check to make sure file has an exension (if not, its an empty string) | ||
if (len (extension) <= 0): | ||
extension = "MISC" | ||
if not os.path.exists (extension): | ||
os.mkdir (extension) | ||
if not os.path.exists (os.path.join (currentDirectory, extension)): | ||
os.mkdir (os.path.join (currentDirectory, extension)) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
JosephTLyons
Author
Owner
|
||
os.rename (os.path.join (currentDirectory, file), | ||
os.path.join (currentDirectory, extension, file)) | ||
This comment has been minimized.
Sorry, something went wrong.
codeguru42
|
Avoid a function call by assigning intermediate result to a variable: