# 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)
# 
# class Paint:
# 
#     @staticmethod
#     def bold(s):
#         return "%s[01m%s%s[0m" % (chr(27), s.rstrip(), chr(27))
# 
#     @staticmethod
#     def red(s):
#         return "%s[33;31m%s%s[0m" % (chr(27), s.rstrip(), chr(27))
# 
#     @staticmethod
#     def green(s):
#         return "%s[31;32m%s%s[0m" % (chr(27), s.rstrip(), chr(27))
# 
#     @staticmethod
#     def blue(s):
#         return "%s[34;01m%s%s[0m" % (chr(27), s.rstrip(), chr(27))
# 
#     @staticmethod
#     def yellow(s):
#         return "%s[31;33m%s%s[0m" % (chr(27), s.rstrip(), chr(27))


import os
import subprocess
import shutil
import re
    import xml.etree.cElementTree as ET
    import xml.etree.ElementTree as ET
from help import HelpPresenter
from formatters.log import Log, Paint
            return True
        else:
            print Paint.red("<<< phase %s failed" % action)
            return False


# End of CoronStateMachine


class Shell:
    """ Subprocess to run shell command
    """

    @staticmethod
    def run(cmd):
        """ Run command in shell.
            Set `isMakeCommand` to True if command is a `make` command
        """

        subp = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

        output = None
        while True:
            buff = subp.stdout.readline().strip('\n')
            print buff
            if buff == '' and subp.poll() != None:
                break

            output = buff


# 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)
# 
# class Paint:
# 
#     @staticmethod
#     def bold(s):
#         return "%s[01m%s%s[0m" % (chr(27), s.rstrip(), chr(27))
# 
#     @staticmethod
#     def red(s):
#         return "%s[33;31m%s%s[0m" % (chr(27), s.rstrip(), chr(27))
# 
#     @staticmethod
#     def green(s):
#         return "%s[31;32m%s%s[0m" % (chr(27), s.rstrip(), chr(27))
# 
#     @staticmethod
#     def blue(s):
#         return "%s[34;01m%s%s[0m" % (chr(27), s.rstrip(), chr(27))
# 
#     @staticmethod
#     def yellow(s):
#         return "%s[31;33m%s%s[0m" % (chr(27), s.rstrip(), chr(27))


# Path: workflow/workflow.py
import os
import subprocess
import shutil
import re
    import xml.etree.cElementTree as ET
    import xml.etree.ElementTree as ET
from help import HelpPresenter
from formatters.log import Log, Paint

            return True
        else:
            print Paint.red("<<< phase %s failed" % action)
            return False


# End of CoronStateMachine


class Shell:
    """ Subprocess to run shell command
    """

    @staticmethod
    def run(cmd):
        """ Run command in shell.
            Set `isMakeCommand` to True if command is a `make` command
        """

        subp = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

        output = None
        while True:
            buff = subp.stdout.readline().strip('\n')
            print buff
            if buff == '' and subp.poll() != None:
                break

            output = buff


        Log.d(TAG, "Shell.run() %s return %s" %(cmd, subp.returncode))