Как сделать автоматическое обновление с помощью esky сервера git - PullRequest
0 голосов
/ 06 апреля 2020
    class AutoUpdate:
        def __init__(self):
            print("")
        def message_box(self):
            reply = messagebox.askquestion('Update', "New update available! Do you want to update?", 
        icon='warning')
            if reply == 'yes':
                return True   
    print("Start to update")


    if getattr(sys, "frozen"):  
        app = esky.Esky(sys.executable, "https://github.com/janani-suresh-97/AutoUpdate.git")
        print(app.name)
        a = AutoUpdate()
        print("Finding ")
        if app.find_update():
            print("Version found....")
            if a.message_box():
               print(app.find_update())
               app.auto_update()
               print("Unistalled version--3")
            else:
                print("No new updates found")
    print("HELLO WORLD--Stage 2")

My setup.py

    setup(
        name="MyAutobuildapp",
        version='1.0.02',
        options={
            'bdist_esky': {
                'freezer_module': 'cx_freeze',
            }
        },   
        scripts=[
            Executable_Esky(
                "AutoUpdate.py"
            ),
        ],
        executables=[Executable('AutoUpdate.py')]
    )

При использовании сервера git Iam может обнаружить новую версию, но разархивирование не происходит, и Iam получает эту ошибку.

    File "C:\Python34\lib\site-packages\esky\util.py", line 339, in deep_extract_zipfile 
    prefix = zipfile_common_prefix_dir(source)
    File "C:\Python34\lib\site-packages\esky\util.py", line 321, in zipfile_common_prefix_dir
    zf = zipfile.ZipFile(source)
    File "C:\Python34\lib\zipfile.py", line 937, in __init__
    self._RealGetContents()
    File "C:\Python34\lib\zipfile.py", line 978, in _RealGetContents
    raise BadZipFile("File is not a zip file")
    zipfile.BadZipFile: File is not a zip file

Я понял, что распаковка не происходит. Кто-нибудь может подсказать, как справиться с esky с git сервером?

...