Esempio n. 1
0
 def POST(self):
     data = web.data()
     request = []
     goto = []
     if data:
         workload = json.loads(data)
         request = workload.get('request', [])
         goto = workload.get('goto', [])
         print data
     manager.process(request, goto)
     manager.dump()
     return json.dumps(manager.current())
Esempio n. 2
0
def manage( event ):
    if m.listens_for( event.key ):
        if m.process( event ):
            u.Unit.activate_next()
Esempio n. 3
0
horizontal_bar = """
======================================================================
"""
window.read(timeout=10)
print(openText)

while True:
    event, values = window.read()
    if event in (None, "Cancel"):
        break

    if event == "Merge":
        fileList = getHwpFileAddress(path=values["병합폴더선택"],
                                     sub_folder=values[1])
        hwp_count = MergeHwp(fileList, values[2])
        endText = f"""
======================================================================
{hwp_count}개 생성 작업이 완료 되었습니다.
======================================================================
"""
        print(endText)

    if event == "Split":
        print(horizontal_bar)
        print("분리를 시작합니다.")
        window.refresh()
        process(values["분리파일선택"], window)
        print("분리작업이 종료 되었습니다. ", horizontal_bar)
window.close()
Esempio n. 4
0
def main():
    # Initialize everything
    init()

    # Setup the screen
    size = t.screen_size()
    screen = pygame.display.set_mode(size)
    pygame.display.set_caption(TITLE)

    # Initialize clock
    clock = pygame.time.Clock()

    # Initialize background
    screen.fill(colors.BLACK)
    pygame.display.flip()


    while True:
        dt = clock.tick( FPS ) / 1000.

        # Handle events and change state as necessary
        for event in pygame.event.get():
            m.process( event )

        for event in e.Event.get():
            m.process( event )

        # Update all units
        for unit in u.all():
            unit.update( dt )

        flower_count = 0
        rabbit_count = 0
        for unit in u.all():
            if isinstance(unit, f.Flower):
                flower_count += 1
            if isinstance(unit, r.Rabbit):
                rabbit_count += 1

        # Redraw screen
        screen.fill(colors.BLACK)
        for terrain in t.all():
            terrain.draw(screen)
        for unit in u.all():
            unit.draw(screen)
        pygame.display.flip()

        # End game condition
        if rabbit_count == 0:
            pygame.font.init()
            font = pygame.font.SysFont("Monospace",100)
            win = font.render("You win!!!",1,colors.BLUE)
            screen.blit(win,(0,0))#self.terain
            pygame.display.flip()
            pygame.time.wait(5000)
            m.quit( None )
        if flower_count == 0:
            pygame.font.init()
            font = pygame.font.SysFont("Monospace",100)
            lose = font.render("You lose!!!",1,colors.RED)
            screen.blit(lose,(0,0))#self.terain
            pygame.display.flip()
            pygame.time.wait(5000)
            m.quit( None )