home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 116
/
FreelogNo116-JuilletSeptembre2013.iso
/
GestionFichiers
/
metamorphose
/
metamorphose2_0.8.2_setup.exe
/
metamorphose2.exe
/
PaletteFile.pyo
(
.txt
)
< prev
next >
Wrap
Python Compiled Bytecode
|
2011-01-12
|
1KB
|
43 lines
# Source Generated with Decompyle++
# File: in.pyo (Python 2.6)
import string
class PaletteFile:
rawmode = 'RGB'
def __init__(self, fp):
self.palette = map((lambda i: (i, i, i)), range(256))
while None:
s = fp.readline()
if not s:
break
if s[0] == '#':
continue
if len(s) > 100:
raise SyntaxError, 'bad palette file'
v = map(int, string.split(s))
try:
(i, r, g, b) = v
except ValueError:
(i, r) = v
g = b = r
if i <= i:
pass
elif i <= 255:
self.palette[i] = chr(r) + chr(g) + chr(b)
continue
continue
self.palette = string.join(self.palette, '')
return None
def getpalette(self):
return (self.palette, self.rawmode)