Esempio n. 1
0
 def load_properties(self, child):
     """ __load_properties
     Private method to Load ynab transaction properties from a node
     """
     if is_dom_element(child):
         if child.hasChildNodes():
             if child.tagName in self.fields_of_interest:
                 for subchild in child.childNodes:
                     if hasattr(subchild, "data"):
                         setattr(self, child.tagName, subchild.data)
Esempio n. 2
0
 def load_properties(self, child):
     """ __load_properties
     Private method to Load ynab transaction properties from a node
     """
     if is_dom_element(child):
         if child.hasChildNodes():
             if child.tagName in self.fields_of_interest:
                 for subchild in child.childNodes:
                     if hasattr(subchild, "data"):
                             setattr(self, child.tagName, subchild.data)
Esempio n. 3
0
 def load_properties(self, child):
     """ __load_properties
     Private method to Load ynab payee properties from a node
     """
     if is_dom_element(child):
         if child.hasChildNodes():
             if child.nodeName == "name":
                 for subchild in child.childNodes:
                     self.name = subchild.data
             elif child.nodeName == "autoFillData":
                 for subchild in child.childNodes:
                     if not hasattr(subchild, "data"):        
                         for subsubchild in subchild.childNodes:
                             if hasattr(subsubchild, "data"):
                                 setattr(self, subchild.tagName, subsubchild.data)
Esempio n. 4
0
    def get_children(self, name_filter=''):
        """ Get this Categories child Categories

        (optional argument filters by name)
        """

        children = []

        for child in self.dom.childNodes:
            if child.nodeType == child.ELEMENT_NODE:
                if child.tagName == 'monthlySubCategoryBudgets':
                    for subchild in child.childNodes:
                        if is_dom_element(subchild):
                            if subchild.tagName == TAGS['MONTHLY_SUB_CAT_']:
                                # note what we are doing here with 'self',
                                # passing a reference to the subcategories
                                # parent
                                budget = YNAB3_MonthlySubCategoryBudget(subchild, self)
                                children.append(budget)
        return children
Esempio n. 5
0
    def get_children(self, name_filter=''):
        """ Get this Categories child Categories

        (optional argument filters by name)
        """

        children = []

        for child in self.dom.childNodes:
            if child.nodeType == child.ELEMENT_NODE:
                if child.tagName == 'monthlySubCategoryBudgets':
                    for subchild in child.childNodes:
                        if is_dom_element(subchild):
                            if subchild.tagName == TAGS['MONTHLY_SUB_CAT_']:
                                # note what we are doing here with 'self',
                                # passing a reference to the subcategories
                                # parent
                                budget = YNAB3_MonthlySubCategoryBudget(
                                    subchild, self)
                                children.append(budget)
        return children
Esempio n. 6
0
    def get_children(self, name_filter=''):
        """ Get this Categories child Categories

        (optional argument filters by name)
        """

        children = []

        for child in self.dom.childNodes:
            if child.nodeType == child.ELEMENT_NODE:
                if child.tagName == 'subCategories':
                    for subchild in child.childNodes:
                        if is_dom_element(subchild):
                            if subchild.tagName == TAGS['SUB_CAT']:
                                # note what we are doing here with 'self',
                                # passing a reference to the subcategories
                                # parent
                                category = YNAB3_SubCategory(subchild, self)
                                if category.get_name().find(name_filter) != -1:
                                    children.append(category)
        return children
Esempio n. 7
0
    def get_children(self, name_filter=''):
        """ Get this Categories child Categories

        (optional argument filters by name)
        """

        children = []

        for child in self.dom.childNodes:
            if child.nodeType == child.ELEMENT_NODE:
                if child.tagName == 'subCategories':
                    for subchild in child.childNodes:
                        if is_dom_element(subchild):
                            if subchild.tagName == TAGS['SUB_CAT']:
                                # note what we are doing here with 'self',
                                # passing a reference to the subcategories
                                # parent
                                category = YNAB3_SubCategory(subchild, self)
                                if category.get_name().find(name_filter) != -1:
                                    children.append(category)
        return children