コード例 #1
0
ファイル: rlab_utils.py プロジェクト: doggo404/RLabClone
def installQBittorrent():
    if checkAvailable("/usr/bin/qbittorrent-nox"):
        return
    else:
        try:
            runSh("add-apt-repository ppa:qbittorrent-team/qbittorrent-stable -y")
            runSh("apt-get install qbittorrent-nox -qq -y")
        except:
            print("Error installing qBittorrent.")
            exx()
コード例 #2
0
ファイル: ttmg.py プロジェクト: vietrap91/remote
def accessSettingFile(file="", setting={}):
    from json import load, dump

    if not isinstance(setting, dict):
        print("Only accept Dictionary object.")
        exx()
    fullPath = f"/usr/local/sessionSettings/{file}"
    try:
        if not len(setting):
            if not checkAvailable(fullPath):
                print(f"File unavailable: {fullPath}.")
                exx()
            with open(fullPath) as jsonObj:
                return load(jsonObj)
        else:
            with open(fullPath, "w+") as outfile:
                dump(setting, outfile)
    except:
        print(f"Error accessing the file: {fullPath}.")
コード例 #3
0
 def __bind_menu_exit(self, event): #метод, который уничтожает окно меню (срабатывает при нажатии клавиши ESCAPE) 
         self.__master.destroy()
         exx()