예제 #1
0
def edAcc(edAcc):
    if edAcc == "":
        import accMgr
        accMgr.close_window(root)
        tkMessageBox.showinfo(title="Error 006",
                              message="You have no accounts!")
        accMgr.vp_start_gui()
    import accMgr
    accMgr.close_window(root)
    os.remove("accounts/" + edAcc)
    os.remove("keys/" + edAcc)
    import account
    account.vp_start_gui()
    sys.stdout.flush()
예제 #2
0
def addAcc():
    import account
    import accMgr
    accMgr.close_window(root)
    account.vp_start_gui()
    sys.stdout.flush()
예제 #3
0
def autoAccount():
    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')
            aid = cmaFile['lastAccountId']
            print 'AID: ' + aid
        else:
            print "No Account Found!"
            tkMessageBox.showinfo(
                title='FAIL', message='Count not find account automatically.')
            import account
            account.vp_start_gui()

    if sys.platform.__contains__('linux'):
        home = expanduser('~')
        configParser = ConfigParser.RawConfigParser()
        configFilePath = home + '/.config/codestation/qcma.conf'
        configParser.read(configFilePath)
        if configParser.has_option("General", 'lastAccountId'):
            aid = configParser.get('General', 'lastAccountId')
            print 'AID: ' + aid
        else:
            print "No Account Found!"
            tkMessageBox.showinfo(
                title='FAIL', message='Count not find account automatically.')
            import account
            account.vp_start_gui()

    if sys.platform.__contains__(
            'win') and not sys.platform.__contains__("darwin"):
        import _winreg
        try:
            qcma = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER,
                                   'Software\\codestation\\qcma')
            aid = _winreg.QueryValueEx(qcma, 'lastAccountId')
        except:
            print "No Account Found!"
            tkMessageBox.showinfo(
                title='FAIL', message='Count not find account automatically.')
            import account
            account.vp_start_gui()
        aid = aid[0]
        print 'AID: ' + aid
        _winreg.CloseKey(qcma)
    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')
            acc = cmaFile['lastAccountId']
            print 'Account Name: ' + acc
        else:
            print "No Account Found!"
            tkMessageBox.showinfo(
                title='FAIL', message='Count not find account automatically.')
            import account
            account.vp_start_gui()
    if sys.platform.__contains__('linux'):
        home = expanduser('~')
        configParser = ConfigParser.RawConfigParser()
        configFilePath = home + '/.config/codestation/qcma.conf'
        configParser.read(configFilePath)
        if configParser.has_option("General", 'lastOnlineId'):
            acc = configParser.get('General', 'lastOnlineId')
            print 'Account Name: ' + acc
        else:
            print "No Account Found!"
            tkMessageBox.showinfo(
                title='FAIL', message='Count not find account automatically.')
            import account
            account.vp_start_gui()
    if sys.platform.__contains__(
            'win') and not sys.platform.__contains__("darwin"):
        import _winreg
        qcma = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER,
                               'Software\\codestation\\qcma')
        try:
            acc = _winreg.QueryValueEx(qcma, 'lastOnlineId')
            acc = acc[0]
        except:
            print "No Account Found!"
            tkMessageBox.showinfo(
                title='FAIL', message='Count not find account automatically.')
            import account
            account.vp_start_gui()
        print 'Account Name: ' + acc
        _winreg.CloseKey(qcma)
    import urllib
    print 'Downloading Key From: ' + 'http://cma.henkaku.xyz/?aid=' + aid
    urllib.urlretrieve('http://cma.henkaku.xyz/?aid=' + aid, 'tempKey.html')
    key = getKey()
    print 'CMA Key: ' + key
    text_file = open(getWorkingDir() + '/keys/' + acc, 'w+')
    text_file.write(key)
    text_file.close()
    text_file = open(getWorkingDir() + '/accounts/' + acc, 'w+')
    text_file.write(aid)
    text_file.close()
