示例#1
0
    def __init__(self, top=None):
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''
        _bgcolor = '#d9d9d9'  # X11 color: 'gray85'
        _fgcolor = '#000000'  # X11 color: 'black'
        _compcolor = '#d9d9d9'  # X11 color: 'gray85'
        _ana1color = '#d9d9d9'  # X11 color: 'gray85'
        _ana2color = '#d9d9d9'  # X11 color: 'gray85'
        font10 = "-family {DejaVu Sans Mono} -size 12 -weight normal "  \
            "-slant roman -underline 0 -overstrike 0"
        self.style = ttk.Style()
        if sys.platform == "win32":
            self.style.theme_use('winnative')
        self.style.configure('.', background=_bgcolor)
        self.style.configure('.', foreground=_fgcolor)
        self.style.map('.',
                       background=[('selected', _compcolor),
                                   ('active', _ana2color)])

        top.geometry("750x500+218+86")
        top.title("Select Backup")
        top.configure(highlightcolor="black")

        cmadir = open('cmadir.txt', 'r')
        CMA = cmadir.read()
        a = 0
        self.Label1 = Label(top)
        self.Label1.place(relx=0.02, rely=0.02, height=18, width=96)
        self.Label1.configure(text='''Patch: ''')
        self.Label1.configure(width=96)

        self.backupList = ScrolledListBox(top)
        self.backupList.place(relx=0.01,
                              rely=0.06,
                              relheight=0.87,
                              relwidth=0.97)
        self.backupList.configure(background="white")
        self.backupList.configure(font=font10)
        self.backupList.configure(highlightcolor="#d9d9d9")
        self.backupList.configure(selectbackground="#c4c4c4")
        self.backupList.configure(width=10)
        print("Looking For Backups In: " + CMA + "/PGAME/" +
              defs.getAid(account))
        for root, dir, files in os.walk(CMA + "/PGAME/" +
                                        defs.getAid(account)):
            for items in fnmatch.filter(dir, "*"):
                a += 1
                if defs.isEncryptedApp(CMA + "/PGAME/" + defs.getAid(account) +
                                       "/" + items):
                    title = sfoParser.main(CMA + "/PGAME/" +
                                           defs.getAid(account) + "/" + items +
                                           "/sce_sys/param.sfo")
                    self.backupList.insert(a, title + " (" + items + ")")

        self.Button1 = Button(top)
        self.Button1.place(relx=0.83, rely=0.94, height=26, width=117)
        self.Button1.configure(activebackground="#d9d9d9")
        self.Button1.configure(command=lambda: patch(
            defs.getTitleID(self.backupList.get(ACTIVE))))
        self.Button1.configure(text='''Patch W VHBL''')
示例#2
0
    def __init__(self, top = None):
        """This class configures and populates the toplevel window.
        top is the toplevel containing window."""
        _bgcolor = '#d9d9d9'
        _fgcolor = '#000000'
        _compcolor = '#d9d9d9'
        _ana1color = '#d9d9d9'
        _ana2color = '#d9d9d9'
        font10 = '-family {DejaVu Sans Mono} -size 12 -weight normal -slant roman -underline 0 -overstrike 0'
        self.style = ttk.Style()
        if sys.platform == 'win32':
            self.style.theme_use('winnative')
        self.style.configure('.', background=_bgcolor)
        self.style.configure('.', foreground=_fgcolor)
        self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)])
        top.geometry('750x500+218+86')
        top.title('Unsign Backup')
        top.configure(highlightcolor='black')
        cmadir = open('cmadir.txt', 'r')
        CMA = cmadir.read()
        a = 0
        self.Label1 = Label(top)
        self.Label1.place(relx=0.02, rely=0.02, height=18, width=96)
        self.Label1.configure(text='What Backup?')
        self.Label1.configure(width=96)
        self.backupList = ScrolledListBox(top)
        self.backupList.place(relx=0.01, rely=0.06, relheight=0.87, relwidth=0.97)
        self.backupList.configure(background='white')
        self.backupList.configure(font=font10)
        self.backupList.configure(highlightcolor='#d9d9d9')
        self.backupList.configure(selectbackground='#c4c4c4')
        self.backupList.configure(width=10)
        print 'Looking For Backups In: ' + CMA + '/' + unsign_support.getLoad() + '/' + defs.getAid(unsign_support.getAccount())
        for root, dir, files in defs.walklevel(CMA + '/' + unsign_support.getLoad() + '/' + defs.getAid(unsign_support.getAccount()),0):
            for items in fnmatch.filter(dir, '*'):
                a += 1
                if defs.isEncryptedApp(CMA + '/' + unsign_support.getLoad() + '/' + defs.getAid(unsign_support.getAccount()) + '/' + items):
                    title = sfoParser.main(CMA + '/' + unsign_support.getLoad() + '/' + defs.getAid(unsign_support.getAccount()) + '/' + items + '/sce_sys/param.sfo')
                    if pfs.isKeyKnown(items):
                        self.backupList.insert(a, title + ' [PFS] (' + items + ')')
                    else:
                        self.backupList.insert(a, title + ' (' + items + ')')
                elif unsign_support.getLoad() == 'SYSTEM' and defs.isBackup(CMA + '/' + unsign_support.getLoad() + '/' + defs.getAid(unsign_support.getAccount()) + '/' + items + '/' + items):
                    self.backupList.insert(a, items)

        self.Button1 = Button(top)
        self.Button1.place(relx=0.83, rely=0.94, height=26, width=117)
        self.Button1.configure(activebackground='#d9d9d9')
        if unsign_support.getLoad() != "SYSTEM":
            self.Button1.configure(command=lambda: unsign_support.goUnsign(defs.getTitleID(self.backupList.get(ACTIVE)), CMA, False,unsign_support.getLoad(), unsign_support.getAccount()))
        else:
            self.Button1.configure(command=lambda: unsign_support.goUnsign(self.backupList.get(ACTIVE), CMA, False,unsign_support.getLoad(), unsign_support.getAccount()))
        self.Button1.configure(text='Unsign & Extract')
        if unsign_support.getResign() == False:
            self.Button2 = Button(top)
            self.Button2.place(relx=0.01, rely=0.94, height=26, width=120)
            self.Button2.configure(activebackground='#d9d9d9')
            self.Button2.configure(command=lambda: unsign_support.goUnsign(defs.getTitleID(self.backupList.get(ACTIVE)), CMA, True,unsign_support.getLoad(), unsign_support.getAccount()))
            self.Button2.configure(text='Create .cmbackup')