Ejemplo n.º 1
0
def main(**kwargs):
    with_reporting = True
    if sys.argv and sys.argv[0] == "manage.py":
        # Started from Django: $ python3 manage.py runserver
        args = {
            'config': Config.DEFAULT_CONFIG_FILE,
            'verbose': Config.DEFAULT_VERBOSITY
        }
        with_reporting = False
    else:
        # Started from command line: $ python3 Start.py
        default_args = getParser().parse_args()
        args = default_args.__dict__
        args.update(kwargs)

    start = datetime.datetime.now()
    # Read configuration and set 'config' to a global in the Config module so it is available to all of the application
    Config.app = Config.App(verbosity=args['verbose'])
    Config.config = Config.Config(args['config'])

    portfolio = PortfolioService(Config.config)
    Config.app.portfolioData = portfolio.loadPortfolio()

    print("--- portfolio ---")
    for initiative in Config.app.portfolioData.traverse():
        print("* Initiative: " + str(initiative))
        print("- No epics" if not initiative.traverse() else "- Epics:")
        for epic in initiative.traverse():
            print("-- " + str(epic))
    print("-----------------")

    if with_reporting:
        report = ReportService(Config.config)
        startReporting = datetime.datetime.now()
        # Portfolio overview
        report.portfolioOverview(Config.app.portfolioData)

        # Report details on each Initiative
        for v in Config.app.portfolioData.traverse():
            report.reportDetails(v)

        report.copy_static_files()

        print("Reporting time: %s" %
              (datetime.datetime.now() - startReporting))

    end = datetime.datetime.now()
    print("\nRuntime %s" % (end - start))
Ejemplo n.º 2
0
 def setUp(self):
     Config.app = Config.App()
     Config.config = Config.Config("../../sweep.yaml")
Ejemplo n.º 3
0
 def __init__(self):
     # Read configuration and set 'config' to a global in the Config module so it is available to all of the application
     Config.app = Config.App(verbosity=Config.DEFAULT_VERBOSITY)
     Config.config = Config.Config(Config.DEFAULT_CONFIG_FILE)
     Config.persist = Persist(Config.config)
     self.statuses = Config.config.statuses