# Path: formatters/log.py
# 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, sys
from workflow import CoronStateMachine
from help import HelpFactory, HelpPresenter
from formatters.log import Paint


sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))


def coronUsage():
    helpEntry = HelpFactory.createHelp()

    print Paint.bold("Coron - an open source project for Android ROM porting.")
    print "Copyright 2014 Baidu Cloud OS <rom.baidu.com>                    "
    print "Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)  "
    print "                                                                 "
    print "COMMANDs are:                                                    "

    # Coron help
    print Paint.bold("* coron help [NAME]")
    print " ", helpEntry.get("help").detail.strip()
    print "                                                                 "


    # Coron action
    print Paint.bold("* coron ACTION")
    print "  Run the action separately."
    print "                                                                 "
    print Paint.bold("ACTION").rjust(20), "\t", Paint.bold("Description")

    ACTIONS = ("config", "newproject", "patchall", "autofix", "fullota", "upgrade", "clean", "cleanall")
    for action in ACTIONS:
        item = helpEntry.get(action)


# Path: formatters/log.py
# 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/coron.py
import os, sys
from workflow import CoronStateMachine
from help import HelpFactory, HelpPresenter
from formatters.log import Paint



sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))


def coronUsage():
    helpEntry = HelpFactory.createHelp()

    print Paint.bold("Coron - an open source project for Android ROM porting.")
    print "Copyright 2014 Baidu Cloud OS <rom.baidu.com>                    "
    print "Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)  "
    print "                                                                 "
    print "COMMANDs are:                                                    "

    # Coron help
    print Paint.bold("* coron help [NAME]")
    print " ", helpEntry.get("help").detail.strip()
    print "                                                                 "


    # Coron action
    print Paint.bold("* coron ACTION")
    print "  Run the action separately."
    print "                                                                 "
    print Paint.bold("ACTION").rjust(20), "\t", Paint.bold("Description")

    ACTIONS = ("config", "newproject", "patchall", "autofix", "fullota", "upgrade", "clean", "cleanall")
    for action in ACTIONS:
        item = helpEntry.get(action)


        print Paint.bold(action).rjust(20), "\t", item.detail.strip()