Exemple #1
0
    def create_dump_dir(self):
        """
        Checks dump directory exists, creates it if not
        """
        if self._dump_dir is None or len(self._dump_dir) == 0:
            self._dump_dir = DUMP_DIR

        dir_ok, self._dump_dir, msg = qtrlio.create_dir(self._dump_dir,
                                                        desc='dump')

        if not dir_ok:
            self.write_to_file = False
            msg += "\ndump file output will be suppressed."
            logger.error(msg)

        return dir_ok
Exemple #2
0
    def create_dump_dir(self):
        """
        Checks dump directory exists, creates it if not
        """
        if self._dump_dir is None or len(self._dump_dir) == 0:
            self._dump_dir = DUMP_DIR

        dir_ok, self._dump_dir, msg = qtrlio.create_dir(
                    self._dump_dir, desc='dump')

        if not dir_ok:
            self.write_to_file = False
            msg += "\ndump file output will be suppressed."
            logger.error(msg)

        return dir_ok
Exemple #3
0
    def check_create_output_dir(self, output_dir, desc='output'):
        """
        Checks if the given directory exists, if not it is created
        Returns
        -------
        dir_ok : boolean
            True if directory exists (previously or created)
            False if failed to create the directory

        output_dir : string
            Path to the directory, which may be been made absolute

        msg : string
            Error msg if directory creation failed
        """

        return qtrlio.create_dir(output_dir, desc=desc)
Exemple #4
0
    def check_create_output_dir(self, output_dir, desc='output'):
        """
        Checks if the given directory exists, if not it is created
        Returns
        -------
        dir_ok : boolean
            True if directory exists (previously or created)
            False if failed to create the directory

        output_dir : string
            Path to the directory, which may be been made absolute

        msg : string
            Error msg if directory creation failed
        """
        
        return qtrlio.create_dir(output_dir, desc=desc)