def __init__(self, file_name, module_name, module_value): self.file_name = file_name self.module_name = module_name self.module_value = module_value print("Parsing SVG...") self.svg = svg.parse(file_name)
def __init__(self, file_name, module_name, module_value, ignore_hidden_layers, verbose_print): self.file_name = file_name self.module_name = module_name self.module_value = module_value self.verbose = verbose_print print("Parsing SVG...") self.svg = svg.parse(file_name, verbose_print) if verbose_print: print("Document scaling: {} units per pixel".format( self.svg.viewport_scale)) if (ignore_hidden_layers): self._prune_hidden()
def __init__( self, file_name=None, module_name="svg2mod", module_value="G***", ignore_hidden=False, force_layer=None): self.file_name = file_name self.module_name = module_name self.module_value = module_value self.ignore_hidden = ignore_hidden if file_name: unfiltered_logger.info( "Parsing SVG..." ) self.svg = svg.parse( file_name ) logger.info("Document scaling: {} units per pixel".format(self.svg.viewport_scale)) if force_layer: new_layer = svg.Group() new_layer.name = force_layer new_layer.items = self.svg.items[:] self.svg.items = [new_layer] if self.ignore_hidden: self._prune_hidden()