Пример #1
0
 def testBuiltInPath(self):
     """
     Tests built in scripts path
     """
     self.assertTrue(RUtils.builtin_scripts_folder())
     self.assertIn('builtin_scripts', RUtils.builtin_scripts_folder())
     self.assertTrue(os.path.exists(RUtils.builtin_scripts_folder()))
Пример #2
0
 def testScriptsFolders(self):
     """
     Test script folders
     """
     self.assertTrue(RUtils.script_folders())
     self.assertIn(RUtils.default_scripts_folder(), RUtils.script_folders())
     self.assertIn(RUtils.builtin_scripts_folder(), RUtils.script_folders())
Пример #3
0
    def __init__(self, description_file, script=None):
        super().__init__()

        self.r_templates = RTemplates()
        self.script = script
        self._name = ''
        self._display_name = ''
        self._group = ''
        self.description_file = os.path.realpath(
            description_file) if description_file else None
        self.error = None
        self.commands = list()
        self.is_user_script = False
        if description_file:
            self.is_user_script = not description_file.startswith(
                RUtils.builtin_scripts_folder())

        self.show_plots = False
        self.pass_file_names = False
        self.show_console_output = False
        self.save_output_values = False
        self.plots_filename = ''
        self.output_values_filename = ''
        self.results = {}
        if self.script is not None:
            self.load_from_string()
        if self.description_file is not None:
            self.load_from_file()