intficpy/parser.py
def _generateDisambigMsg(self, things, msg):
        """
        Generate the disambiguation message for a list of things
        """
        name_match = self.verboseNamesMatch(things)
        # dictionary of verbose_names from the current set of things
        name_dict = name_match[1]
        scanned_keys = []

        if not name_match[0]:
            for thing in things:
                msg += self._itemWithDisambigIndex(thing, things.index(thing))
                if thing is things[-1]:
                    msg += "?"
                elif len(things) > -2 and thing is things[-2]:
                    msg += ", or "
                else:
                    msg += ", "
            return msg

        things = []
        # empty things to reorder elements according to the order printed,
        # since we are using name_dict
        for name in name_dict:
            # use name_dict for disambiguation message composition rather than things
            scanned_keys.append(name)
            unscanned = list(set(name_dict.keys()) - set(scanned_keys))
            if len(name_dict[name]) > 1:
                if self.locationsDistinct(name_dict[name]):
                    for item in name_dict[name]:
                        things.append(item)
                        loc = item.location
                        if not loc:
                            pass
                        msg += self._disambigMsgNextItem(
                            item, name_dict, name, unscanned, things.index(item), loc
                        )
                    return msg

                for item in name_dict[name]:
                    things.append(item)
                    msg += self._disambigMsgNextItem(
                        item, name_dict, name, unscanned, things.index(item)
                    )
                return msg

            for item in name_dict[name]:
                things.append(item)
                msg += self._disambigMsgNextItem(
                    item, name_dict, name, unscanned, things.index(item)
                )
            return msg

            return msg

        Generate the disambiguation message for a list of things
        
Generate the disambiguation message for a list of things
Generate the disambiguation message for a list of things
def _generateDisambigMsg(self, things, msg):
        name_match = self.verboseNamesMatch(things)
        name_dict = name_match[1]
        scanned_keys = []
        if not name_match[0]:
            for thing in things:
                msg += self._itemWithDisambigIndex(thing, things.index(thing))
                if thing is things[-1]:
                    msg += "?"
                elif len(things) > -2 and thing is things[-2]:
                    msg += ", or "
                else:
                    msg += ", "
            return msg
        things = []
        for name in name_dict:
            scanned_keys.append(name)
            unscanned = list(set(name_dict.keys()) - set(scanned_keys))
            if len(name_dict[name]) > 1:
                if self.locationsDistinct(name_dict[name]):
                    for item in name_dict[name]:
                        things.append(item)
                        loc = item.location
                        if not loc:
                            pass
                        msg += self._disambigMsgNextItem(
                            item, name_dict, name, unscanned, things.index(item), loc
                        )
                    return msg
                for item in name_dict[name]:
                    things.append(item)
                    msg += self._disambigMsgNextItem(
                        item, name_dict, name, unscanned, things.index(item)
                    )
                return msg
            for item in name_dict[name]:
                things.append(item)
                msg += self._disambigMsgNextItem(
                    item, name_dict, name, unscanned, things.index(item)
                )
            return msg
            return msg
def _generateDisambigMsg ( self , things , msg ) : name_match = self . verboseNamesMatch ( things ) name_dict = name_match [ 1 ] scanned_keys = [ ] if not name_match [ 0 ] : for thing in things : msg += self . _itemWithDisambigIndex ( thing , things . index ( thing ) ) if thing is things [ - 1 ] : msg += "?" elif len ( things ) > - 2 and thing is things [ - 2 ] : msg += ", or " else : msg += ", " return msg things = [ ] for name in name_dict : scanned_keys . append ( name ) unscanned = list ( set ( name_dict . keys ( ) ) - set ( scanned_keys ) ) if len ( name_dict [ name ] ) > 1 : if self . locationsDistinct ( name_dict [ name ] ) : for item in name_dict [ name ] : things . append ( item ) loc = item . location if not loc : pass msg += self . _disambigMsgNextItem ( item , name_dict , name , unscanned , things . index ( item ) , loc ) return msg for item in name_dict [ name ] : things . append ( item ) msg += self . _disambigMsgNextItem ( item , name_dict , name , unscanned , things . index ( item ) ) return msg for item in name_dict [ name ] : things . append ( item ) msg += self . _disambigMsgNextItem ( item , name_dict , name , unscanned , things . index ( item ) ) return msg return msg
Generate the disambiguation message for a list of things
Generate the disambiguation message for a list of things
"""
        Generate the disambiguation message for a list of things
        """ # dictionary of verbose_names from the current set of things # empty things to reorder elements according to the order printed, # since we are using name_dict # use name_dict for disambiguation message composition rather than things
self
things
msg