def setName(self, cmd): """Allows the user to set the name that the files will be renamed to.""" if len(self.mainList) > 0: self.toName = self.string[self._lenCmdStr(cmd,2):] print("\nNew name set to: " + self.toName) print("Example: " + splitstring.stitch(self.toName, self.mainList[0].file, self._zFillNum())) print() else: print("Must have a sorted list before setting name.\n")
def setStart(self, cmd): """Sets the starting number from which the files will be renamed.""" if len(self.mainList) > 0: self.startNum = eval(cmd[2]) self._checkZFill() print("\nNew starting number is " + str(self.startNum)) print("zfill is " + str(self.fill)) print("Example: " + splitstring.stitch(self.toName, self.mainList[0].file, self._zFillNum())) else: print("Must have a sorted list before setting the start num.\n")
def setZFill(self, cmd): """Sets a custom zfill amount greater than the automatic zfill.""" if len(self.mainList) > 0: self._checkZFill() if eval(cmd[2]) >= self.fill: self.fill = eval(cmd[2]) print("\nNew zfill set to: " + str(self.fill)) print("Example: " + splitstring.stitch(self.toName, self.mainList[0].file, self._zFillNum())) print() else: print("Cannot set zfill to be less than the automatic zfill.\n")
def setFileName(self, name, num, zfill): """Set the filename with appropriate parts for renaming.""" # Done with renamer.setName self.file = splitstring.stitch(name, self.file, num, zfill, self.mult)