예제 #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.script = script
        self._name = ''
        self._display_name = ''
        self._group = ''
        self.description_file = os.path.realpath(
            description_file) if description_file else ''
        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.use_raster_package = False
        self.pass_file_names = False
        self.show_console_output = False
        self.plots_filename = ''
        self.results = {}
        if self.script is not None:
            self.load_from_string()
        if self.description_file is not None:
            self.load_from_file()