# 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 os
import commands
import shutil
import fnmatch
import tempfile
from config import Config
from smaliparser.Smali import Smali
from formatters.log import Log
    def getAllParts(self):
        return self.mPartList

    def appendPart(self, part):
        """ Append a part to list if not exist
        """

        try:
            self.mPartList.index(part)
        except:
            Log.d(TAG, "  [Add new part %s ] " % part)
            self.mPartList.append(part)

    def deletePart(self, part):
        """ Delete a part
        """

        try:
            self.mPartList.remove(part)
            Log.d(TAG, "  [Delete part %s ] " % part)
        except:
            Log.e(TAG, "SmaliSpliiter.deltePart(): can not find part %s" % part)

    def replacePart(self, targetPart, newerPart):
        """ Replace the target with the newer.
        """

        try:
            index = self.mPartList.index(targetPart)
            self.mPartList[index] = newerPart

# 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/diff_patch.py
import os
import commands
import shutil
import fnmatch
import tempfile
from config import Config
from smaliparser.Smali import Smali
from formatters.log import Log

    def getAllParts(self):
        return self.mPartList

    def appendPart(self, part):
        """ Append a part to list if not exist
        """

        try:
            self.mPartList.index(part)
        except:
            Log.d(TAG, "  [Add new part %s ] " % part)
            self.mPartList.append(part)

    def deletePart(self, part):
        """ Delete a part
        """

        try:
            self.mPartList.remove(part)
            Log.d(TAG, "  [Delete part %s ] " % part)
        except:
            Log.e(TAG, "SmaliSpliiter.deltePart(): can not find part %s" % part)

    def replacePart(self, targetPart, newerPart):
        """ Replace the target with the newer.
        """

        try:
            index = self.mPartList.index(targetPart)
            self.mPartList[index] = newerPart

            Log.d(TAG, "  [Replace %s by %s] " % (targetPart, newerPart))