pyinstaller更新程序与github / bitbucket私人回购

时间:2018-01-01 05:11:28

标签: python git ssh bitbucket paramiko

我试图将pyinstaller与私有仓库的更新功能集成在一起。我的问题是,有没有办法将pyupdater与免费替代品集成,例如:bitbucket私有回购? Pyupdater倾向于为公共回购工作,但我不能锻炼如何为私人回购制作这个。

配置文件:

class ClientConfig(object):
    PUBLIC_KEY = 'None'
    APP_NAME = 'dad123'
    COMPANY_NAME = 'dad123'
    UPDATE_URLS = ['ssh://git@bitbucket.org/Tysondogerz/ssh/download']
    MAX_DOWNLOAD_RETRIES = 3

创建一个ssh非常简单:

ssh-keygen -t rsa -C" youremail@example.com"

因此...

Main.py

#!/usr/bin/env python3
from __future__ import print_function
import time
import argparse
import os
import signal
import sys
import logging
from selenium import webdriver

logging.basicConfig(level=logging.DEBUG)

from client_config import ClientConfig
from pyupdater.client import Client, AppUpdate, LibUpdate

Ssh_key  = DWDJKWNADKJWANDJKWANDWJKDNAWJKDNWAKDNWAJDKWANDJKWANDWAJKDNWAKJDWNADKJWANDWAJKDNAWJKDNWAJKDNWAJKDWNADJKWANDJKWANDKJWADNWAJKDNWAJKNWQWQDWQNDJKQWNDJKWQNDWQJKDNWQJKDNWKJDNWKJANDWJKNDWJKNDWDUWDNWDHDUIWHDIUWHDUIWHDUIWHDIUWHDUIWHDWUDHWUIHDWUDHUhottyouremail@example.com

    client = Client(ClientConfig(), ssh={'ssh_key'})

    from pyupdater.client import Client
from client_config import ClientConfig


def print_status_info(info):
    total = info.get(u'total')
    downloaded = info.get(u'downloaded')
    status = info.get(u'status')
    print downloaded, total, status


client = Client(ClientConfig())
client.refresh()

client.add_progress_hook(print_status_info)


client = Client(ClientConfig(), refresh=True,
                        progress_hooks=[print_status_info])

lib_update = client.update_check(ASSET_NAME, ASSET_VERSION)

lib_update = client.update_check(ASSET_NAME, ASSET_VERSION, channel='beta')

if lib_update is not None:
    lib_update.download()
        driver = webdriver.Firefox()
        driver.get('http://stackoverflow.com')


if __name__ == "__main__":
    main()

1 个答案:

答案 0 :(得分:1)

无法通过SSH访问“下载”部分。您需要通过HTTPS使用其他形式的身份验证来检索这些文件。 (Application passwords可能是你最好的选择,因为它们可以非常具体地限定并在必要时丢弃。)