def main():
    players_interface = PlayersInterface()
    timer = SolutionTimer(players_interface)
    html_gen = HTMLGenerator(players_interface)

    while True:
        # Pull Repos
        print('  Pulling Repos')
        players_interface.pull_all_repos()

        # Time All Players
        print('  Timing Players')
        for player in players_interface.players.values():
            timer.time_solutions(player.pid)

        # Record Times
        print('  Updating Leaderboard\n')
        html_gen.update_leaderboard()
Example #2
0
def main(event, context):
    menus = get_restaurant_menus_dict(event['restaurants'])

    for r in menus:
        for d in menus[r]:
            menus[r][d] = menus[r][d].replace('\n', '</p><p>')
            log.debug(menus[r][d])

    index_html = HTMLGenerator(
        menus,
        index_template_path=os.environ['INDEX_TEMPLATE_PATH'],
        menu_template_path=os.environ['MENU_TEMPLATE_PATH'],
        output_path=os.environ['OUTPUT_PATH']).make_html()

    copy_html_to_s3(index_html, 'index.html')
Example #3
0
# -*- coding: utf-8 -*-
from parser import XMLParser
from html_generator import HTMLGenerator

import sys

if __name__ == "__main__":

    if len(sys.argv) != 3:
        print "python " + __file__ + " <xml_file> <n_day>"
        print "e.g.:"
        print "> python " + __file__ + " input/schedule.xml 0"
        print "for printing the schedule of the first day."
        sys.exit(1)

    parser = XMLParser(sys.argv[1])
    conference = parser.parse()
    dumper = HTMLGenerator(conference)
    dumper.dump(int(sys.argv[2]))
Example #4
0
 def generateHTML(self):
     htmlGenerator = HTMLGenerator()
     htmlGenerator.addHTML(htmlGenerator.buildChildren(self))
     print lxml.html.tostring(htmlGenerator.getHTML())
     with open('myapp.html', 'w') as f:
         f.write(lxml.html.tostring(htmlGenerator.getHTML()))
Example #5
0
 def show(self):
     htmlGenerator = HTMLGenerator()
     htmlGenerator.addHTML(htmlGenerator.buildChildren(self))
     htmlGenerator.dumpHTML()
     self.initialize()
Example #6
0
 def generateHTML(self):
     htmlGenerator = HTMLGenerator()
     htmlGenerator.addHTML(htmlGenerator.buildChildren(self))
     print lxml.html.tostring(htmlGenerator.getHTML())
     with open('myapp.html', 'w') as f:
         f.write(lxml.html.tostring(htmlGenerator.getHTML()))
Example #7
0
 def show(self):
     htmlGenerator = HTMLGenerator()
     htmlGenerator.addHTML(htmlGenerator.buildChildren(self))
     htmlGenerator.dumpHTML()
     self.initialize()