Skip to content

combining the functionality of previous 2 projects in an interactive popup

Notifications You must be signed in to change notification settings

jefnilham/sizer-and-merger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 

Repository files navigation

sizer-and-merger

Combining the functionality of previous 2 projects in an interactive popup.

First is a pdf merger whereby users can choose a folder and all the pdfs within it will be appended according to the listing as listed in the file explorer. Second is a file sizer that enumerates recursively the folder chosen to list out all files in descending order of file size, to help with file management/deletion. I have a pre-made folder named 'C:\walktest' for demonstration purposes. The folder hierarchy is as follows:

image

Table of contents

  1. Running the script
  2. Pdf Merger
  3. File Sizer
  4. Issues

Running the script

The popup appears for the user to choose the next action: merging pdf files or getting file sizes of all files in a path

image

Pdf Merger

If the user clicks on pdf merger, the next popup will show:

image

THe user can then click on browse to open a file explorer and choose a folder with contents of pdf files to merge:

image

The user will then name the output pdf merged file:

image

The user will confirm the chosen folder with displayed pdf contents:

image

Upon successful merger, a popup will notify the user:

image

File Sizer

If the user clicks on the file sizer, the another popup will appear to prompt the user on what folder to enumerate:

image

When the user clicks on browse, the file explorer opens for the user to choose the desired folder:

image

The user then names his desired output file. The output is a text file in a report format with headers of file size in KB followed by full filepath. This report is arranged in descending order of file size, largest file being at the top. I desinged it this way so that I can easily see what files are taking up the most space and if they are up for deletion.

image

Upon successful report creation, a popup will notify the user accordingly:

image

The file output is as follows, and is correctly created. We can also see that our previously created 'merger_demo.pdf' has also been accounted for:

image

Added new 'tree command with size.py'

-More similar to replicating the 'tree /f' windows command

-Added file sizes alongside so can view

image -Issue: Don't think can sort by file size since os.walk sets up a tuple with strings and lists. Hmm. Thinking

Issues pending to fix

Seems like this cannot successfully enumerate the whole C drive. And even if it manages to, the txt file is very large and will freeze the pc. hmm. should be due to enumerating over too many files and failing. However python error output suggests that its just due to formatting error from not setting utf-8 format. hmm.

About

combining the functionality of previous 2 projects in an interactive popup

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages