# Path: formatters/log.py
# class Log:
# 
#     DEBUG = False
# 
#     @staticmethod
#     def d(tag, message):
#         if Log.DEBUG: print "D/%s: %s" %(tag, message)
# 
#     @staticmethod
#     def i(tag, message):
#         print "I/%s: %s" %(tag, message)
# 
#     @staticmethod
#     def w(tag, message):
#         print "W/%s: %s" %(tag, message)
# 
#     @staticmethod
#     def e(tag, message):
#         print "E/%s: %s" %(tag, message)


import shutil
import os, sys
import subprocess
import tempfile
import xml.dom.minidom
    import xml.etree.cElementTree as ET
    import xml.etree.ElementTree as ET
from config import Config
from formatters.log import Log
"""

__author__ = 'duanqz@gmail.com'






try:
except ImportError:

#from lxml import etree as ET

TAG="changelist"

class ChangeList:


    def __init__(self, olderRoot, newerRoot, patchXML):
        ChangeList.OLDER_ROOT = olderRoot
        ChangeList.NEWER_ROOT = newerRoot
        ChangeList.PATCH_XML  = patchXML

    def make(self, force=True):
        """ Generate the change list into XML.
            Set force as False not to generate again if exists.
        """

        if not force and os.path.exists(ChangeList.PATCH_XML):

# Path: formatters/log.py
# class Log:
# 
#     DEBUG = False
# 
#     @staticmethod
#     def d(tag, message):
#         if Log.DEBUG: print "D/%s: %s" %(tag, message)
# 
#     @staticmethod
#     def i(tag, message):
#         print "I/%s: %s" %(tag, message)
# 
#     @staticmethod
#     def w(tag, message):
#         print "W/%s: %s" %(tag, message)
# 
#     @staticmethod
#     def e(tag, message):
#         print "E/%s: %s" %(tag, message)


# Path: autopatch/changelist.py
import shutil
import os, sys
import subprocess
import tempfile
import xml.dom.minidom
    import xml.etree.cElementTree as ET
    import xml.etree.ElementTree as ET
from config import Config
from formatters.log import Log

"""

__author__ = 'duanqz@gmail.com'






try:
except ImportError:

#from lxml import etree as ET

TAG="changelist"

class ChangeList:


    def __init__(self, olderRoot, newerRoot, patchXML):
        ChangeList.OLDER_ROOT = olderRoot
        ChangeList.NEWER_ROOT = newerRoot
        ChangeList.PATCH_XML  = patchXML

    def make(self, force=True):
        """ Generate the change list into XML.
            Set force as False not to generate again if exists.
        """

        if not force and os.path.exists(ChangeList.PATCH_XML):

            Log.d(TAG, "Using the existing %s" % ChangeList.PATCH_XML)