def _set_datafilepath(filepath): """Updates the path to the file containing the weight data.""" filepath = os.path.expanduser(filepath) if not os.path.isabs(filepath): filepath = os.path.join(os.getcwd(), filepath) if not os.path.isdir(filepath): logger.info(_("Reading file %s"), filepath) parameters.userdatafile = filepath parameters.use_custom_file = True return else: logger.warning(_("You passed a directory, not a file!")) logger.warning(_("Using the standard file ~/.pondus/user_data.xml instead."))
def save_to_file(self, filename): """Saves the plot to filename. The filename's ending must be a valid format to save to.""" logger.info(_('Saving plot to %s'), filename) self.figure.savefig(filename, format=filename[-3:])