def process_metadata_line(self, line): """ Processes a "metadata" (##) line """ line = line.replace('#', '') # special commands if line.lower().strip().startswith('showplots'): self.show_plots = True self.addParameter( QgsProcessingParameterFileDestination( RAlgorithm.RPLOTS, self.tr('R Plots'), self.tr('HTML files (*.html)'), optional=True)) return if line.lower().strip().startswith('dontuserasterpackage'): self.use_raster_package = False return if line.lower().strip().startswith('passfilenames'): self.pass_file_names = True return value, type_ = self.split_tokens(line) if type_.lower().strip() == 'group': self._group = value return if type_.lower().strip() == 'name': self._name = self._display_name = value self._name = RUtils.strip_special_characters(self._name.lower()) return self.process_parameter_line(line)
def testStripSpecialCharacters(self): """ Tests stripping special characters from a name """ self.assertEqual(RUtils.strip_special_characters('aB 43 24a:sd'), 'aB4324asd')