The Version File Hash Generator is a Python-based desktop application designed to generate SHA-1 hashes for files within a specified directory and its subdirectories. The tool outputs these hashes into a text file, optionally appending a version string.
Python 3.6+: Ensure Python is installed on your system. Download it from python.org.
Required Libraries:
PyInstaller (to compile):
pip install pyinstallerNo additional external libraries are required beyond the standard library (os, sys, hashlib, threading, queue).
For further assistance, refer to the PyInstaller documentation or open an issue in this repository.
-
Clone or Download the Repository:
Run the following command:git clone https://github.com/ATphonOS/VFHG.git cd VFHGAlternatively, download the ZIP file and extract it.
-
Verify Dependencies:
Ensuretkinteris available by running:python -c "import tkinter"
For further assistance, refer to the PyInstaller documentation or open an issue in this repository.
Since this is a Python script, no traditional compilation is required. However, it depends on Python and specific libraries. Follow these steps to prepare and run the program:
This option bundles the application into a single .exe file, making it easy to distribute.
Command:
pyinstaller --onefile --windowed --icon=icon/logo_app.ico --add-data "icon/logo_app.png;icon" --name "ATphonOS Version File Hash Generator" VFHG.py--onefile: Packages everything into a single executable.--windowed: Runs the GUI without a console window.--icon=icon/logo_app.png: Sets the application icon.--add-data "icon/logo_app.png;icon": Includes the icon file in the bundle.--name "ATphonOS Version File Hash Generator": Names the output fileVersion File Hash Generator.exe.VFHG.py: The source script to compile.
Output: A singleATphonOS Version File Hash Generator.exefile will be created in thedist/directory.
This option creates a folder containing the executable and all required dependencies, useful for debugging or when dependencies need to be modified.
Command:
pyinstaller --onedir --windowed --icon=icon/logo_app.ico --add-data "icon/logo_app.png;icon" --name "ATphonOS Version File Hash Generator" VFHG.py--onedir: Creates a directory with the executable and dependencies.- Other flags are identical to Option 1 (see descriptions above).
Output: AATphonOS Version File Hash Generatorfolder will be created in thedist/directory, containingATphonOS Version File Hash Generator.exeand supporting files.
Execute the script directly with Python or run the exe file:
python VFHG.pyThe application provides a simple GUI to generate hash files. Here’s how to use it:
-
Launch the Application:
Run the script as described above. -
Select a Directory:
Click the "Browse" button next to "Directory Path". Choose a directory containing the files to hash. The progress bar will immediately display "Progress: 0/N files", where N is the total number of files in the directory and its subdirectories. -
Configure Options:
- Version Name: Enter a version string in the "Version name" field. This will be appended to the hash file. Leave blank and check "Only Hash" if no version is desired.
- Only Hash: Check this box to disable the version field and use a default "--NO VERSION--" string.
- Custom Filename: Check this box to specify a custom output filename. If unchecked, the default is "file_hashes.txt".
-
Generate the Hash File:
Click "Generate Hash File". The log window will display progress messages (e.g., "Found N files to process", "Progress: X/N files processed - filename: hash"). The progress bar will update in real-time, filling as files are processed. Upon completion, a success message appears, and a clickable link ("Click here to open {filename}") is added to the log. -
View the Output:
Click the link in the log to open the generated hash file in your default text editor. The file contains relative file paths and their 16-character SHA-1 hashes, with the version string (if specified) on the last line.
The log window does not have a scrollbar; use the mouse wheel or arrow keys to navigate if the content exceeds the visible area. The program runs hashing in a separate thread to keep the GUI responsive, especially for large directories (1000+ files). Errors (e.g., invalid directory, file access issues) are logged and shown in a dialog box.
This document outlines how to generate and access the documentation for the VFHG.py script using Pydoc and wget. The generated documentation is stored in the docs/ directory of this repository and is currently supported only on Windows.
The documentation is generated using Python’s built-in pydoc module, which creates HTML files for the script and its imported standard library modules. These files are included in the docs/ directory. To view the documentation, you must run a Pydoc server and access the HTML files locally. To regenerate the documentation, you’ll use wget with a provided modules.txt file to download the HTML files from the Pydoc server.
Python 3.6+: Required to run the script and Pydoc. Download from python.org.
wget for Windows: Version 1.21.4 (x64) is included in this repository in the root directory (wget.exe). If missing, download it from GNU Wget and place it in the same directory as VFHG.py.
Project Files: Ensure you have VFHG.py (the main script) and modules.txt (list of module URLs, located in the root directory).
The pre-generated documentation is included in the docs/ directory. To view it:
-
Start the Pydoc Server:
Open a terminal (CMD) in the repository’s root directory (whereVFHG.pyis located) and run:python -m pydoc -p 8000
This starts a local server on port 8000, serving documentation for all Python modules in the current directory.
-
Access the Documentation:
While the server is running, open a web browser or file explorer. Navigate to thedocs/directory in the repository (e.g.,file:///<path-to-repo>/docs/). Openindex.htmlor any module-specific file. The links (index, module index, keywords, topics) will work as long as the Pydoc server is active onhttp://localhost:8000.
To regenerate the documentation (e.g., after modifying the script), follow these steps:
-
Start the Pydoc Server:
In a terminal (CMD) in the repository’s root directory, run:python -m pydoc -p 8000
Keep this terminal open and the server running.
-
Download Documentation with
wget:
Open a new terminal (CMD) in the same directory. Ensurewget.exe(version 1.21.4 x64) is in the root directory alongsideVFHG.py. Run the following command:wget -i modules.txt -P docs -p -k
-i modules.txt: Reads URLs frommodules.txt(e.g.,http://localhost:8000/os.html), which lists the modules used in the script.-P docs: Saves the downloaded HTML files to thedocs/directory. If it doesn’t exist,wgetwill create it.-p: Downloads additional resources (e.g., CSS) needed for the HTML pages.-k: Converts links in the HTML files to work locally without the server.
-
Verify Output:
-
After running the command, check the
docs/directory for updated HTML files. Stop the Pydoc server (Ctrl+C in the first terminal) once the download is complete.
The modules.txt file (included in the repository) contains URLs pointing to the Pydoc server for each module used in the script:
http://localhost:8000/os.html, http://localhost:8000/sys.html, http://localhost:8000/hashlib.html, http://localhost:8000/tkinter.html, http://localhost:8000/tkinter.ttk.html, http://localhost:8000/tkinter.messagebox.html, http://localhost:8000/tkinter.filedialog.html, http://localhost:8000/tkinter.simpledialog.html, http://localhost:8000/threading.html, http://localhost:8000/queue.html.
These correspond to the imports in VFHG.py.
Windows-Only: This documentation process relies on wget.exe for Windows and the os.startfile function in the script, making it Windows-specific. For cross-platform support, additional modifications would be needed.
Server Requirement: The Pydoc server must be running to access live links in the HTML files. For offline use, ensure all files are downloaded with wget and use the converted local links.
File Paths: Run all commands from the repository’s root directory to ensure correct relative paths.
Missing wget: If wget.exe is not found, download it and place it in the root directory, or adjust the command to point to its location. Download wget.
Empty docs/ Directory: Ensure the Pydoc server is running and modules.txt contains valid URLs before running wget.
404 Errors: Verify you’re in the correct directory when starting the Pydoc server, as it serves modules from the current working directory.
For further assistance, refer to the Pydoc documentation or Wget manual, or open an issue in this repository.


