My favorites | Sign in
Logo
             
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/python

import Axon
from Axon.background import background
from Axon.Handle import Handle
from Kamaelia.UI.Pygame.Ticker import Ticker
from Kamaelia.Chassis.Pipeline import Pipeline
from Kamaelia.File.ReadFileAdaptor import ReadFileAdaptor
import time

bg = background(slowmo=0.01).start()

ticker1 = Handle(Pipeline(
Ticker(background_colour=(128,48,128),
render_left = 1,
render_top = 1,
render_right = 600,
render_bottom = 200,
position = (100, 250),
)
)
).activate()
ticker2 = Handle(Pipeline(
Ticker(background_colour=(128,48,128),
render_left = 1,
render_top = 1,
render_right = 600,
render_bottom = 200,
position = (100, 0),
)
)
).activate()

ticker3 = Handle(Pipeline(
Ticker(background_colour=(128,48,128),
render_left = 1,
render_top = 1,
render_right = 600,
render_bottom = 200,
position = (100, 500),
)
)
).activate()

for line in file("Ulysses", 'r+b'):
line = line.rstrip() # kill the newlines - printing them in reverse order messes with the ticker.
ticker1.put(line[::-1], "inbox")
ticker2.put(line, "inbox")

time.sleep(5)

for line in file("Ulysses", 'r+b'):
ticker3.put(line, "inbox")

time.sleep(10)

# we'll unceremoniously die now, since the ticker has no way to indicate when it's done drawing, or indeed to cleanly remove it from the pygame window. Sending
# a producerfinished would end it, but it'd remain in pygame.


Show details Hide details

Change log

r4527 by ms_ on Jun 19, 2008   Diff
Rename

Go to: 
Sign in to write a code review

Older revisions

r4520 by ms_ on Jun 19, 2008   Diff
All changed to use "Handle" not
"LikeFile"

r4509 by ms_ on Jun 19, 2008   Diff
Both changed to use the new "likefile"
before it's renamed "handle"

Michael.
r4500 by ms_ on Jun 19, 2008   Diff
Branch for merging the rewritten
LikeFile. (ie as a bugfix...)

Michael.
All revisions of this file

File info

Size: 2124 bytes, 60 lines

File properties

svn:executable
*
Hosted by Google Code