
import os
from jinja2 import Environment, FileSystemLoader
from common.mylogging import LOG
from conf_action import ConfAction
from conf_globals import *
import subprocess
import filecmp
from collections import OrderedDict
from ftplib import FTP
import re


class ParseNotification:

    def __init__(self, device):
        self.binding_changed = False
        self.old_cfg = []
        self.old_conf = []
        self.old_binding_filename = None
        self._dev = device
        # All the instances will be added to this list
        self.instances = {}

    @staticmethod
    def myget(dictitem,key):
        for keys in dictitem.keys():
            if keys.split(':')[-1] == key:
                value = dictitem.get(keys)
                return value
        LOG.info('Key %s not present' % str(key))
        return None


    def get_binding_file(self, remote_filename, local_filename):
        try: