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)
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)
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
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
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