def setUser(self, username, password): """deal with both add and modify""" if self.filename is None: return if not os.path.exists(self.filename): self._tdbFileCreate() inStr = "" inStr += "%s\n" % (password) inStr += "%s\n" % (password) FmUtil.cmdCallWithInput("pdbedit", inStr, "-d", "0", "-b", "tdbsam:%s" % (self.filename), "-a", username, "-t")
def _tdbFileCreate(self): FmUtil.ensureAncesterDir(self.filename) inStr = "" inStr += "create %s\n" % (self.filename) inStr += "quit\n" FmUtil.cmdCallWithInput("tdbtool", inStr)