def __loaddb(self, dbpath): if not dbpath.endswith('.db'): dbpath = dbpath+'.db' if not os.path.exists(dbpath): raise RopperError('db does not exist: '+dbpath) dao = GadgetDAO(dbpath, self.__cprinter) self.binary.gadgets = dao.load(self.binary) self.binary.loaded = True
def __loaddb(self, dbpath): if not dbpath.endswith('.db'): dbpath = dbpath + '.db' if not os.path.exists(dbpath): raise RopperError('db does not exist: ' + dbpath) dao = GadgetDAO(dbpath, self.__cprinter) self.binary.gadgets = dao.load(self.binary) self.binary.loaded = True
def __savedb(self, dbpath): if not dbpath.endswith('.db'): dbpath = dbpath+'.db' if os.path.exists(dbpath): self.__cprinter.printInfo('db exists') overwrite = input('Overwrite? [Y/n]: ') if not overwrite or overwrite.upper() == 'Y': self.__cprinter.printInfo('overwrite db') os.remove(dbpath) else: self.__cprinter.printInfo('choose another db name') return dao = GadgetDAO(dbpath, self.__cprinter) dao.save(self.binary.gadgets)
def __savedb(self, dbpath): if not dbpath.endswith('.db'): dbpath = dbpath + '.db' if os.path.exists(dbpath): self.__cprinter.printInfo('db exists') overwrite = input('Overwrite? [Y/n]: ') if not overwrite or overwrite.upper() == 'Y': self.__cprinter.printInfo('overwrite db') os.remove(dbpath) else: self.__cprinter.printInfo('choose another db name') return dao = GadgetDAO(dbpath, self.__cprinter) dao.save(self.binary.gadgets)