예제 #4
0
def autoAccount():
    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')
            aid = cmaFile['lastAccountId']
            print 'AID: ' + aid
        else:
            print "No Account Found!"
            showMessage(title='FAIL',
                        message='Count not find account automatically.')
            import account
            account.vp_start_gui()

    if sys.platform.__contains__('linux'):
        home = expanduser('~')
        configParser = ConfigParser.RawConfigParser()
        configFilePath = home + '/.config/codestation/qcma.conf'
        configParser.read(configFilePath)
        if configParser.has_option("General", 'lastAccountId'):
            aid = configParser.get('General', 'lastAccountId')
            print 'AID: ' + aid
        else:
            print "No Account Found!"
            showMessage(title='FAIL',
                        message='Count not find account automatically.')
            import account
            account.vp_start_gui()

    if sys.platform.__contains__(
            'win') and not sys.platform.__contains__("darwin"):
        import _winreg
        try:
            qcma = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER,
                                   'Software\\codestation\\qcma')
            aid = _winreg.QueryValueEx(qcma, 'lastAccountId')
        except:
            print "No Account Found!"
            showMessage(title='FAIL',
                        message='Count not find account automatically.')
            import account
            account.vp_start_gui()
        aid = aid[0]
        print 'AID: ' + aid
        _winreg.CloseKey(qcma)
    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')
            acc = cmaFile['lastAccountId']
            print 'Account Name: ' + acc
        else:
            print "No Account Found!"
            showMessage(title='FAIL',
                        message='Count not find account automatically.')
            import account
            account.vp_start_gui()
    if sys.platform.__contains__('linux'):
        home = expanduser('~')
        configParser = ConfigParser.RawConfigParser()
        configFilePath = home + '/.config/codestation/qcma.conf'
        configParser.read(configFilePath)
        if configParser.has_option("General", 'lastOnlineId'):
            acc = configParser.get('General', 'lastOnlineId')
            print 'Account Name: ' + acc
        else:
            print "No Account Found!"
            showMessage(title='FAIL',
                        message='Count not find account automatically.')
            import account
            account.vp_start_gui()
    if sys.platform.__contains__(
            'win') and not sys.platform.__contains__("darwin"):
        import _winreg
        qcma = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER,
                               'Software\\codestation\\qcma')
        try:
            acc = _winreg.QueryValueEx(qcma, 'lastOnlineId')
            acc = acc[0]
        except:
            print "No Account Found!"
            showMessage(title='FAIL',
                        message='Count not find account automatically.')
            import account
            account.vp_start_gui()
        print 'Account Name: ' + acc
        _winreg.CloseKey(qcma)
    import urllib
    try:
        print 'Downloading Key From: ' + 'http://cma.henkaku.xyz/?aid=' + aid
        urllib.urlretrieve('http://cma.henkaku.xyz/?aid=' + aid,
                           'tempKey.html')
    except:
        print "Failed to connect to: " + 'http://cma.henkaku.xyz/?aid=' + aid
        print "Trying henkaku.me.."
        try:
            print 'Downloading Key From: ' + 'http://cma.henkaku.me/?aid=' + aid
            urllib.urlretrieve('http://cma.henkaku.me/?aid=' + aid,
                               'tempKey.html')
        except:
            print "Failed to connect to: " + 'http://cma.henkaku.me/?aid=' + aid
            print "Could Not Connect, Cannot find CMA Key!"
            window = Tkinter.Tk()
            window.wm_withdraw()
            tkMessageBox.showerror(
                title="Connection Error.",
                message=
                "Failed to connect to: \nhttp://cma.henkaku.xyz\nThus your CMA Key could not be determined,\nPSVIMGTOOLS will not work without your CMA Key, \nPlease check your connection and try again."
            )
            window.destroy()
            sys.exit()

    key = getKey()
    print 'CMA Key: ' + key
    text_file = open(getWorkingDir() + '/keys/' + acc, 'w+')
    text_file.write(key)
    text_file.close()
    text_file = open(getWorkingDir() + '/accounts/' + acc, 'w+')
    text_file.write(aid)
    text_file.close()
예제 #5
0
    sys.stdout.flush()


def question():
    defs.showMessage(
        title="CMA Key",
        message=
        "Your AID is the name of the random numbers and letters folder your CMA backups are stored in."
    )
    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 account

    account.vp_start_gui()