예제 #1
0
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."))
예제 #2
0
파일: plot.py 프로젝트: feitianyiren/pondus
 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:])
예제 #3
0
 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:])