2 (c) 2015 Cameron Ball, Ash Williams
5 Permission is hereby granted, free of charge, to any person obtaining a
6 copy of this software and associated documentation files (the
7 "Software"), to deal in the Software without restriction, including
8 without limitation the rights to use, copy, modify, merge, publish,
9 distribute, and/or sell copies of the Software, and to permit persons to
10 whom the Software is furnished to do so, provided that the above
11 copyright notice(s) and this permission notice appear in all copies of
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
17 THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
18 INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
19 OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
20 OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
21 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22 PERFORMANCE OF THIS SOFTWARE.
27 def pad(output
, numLines
):
28 for i
in range(0, numLines
):
33 def load(filename
, text
= ''):
35 with
open(filename
) as f
:
37 lines
.append(line
.rstrip())
39 linesPerFrame
= int(lines
[0])
40 numLines
= len(lines
) - 1
45 for i
in range(offset
, linesPerFrame
+offset
):
46 output
+= lines
[i
]+"\n"
48 offset
= (i
+2) % numLines
50 print(output
+ "\n" + text
)