Ejemplo n.º 1
0
Archivo: bmm0.2.py Proyecto: brada1/bmm
def main():
    instr = ''
    while instr != 'exit':

        db = Database.build() 
        instr = input("\ntype mod ID (e.g. '3') or 'exit'\n")
        try:
            if instr != 'exit':
                inp = int(instr)
                dbq = db[inp]
                print ("choose instruction (e.g. '1')")
                if 'installed' in dbq:
                    inp2 = int(input("'0' - uninstall\n'1' - cancel\n"))
                    if inp2 == 0:
                        Installer.uninstall(dbq)
                    elif inp2 == 1:
                        pass
                elif 'downloaded' in dbq:
                    inp2 = int(input("'0' - install\n'1' - remove\n'2' - cancel\n"))
                    if inp2 == 0:
                        Installer.install(dbq)
                    elif inp2 == 1:
                        Downloader.rm(dbq)
                    elif inp2 == 2:
                        pass
                else:
                    inp2 = int(input("'0' - download\n'1' - cancel\n"))
                    if inp2 == 0:                
                        Downloader.dl(dbq)
                    elif inp2 == 1:
                        pass
            elif instr == 'exit':
                print ('exiting...')
                break
        except ValueError:
            print ('valid ID please')
            continue
Ejemplo n.º 2
0
    def OnApply(self, event):
        self.log.AppendText("please wait...\n")
        for i in range(len(db[0])):
            if self.list.IsChecked(i):
                if len(db[0][i]) == 6:
                    pass
                else:
                    if len(db[0][i]) == 5:
                        pass
                    else:
                        self.log.AppendText("downloading " + str(db[0][i]) + "...\n")
                        try:
                            Downloader.dl(db[0][i])
                        except:
                            self.log.AppendText("failed\n")

                    self.log.AppendText("installing " + str(db[0][i]) + "...\n")
                    try:
                        Installer.install(db[0][i])
                    except:
                        self.log.AppendText("failed\n")

            else:
                if len(db[0][i]) == 6:
                    self.log.AppendText("uninstalling " + str(db[0][i]) + "...\n")
                    try:
                        Installer.uninstall(db[0][i])
                    except:
                        self.log.AppendText("failed\n")

        self.log.AppendText("refreshing database...\n")

        global db
        db = Database.build()

        self.log.AppendText("all done\n")
Ejemplo n.º 3
0
        # Initialize objects
        ac = ArpController()
        if ufw_handled:
            ufwctrl = Ufw()

    # If '--install'
    if args.install:
        # Install scutum into system
        installer.install()

    # If '--uninstall'
    elif args.uninstall:
        # Removes scutum completely from the system
        # Note that the configuration file will be removed too
        if Avalon.ask('Removal confirmation: ', False):
            installer.uninstall()
        else:
            Avalon.warning('Removal canceled')

    # If '--reset'
    elif args.reset:
        # resets the arptable, ufw and accept all incoming connections
        # This will expose the computer entirely on the network
        ac.flush_all()
        if ufw_handled is True:
            ufwctrl.disable()
        Avalon.info('RESETED')

    # If '--enable'
    elif args.enable:
        # Enable scutum will write scrips for wicd and network-manager