Skip to main content

A Python package for automatic updating tools.

Project description

update_founder

PYPI PROJECT A Python package to automatically find software updates of your repositories in GitHub

Discord Instagram YouTube

Updated Badge Python

how does it work:

Step 1: Go to your desired repository and create a file named version (don't give it a .txt extension) And write your code in that version.

write your code in that version.

Step 2: Right click on the raw option and copy the link

Right click on the raw option and copy the link

Step 3:


Usage example:

import found_update #import pack
import os
import git
import shutil
import time

cwd = os.getcwd()
print(cwd)

AutoUpdate.set_url("https://raw.githubusercontent.com/Pytholearn/HAZARD-CHAMELEONS/main/version") # Raw Code
download_link = "https://github.com/Pytholearn/HAZARD-CHAMELEONS.git" #Git Download Link
AutoUpdate.set_current_version("1.1.2")

if not AutoUpdate.is_up_to_date():
    print("New UPDATE!")

    print("Would you like to update your tool?")
    choice = input("If you like(Y) or you dont want to update (N)[>>>] ")
    if choice == "Y" or choice == "y":
    
        
        local_repo_path = os.path.join(cwd, "temp_repo")
        if not os.path.exists(local_repo_path):
            os.makedirs(local_repo_path)
        git.Repo.clone_from(download_link, local_repo_path)
        
        
        for root, dirs, files in os.walk(local_repo_path):
            relative_path = os.path.relpath(root, local_repo_path)
            for file in files:
                source_file_path = os.path.join(root, file)
                dest_file_path = os.path.join(cwd, relative_path, file)
                if os.path.exists(dest_file_path):
                    os.remove(dest_file_path)  
                shutil.move(source_file_path, dest_file_path)  
            for dir in dirs:
                source_dir_path = os.path.join(root, dir)
                dest_dir_path = os.path.join(cwd, relative_path, dir)
                if not os.path.exists(dest_dir_path):
                    shutil.move(source_dir_path, dest_dir_path) 
        
        
        shutil.rmtree(local_repo_path)
        print("Update Complete!")
        time.sleep(2)
    elif choice == "n" or choice == "N":
        pass
else:
    print("Update Not Found!")
    time.sleep(2)

FAQ

For Help: https://discord.gg/qD8SXrRJbw

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

found_update-1.5.8.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

found_update-1.5.8-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page