taurus_pyqtgraph/curveproperties.py
def merge(plist, attributes=None, conflict=None):
        """
        returns a CurveAppearanceProperties object formed by merging a list
        of other CurveAppearanceProperties objects

        :param plist: (sequence<CurveAppearanceProperties>) objects to be
        merged
        :param attributes: (sequence<str>) the name of the attributes to
                           consider for the merge. If None, all the attributes
                           will be merged
        :param conflict: (callable) a function that takes 2 objects (having a
                         different attribute) and returns a value that solves
                         the conflict. If None is given, any conflicting
                         attribute will be set to CONFLICT.

        :return: (CurveAppearanceProperties) merged properties
        """
        n = len(plist)
        if n < 1:
            raise ValueError("plist must contain at least 1 member")
        plist = copy.deepcopy(plist)
        if n == 1:
            return plist[0]
        if attributes is None:
            attributes = [
                "sStyle",
                "sSize",
                "sColor",
                "sFill",
                "lStyle",
                "lWidth",
                "lColor",
                "cStyle",
                "cFill",
                "y2",
                "title",
            ]
        if conflict is None:
            conflict = CurveAppearanceProperties.inConflict_CONFLICT
        p = CurveAppearanceProperties()
        for a in attributes:
            alist = [p.__getattribute__(a) for p in plist]
            p.__setattr__(a, alist[0])
            for ai in alist[1:]:
                if alist[0] != ai:
                    # print "MERGING:",a,alist[0],ai,conflict(alist[0],ai)
                    p.__setattr__(a, conflict(alist[0], ai))
                    break
        return p

        returns a CurveAppearanceProperties object formed by merging a list
        of other CurveAppearanceProperties objects

        :param plist: (sequence<CurveAppearanceProperties>) objects to be
        merged
        :param attributes: (sequence<str>) the name of the attributes to
                           consider for the merge. If None, all the attributes
                           will be merged
        :param conflict: (callable) a function that takes 2 objects (having a
                         different attribute) and returns a value that solves
                         the conflict. If None is given, any conflicting
                         attribute will be set to CONFLICT.

        :return: (CurveAppearanceProperties) merged properties
        
returns a CurveAppearanceProperties object formed by merging a list
of other CurveAppearanceProperties objects
returns a CurveAppearanceProperties object formed by merging a list of other CurveAppearanceProperties objects
def merge(plist, attributes=None, conflict=None):
        n = len(plist)
        if n < 1:
            raise ValueError("plist must contain at least 1 member")
        plist = copy.deepcopy(plist)
        if n == 1:
            return plist[0]
        if attributes is None:
            attributes = [
                "sStyle",
                "sSize",
                "sColor",
                "sFill",
                "lStyle",
                "lWidth",
                "lColor",
                "cStyle",
                "cFill",
                "y2",
                "title",
            ]
        if conflict is None:
            conflict = CurveAppearanceProperties.inConflict_CONFLICT
        p = CurveAppearanceProperties()
        for a in attributes:
            alist = [p.__getattribute__(a) for p in plist]
            p.__setattr__(a, alist[0])
            for ai in alist[1:]:
                if alist[0] != ai:
                    p.__setattr__(a, conflict(alist[0], ai))
                    break
        return p
def merge ( plist , attributes = None , conflict = None ) : n = len ( plist ) if n < 1 : raise ValueError ( "plist must contain at least 1 member" ) plist = copy . deepcopy ( plist ) if n == 1 : return plist [ 0 ] if attributes is None : attributes = [ "sStyle" , "sSize" , "sColor" , "sFill" , "lStyle" , "lWidth" , "lColor" , "cStyle" , "cFill" , "y2" , "title" , ] if conflict is None : conflict = CurveAppearanceProperties . inConflict_CONFLICT p = CurveAppearanceProperties ( ) for a in attributes : alist = [ p . __getattribute__ ( a ) for p in plist ] p . __setattr__ ( a , alist [ 0 ] ) for ai in alist [ 1 : ] : if alist [ 0 ] != ai : p . __setattr__ ( a , conflict ( alist [ 0 ] , ai ) ) break return p
returns a CurveAppearanceProperties object formed by merging a list
of other CurveAppearanceProperties objects
returns a CurveAppearanceProperties object formed by merging a list of other CurveAppearanceProperties objects
"""
        returns a CurveAppearanceProperties object formed by merging a list
        of other CurveAppearanceProperties objects

        :param plist: (sequence<CurveAppearanceProperties>) objects to be
        merged
        :param attributes: (sequence<str>) the name of the attributes to
                           consider for the merge. If None, all the attributes
                           will be merged
        :param conflict: (callable) a function that takes 2 objects (having a
                         different attribute) and returns a value that solves
                         the conflict. If None is given, any conflicting
                         attribute will be set to CONFLICT.

        :return: (CurveAppearanceProperties) merged properties
        """ # print "MERGING:",a,alist[0],ai,conflict(alist[0],ai)
(CurveAppearanceProperties) merged properties
( CurveAppearanceProperties ) merged properties
plist
(sequence) objects to be
merged
( sequence ) objects to be merged
attributes
(sequence) the name of the attributes to
consider for the merge. If None, all the attributes
will be merged
( sequence ) the name of the attributes to consider for the merge . If None all the attributes will be merged
conflict
(callable) a function that takes 2 objects (having a
different attribute) and returns a value that solves
the conflict. If None is given, any conflicting
attribute will be set to CONFLICT.
( callable ) a function that takes 2 objects ( having a different attribute ) and returns a value that solves the conflict . If None is given any conflicting attribute will be set to CONFLICT .