I dare you take 2: Github repo: Fix content button config/alt content marker

Second “I dare you”
Almost a double dare!

Based on discussion Content Button Bundle - "Marker ●" - #4 by Jean-Marc

see the following issue about “●” marker showing for content bundle even when there is no *other.rfa revit family in the folder
more details in the issue below:

image

maybe @martin.servold or @deddolo will be the first to be inspired again :wink:

In /extensions/components.py, I believe this should change to set the Config file = script file


class ContentButton(GenericUICommand):
    type_id = exts.CONTENT_BUTTON_POSTFIX

    def __init__(self, cmp_path=None):
        # using classname otherwise exceptions in superclasses won't show
        GenericUICommand.__init__(
            self,
            cmp_path=cmp_path,
            needs_script=False
            )
        # find content file
        self.script_file = \
            self.find_bundle_file([
                exts.CONTENT_VERSION_POSTFIX.format(
                    version=HOST_APP.version
                    ),
                ])
        if not self.script_file:
            self.script_file = \
                self.find_bundle_file([
                    exts.CONTENT_POSTFIX,
                    ])
        # requires at least one bundles
        if self.directory and not self.script_file:
            mlogger.error('Command %s: Does not have content file.', self)
            self.script_file = ''

        # find alternative content file
        self.config_script_file = \
            self.find_bundle_file([
                exts.ALT_CONTENT_VERSION_POSTFIX.format(
                    version=HOST_APP.version
                    ),
                ])
        if not self.config_script_file:
            self.config_script_file = \
                self.find_bundle_file([
                    exts.ALT_CONTENT_POSTFIX,
                    ])
        if not self.config_script_file:
            self.config_script_file = ''   <--------- self.config_script_file = self.script_file

because the base class GenericUICommand has a function:

    def has_config_script(self):
        return self.config_script_file != self.script_file

you made it! @martin.servold
the double dare :slight_smile:

if you want to try it with the latest installers, grab them here in a bit