AutoUpdater
English | 简体中文
Feedback QQ Group (Click to join): 323397913
1. AutoUpdater Class Documentation
Overview
AutoUpdater is a Python-based automatic update tool used to compare MD5 values of local and remote files and download updated files. It supports initializing local directories, generating MD5 file lists, updating files, and more.
Installation
Clone the repository to your local machine:
git clone https://github.com/www778878net/AutoUpdater.git
cd AutoUpdater
Quick Start
Here's a basic example of how to use AutoUpdater:
from autoupdater import AutoUpdater, initialize_directory
# Initialize local directory
local_dir = "/path/to/local/directory"
remote_url = "http://example.com/remote/"
result = initialize_directory(local_dir, remote_url)
print(result)
# Create AutoUpdater instance and update files
updater = AutoUpdater(local_dir, remote_url)
update_result = updater.update_files()
print(update_result)
Main Methods
initialize_directory(local_directory, remote_base_url): Initialize local directory.update_files(): Update local files.get_file_list_with_md5(directory): Get MD5 values for all files in the specified directory.save_md5_json(output_file="md5.json"): Generate and save a JSON file containing file MD5 values.
Example: Initializing Directory
from autoupdater import initialize_directory
local_dir = "/path/to/local/directory"
remote_url = "http://example.com/remote/"
result = initialize_directory(local_dir, remote_url)
print(result)
Example: Updating Files
from autoupdater import AutoUpdater
updater = AutoUpdater("/path/to/local/directory", "http://example.com/remote/")
result = updater.update_files()
print(result)
Running Tests
To run tests, execute the following command in the project root directory:
python -m unittest discover tests
Other
For more detailed information, please refer to the project's GitHub repository or API documentation.
Metadata
Release files for autoupdater78 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| autoupdater78-0.1.0.tar.gz | 7.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autoupdater78-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.9 kB
Release files / autoupdater78-0.1.0.tar.gz
| Download URL | autoupdater78-0.1.0.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
503851141145047b00c76750277aee4bdaac897a35c165dd648074bbb2e596cf
|
|
BLAKE2b-256 checksum How to use checksums |
7df53370c1ce97b25e9b925f3678d43c8ea36da445c1bd2ec320ba652352b5f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.10.6 Windows/10
|
Release files / autoupdater78-0.1.0-py3-none-any.whl
| Download URL | autoupdater78-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f9495b1dcf8a6302d91b6c776caf02003330d24ef63d421c4bf3185626105ec1
|
|
BLAKE2b-256 checksum How to use checksums |
043f5003a23ebf8b71d556056e83f82b5971be5fe4da7ce0518209534637b5ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.10.6 Windows/10
|