import sys, os, io, time

import pygame
import picamera

from pygame.locals import *
from camz import surface, camera


surf = surface.FBSurface()
camera = camera.Camera()

camera.startRecording()

running = True

while running:
    cam = pygame.image.load(camera.captureStream())

    text = surf.font.render(time.ctime(), False, (255, 0, 0))
    
    cam.blit(text, (1,1))

    surf.display.blit(cam, (0,0))
    pygame.display.update()

    for event in pygame.event.get():
        if event.type in (QUIT, KEYDOWN):
            running = False

camera.writeStream('test.h264')

camera.stopRecording()

@@ -3,21 +3,8 @@
 port
- sys, os, io,
  tim
@@ -23,24 +23,8 @@
 game
-%0Aimport picamera
 %0A%0Afr

Clean up imports