<commit_before>"""camp2docker

Usage:
    camp2docker load <filename>
    camp2docker parse <filename>
    camp2docker process <filename>
    camp2docker generate <filename> <output_folder>
    camp2docker services
    camp2docker service <service>
    camp2docker artifacts
    camp2docker artifact <artifact>
    camp2docker requirements <artifact>

Options:
    -h --help Show this
"""
from docopt import docopt
from input import Planfile
from assembly import PlanProcessor
from config import Config
import pprint

if __name__ == "__main__":
    args = docopt(__doc__)

    if args["load"]:
        planfile = Planfile(args["<filename>"])
        pprint.pprint(planfile.config)
    elif args["parse"]:
        plan = Planfile(args["<filename>"]).create_plan()
        print plan
    elif args["process"]:
        plan = Planfile(args["<filename>"]).create_plan()
        pp = PlanProcessor(plan)
        print pp.process_plan()
    elif args["generate"]:
        plan = Planfile(args["<filename>"]).create_plan()
        pp = PlanProcessor(plan)
        pp.process_plan().generate_files(args["<output_folder>"])

    elif args["services"]:
        config = Config()
        services = config.services
        for service in services:
            print service.name
    elif args["service"]:
        config = Config()
        try:
            pprint.pprint(config.find_service_by_name(args["<service>"]))
        except:
            print "No service {service}".format(service=args["<service>"])
    elif args["artifacts"]:
        config = Config()
        artifacts = config.artifacts
        for artifact in artifacts:
            print artifact.name
    elif args["artifact"]:
        config=Config()
        try:
            pprint.pprint(config.find_artifact_config_by_type(args["<artifact>"]))
        except:
            print "No artifact {artifact}".format(artifact=args["<artifact>"])
<commit_msg>fix(cli): Create config with class method<commit_after>"""camp2docker

Usage:
    camp2docker load <filename>
    camp2docker parse <filename>
    camp2docker process <filename>
    camp2docker generate <filename> <output_folder>
    camp2docker services
    camp2docker service <service>
    camp2docker artifacts
    camp2docker artifact <artifact>
    camp2docker requirements <artifact>

Options:
    -h --help Show this
"""
from docopt import docopt
from input import Planfile
from assembly import PlanProcessor
from config import Config
import pprint

if __name__ == "__main__":
    args = docopt(__doc__)

    if args["load"]:
        planfile = Planfile(args["<filename>"])
        pprint.pprint(planfile.config)
    elif args["parse"]:
        plan = Planfile(args["<filename>"]).create_plan()
        print plan
    elif args["process"]:
        plan = Planfile(args["<filename>"]).create_plan()
        pp = PlanProcessor(plan)
        print pp.process_plan()
    elif args["generate"]:
        plan = Planfile(args["<filename>"]).create_plan()
        pp = PlanProcessor(plan)
        pp.process_plan().generate_files(args["<output_folder>"])

    elif args["services"]:
        config = Config.from_path()
        services = config.services
        for service in services:
            print service.name
    elif args["service"]:
        config = Config.from_path()
        try:
            pprint.pprint(config.find_service_by_name(args["<service>"]))
        except:
            print "No service {service}".format(service=args["<service>"])
    elif args["artifacts"]:
        config = Config.from_path()
        artifacts = config.artifacts
        for artifact in artifacts:
            print artifact.name
    elif args["artifact"]:
        config=Config.from_path()
        try:
            pprint.pprint(config.find_artifact_config_by_type(args["<artifact>"]))
        except:
            print "No artifact {artifact}".format(artifact=args["<artifact>"])

{'fraction_non_alphanumeric': 0.11702674897119342, 'fraction_numerical': 0.0051440329218107, 'mean_word_length': 2.9203629032258065, 'pattern_counts': {'":': 2, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1945931', 'n_tokens_mistral': 1143, 'n_tokens_neox': 1092, 'n_words': 259}