(self)
Applies manual overrides of resource ids.
Applies manual overrides of resource ids.
Applies manual overrides of resource ids .
def update_suite(self):
        """
        Applies manual overrides of resource ids.
        """
        overrides_by_pre_id = get_xform_resource_overrides(self.app.domain, self.app.origin_id)
        resources = getattr(self.suite, FormResourceContributor.section_name)
        for resource in resources:
            if resource.id in overrides_by_pre_id:
                resource.id = overrides_by_pre_id[resource.id].post_id

        id_counts = Counter(resource.id for resource in resources)
        duplicates = [key for key, count in id_counts.items() if count > 1]
        if duplicates:
            raise ResourceOverrideError("Duplicate resource ids found: {}".format(", ".join(duplicates)))
def update_suite ( self ) : overrides_by_pre_id = get_xform_resource_overrides ( self . app . domain , self . app . origin_id ) resources = getattr ( self . suite , FormResourceContributor . section_name ) for resource in resources : if resource . id in overrides_by_pre_id : resource . id = overrides_by_pre_id [ resource . id ] . post_id id_counts = Counter ( resource . id for resource in resources ) duplicates = [ key for key , count in id_counts . items ( ) if count > 1 ] if duplicates : raise ResourceOverrideError ( "Duplicate resource ids found: {}" . format ( ", " . join ( duplicates ) ) )