From b616960c72edbe79ced4a2263eb755c58e04c4ef Mon Sep 17 00:00:00 2001 From: CodeByMrFinchum Date: Fri, 31 Jan 2025 17:29:26 +0100 Subject: [PATCH] Removed example until package is stable --- README.md | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/README.md b/README.md index 91f7b25..c3f04c1 100644 --- a/README.md +++ b/README.md @@ -16,37 +16,4 @@ pip install PyPiUpdater ``` ## Usage example -**NOTE:** Example only work for client application, GUI apps such as OptimaLab35 with QT need also to close the window and should not use the restart function. - -**Now the example by ChatGPT:** - -Here's a short example code snippet for your `PyPiUpdater` package to include in your README: - -```python -# Example usage of PyPiUpdater - -from PyPiUpdater import PyPiUpdater - -# Initialize the updater with the package name, current version, and log file path -updater = PyPiUpdater(package_name="OptimaLab35", local_version="0.7.0", log_path="update_log.txt") - -# Check if an update is available (optionally forcing the check, otherwise only checked every 20 hours(default set with update_interval_seconds = int seconds)) -is_newer, latest_version = updater.check_for_update(force=False) - -if is_newer: - print(f"Update available! Latest version: {latest_version}") - # Update the package using pip - success, message = updater.update_package() - print(message) - if success: - # Restart the program after update - updater.restart_program() -else: - print("No update available or checked too recently.") -``` - -### Explanation: -- The example shows how to initialize the `PyPiUpdater` class with the package name, current version, and the path to a log file. -- It checks for an update by calling `check_for_update()`. -- If an update is available, it proceeds with updating the package using `update_package()` and restarts the program with `restart_program()`. -- If no update is available, or it was checked too recently, it prints an appropriate message. +Example has been removed, still very active development.