def testDefaultScriptsFolder(self): """ Tests default user scripts folder """ self.assertTrue(RUtils.default_scripts_folder()) self.assertIn('rscripts', RUtils.default_scripts_folder()) self.assertTrue(os.path.exists(RUtils.default_scripts_folder()))
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())
def load(self): """ Called when first loading provider """ ProcessingConfig.settingIcons[self.name()] = self.icon() ProcessingConfig.addSetting( Setting(self.name(), 'ACTIVATE_R', self.tr('Activate'), False)) ProcessingConfig.addSetting( Setting(self.name(), RUtils.RSCRIPTS_FOLDER, self.tr('R scripts folder'), RUtils.default_scripts_folder(), valuetype=Setting.MULTIPLE_FOLDERS)) ProcessingConfig.addSetting( Setting(self.name(), 'ACTIVATE_R', self.tr('Activate'), False)) ProcessingConfig.addSetting( Setting( self.name(), RUtils.R_USE_USER_LIB, self.tr('Use user library folder instead of system libraries'), True)) ProcessingConfig.addSetting( Setting(self.name(), RUtils.R_LIBS_USER, self.tr('User library folder'), RUtils.r_library_folder(), valuetype=Setting.FOLDER)) ProcessingConfig.addSetting( Setting(self.name(), RUtils.R_REPO, self.tr('Package repository'), "http://cran.at.r-project.org/", valuetype=Setting.STRING)) ProcessingConfig.addSetting( Setting(self.name(), RUtils.R_FOLDER, self.tr('R folder'), RUtils.r_binary_folder(), valuetype=Setting.FOLDER)) if RUtils.is_windows(): ProcessingConfig.addSetting( Setting(self.name(), RUtils.R_USE64, self.tr('Use 64 bit version'), False)) ProviderActions.registerProviderActions(self, self.actions) ProviderContextMenuActions.registerProviderContextMenuActions( self.contextMenuActions) ProcessingConfig.readSettings() self.refreshAlgorithms() return True