Пример #1
0
def cmaDir():
    import cmaDir
    cmaDir.vp_start_gui()
    sys.stdout.flush()
Пример #2
0
def autoCMA():
    if sys.platform.__contains__('darwin'):
        home = expanduser('~')
        if os.path.exists(home +
                          '/Library/Preferences/com.codestation.qcma.plist'):
            cmaFile = bplistlib.readPlist(
                home + '/Library/Preferences/com.codestation.qcma.plist')
            text_file = open('cmadir.txt', 'w+')
            text_file.write(cmaFile['appsPath'])
            text_file.close()
            print 'CMA Dir: ' + cmaFile['appsPath']
        else:
            print "Cannot find CMADir..."
            showMessage(title="CMADIR",
                        message="Could not find the CMA Backups Directory.")
            import cmaDir
            cmaDir.vp_start_gui()
    if sys.platform.__contains__('linux'):
        home = expanduser('~')
        if os.path.exists(home + '/.config/codestation/qcma.conf'):
            configParser = ConfigParser.RawConfigParser()
            configFilePath = home + '/.config/codestation/qcma.conf'
            configParser.read(configFilePath)
            line = configParser.get('General', 'appsPath')
            text_file = open('cmadir.txt', 'w+')
            text_file.write(line)
            text_file.close()
            print 'CMA Dir: ' + line
        else:
            print "Cannot find CMADir..."
            showMessage(title="CMADIR",
                        message="Could not find the CMA Backups Directory.")
            import cmaDir
            cmaDir.vp_start_gui()

    if sys.platform.__contains__(
            'win') and not sys.platform.__contains__("darwin"):
        import _winreg
        try:
            global CMAFOLDER
            qcma = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER,
                                   'Software\\codestation\\qcma')
            path = _winreg.QueryValueEx(qcma, 'appsPath')
            CMAFOLDER = path[0]
            _winreg.CloseKey(qcma)
        except:
            print("QCMA Is Not Installed.")
            print "Checking Default Location " + getHomeDir(
            ) + "\Documents\PS Vita"
            if os.path.exists("Checking Default Location " + getHomeDir() +
                              "\Documents\PS Vita"):
                print "Directory Found! Setting As CMA APPS DIR "
                CMAFOLDER = getHomeDir() + "\My Documents\PS Vita"
            elif os.path.exists("Checking Default Location " + getHomeDir() +
                                "\My Documents\PS Vita"):
                print "Directory Found! Setting As CMA Apps DIR"
                CMAFOLDER = getHomeDir() + "\My Documents\PS Vita"
                print "Legacy OS Detected, Documents Folder Is Called 'My Documents' PSVIMGTOOLS may not work correctly!"
            else:
                print "Folder not found checking for SONY CMA..."
                try:
                    cma = _winreg.OpenKey(
                        _winreg.HKEY_CURRENT_USER,
                        'SOFTWARE\\Sony Corporation\\Content Manager Assistant\\Settings'
                    )
                    path = _winreg.QueryValueEx(cma, 'ApplicationHomePath')
                    CMAFOLDER = path[0]
                    _winreg.CloseKey(cma)
                    print "---------------------WARNING---------------------"
                    print "SONY CMA IS NOT FULLY SUPPORTED, \nAND IT ALSO REQUIRES THE LATEST FIRMWARE"
                    print "I HIGHLY RECOMMEND USING QCMA INSTEAD!"
                except:
                    print "Checking for DEVKITCMA"
                    try:
                        cma = _winreg.OpenKey(
                            _winreg.HKEY_CURRENT_USER,
                            'SOFTWARE\\SCE\\PSP2\\Services\\Content Manager Assistant for PlayStation(R)Vita DevKit\\Settings'
                        )
                        path = _winreg.QueryValueEx(cma, 'ApplicationHomePath')
                        CMAFOLDER = path[0]
                        _winreg.CloseKey(cma)
                        print "---------------------WARNING---------------------"
                        print "DEVKITCMA IS NOT FULLY SUPPORTED,"
                        print "I HIGHLY RECOMMEND USING QCMA INSTEAD!"
                    except:
                        print "Cannot find CMADir..."
                        showMessage(
                            title="CMADIR",
                            message="Could not find the CMA Backups Directory."
                        )
                        import cmaDir
                        cmaDir.vp_start_gui()

        print 'CMA Dir: ' + CMAFOLDER
        text_file = open(getWorkingDir() + '/cmadir.txt', 'w+')
        text_file.write(CMAFOLDER)
        text_file.close()
Пример #3
0
    cmaDir.close_window(root)
    sys.stdout.flush()


def browse():
    import cmaDir
    text_file = open("cmadir.txt", "w+")
    text_file.write(tkFileDialog.askdirectory(title="CMA Directory"))
    text_file.close()
    cmaDir.close_window(root)
    sys.stdout.flush()


def init(top, gui, *args, **kwargs):
    global w, top_level, root
    w = gui
    top_level = top
    root = top


def destroy_window():
    # Function which closes the window.
    global top_level
    top_level.destroy()
    top_level = None


if __name__ == '__main__':
    import cmaDir
    cmaDir.vp_start_gui()