cypher_pcs.py
def _add_dict_inventory(self, d, item_pouch):        # item_pouch used to find which dictionary to look in
        """A method that takes a dictionary of items sorted into their categories, and adds them to their right
        "compartment", recursive, dictionaries inside dictionaries can be sorted"""
        for group in d:
            if group in item_pouch:
                if item_pouch[group] is None:
                    item_pouch[group] = d[group]
                elif isinstance(item_pouch[group], list):
                    item_pouch[group].extend(d[group])
                elif isinstance(item_pouch[group], dict):
                    self._add_dict_inventory(d[group], item_pouch[group])
                elif isinstance(item_pouch[group], int):
                    item_pouch[group] = item_pouch.setdefault(group, 0)+d[group]
            else:
                item_pouch[group] = d[group]
A method that takes a dictionary of items sorted into their categories, and adds them to their right
        "compartment", recursive, dictionaries inside dictionaries can be sorted
A method that takes a dictionary of items sorted into their categories, and adds them to their right
"compartment", recursive, dictionaries inside dictionaries can be sorted
A method that takes a dictionary of items sorted into their categories and adds them to their right " compartment " recursive dictionaries inside dictionaries can be sorted
def _add_dict_inventory(self, d, item_pouch):        
        for group in d:
            if group in item_pouch:
                if item_pouch[group] is None:
                    item_pouch[group] = d[group]
                elif isinstance(item_pouch[group], list):
                    item_pouch[group].extend(d[group])
                elif isinstance(item_pouch[group], dict):
                    self._add_dict_inventory(d[group], item_pouch[group])
                elif isinstance(item_pouch[group], int):
                    item_pouch[group] = item_pouch.setdefault(group, 0)+d[group]
            else:
                item_pouch[group] = d[group]
def _add_dict_inventory ( self , d , item_pouch ) : for group in d : if group in item_pouch : if item_pouch [ group ] is None : item_pouch [ group ] = d [ group ] elif isinstance ( item_pouch [ group ] , list ) : item_pouch [ group ] . extend ( d [ group ] ) elif isinstance ( item_pouch [ group ] , dict ) : self . _add_dict_inventory ( d [ group ] , item_pouch [ group ] ) elif isinstance ( item_pouch [ group ] , int ) : item_pouch [ group ] = item_pouch . setdefault ( group , 0 ) + d [ group ] else : item_pouch [ group ] = d [ group ]
A method that takes a dictionary of items sorted into their categories, and adds them to their right
"compartment", recursive, dictionaries inside dictionaries can be sorted
A method that takes a dictionary of items sorted into their categories and adds them to their right " compartment " recursive dictionaries inside dictionaries can be sorted
# item_pouch used to find which dictionary to look in
 """A method that takes a dictionary of items sorted into their categories, and adds them to their right
        "compartment", recursive, dictionaries inside dictionaries can be sorted"""
self
d
item_pouch