If we add a new line after the opening { then we don't need the new line within the dictionary, which adversely affects readability in my opnion.

    return regex % {
        'BRANCH': self.branch,
        'PLATFORM': '' if self.locale_build else self.platform_regex,
        'L10N': 'l10n' if self.locale_build else '',
        'DEBUG': '-debug' if self.debug_build else ''}