def __init_from_dir__(self, cmd_dir): GenericUICommand.__init_from_dir__(self, cmd_dir) full_file_path = op.join(self.directory, DEFAULT_ON_ICON_FILE) self.icon_on_file = full_file_path if op.exists(full_file_path) else None full_file_path = op.join(self.directory, DEFAULT_OFF_ICON_FILE) self.icon_off_file = full_file_path if op.exists(full_file_path) else None
def __init_from_dir__(self, cmd_dir): GenericUICommand.__init_from_dir__(self, cmd_dir) self.assembly = self.command_class = None try: # reading script file content to extract parameters script_content = ScriptFileParser(self.get_full_script_address()) self.assembly = script_content.extract_param(LINK_BUTTON_ASSEMBLY_PARAM) # type: str self.command_class = script_content.extract_param(LINK_BUTTON_COMMAND_CLASS_PARAM) # type: str except PyRevitException as err: logger.error(err) logger.debug('Link button assembly.class: {}.{}'.format(self.assembly, self.command_class))
def __init_from_dir__(self, cmd_dir): GenericUICommand.__init_from_dir__(self, cmd_dir) full_file_path = op.join(self.directory, exts.DEFAULT_ON_ICON_FILE) self.icon_on_file = \ full_file_path if op.exists(full_file_path) else None full_file_path = op.join(self.directory, exts.DEFAULT_OFF_ICON_FILE) self.icon_off_file = \ full_file_path if op.exists(full_file_path) else None if self.name: logger.deprecate('{} | Toggle bundle is deprecated and will be ' 'removed soon. Please use SmartButton bundle, ' 'or any other bundle and use script.toggle_icon ' 'method to toggle the tool icon.' .format(self.name))