Skip to content

Commit

Permalink
Remove 'steel.bit' to 'steel.bits' in preparation for a bigger move
Browse files Browse the repository at this point in the history
  • Loading branch information
gulopine committed Sep 22, 2013
1 parent 212c638 commit 1ae9dc3
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
20 changes: 10 additions & 10 deletions examples/images/gif.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ def __str__(self):
return '#%x%x%x' % (self.red, self.green, self.blue)


class ScreenInfoBits(bit.Structure):
has_color_map = bit.Flag()
color_resolution = bit.Integer(size=3) + 1
bit.Reserved(size=1)
bits_per_pixel = bit.Integer(size=3) + 1
class ScreenInfoBits(bits.Structure):
has_color_map = bits.Flag()
color_resolution = bits.Integer(size=3) + 1
bits.Reserved(size=1)
bits_per_pixel = bits.Integer(size=3) + 1


class ScreenDescriptor(byte.Structure, endianness=byte.LittleEndian):
Expand All @@ -41,11 +41,11 @@ def aspect_ratio(self):
return (self.pixel_ratio + 15) / 64


class ImageInfoBits(bit.Structure):
has_color_map = bit.Flag()
is_interlaced = bit.Flag()
bit.Reserved(size=3)
bits_per_pixel = bit.Integer(size=3) + 1
class ImageInfoBits(bits.Structure):
has_color_map = bits.Flag()
is_interlaced = bits.Flag()
bits.Reserved(size=3)
bits_per_pixel = bits.Integer(size=3) + 1


class ImageDescriptor(byte.Structure):
Expand Down
8 changes: 4 additions & 4 deletions examples/images/tga.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ class ColorMap(byte.Structure):
entry_size = byte.Integer(size=1)


class AlphaOrigin(bit.Structure):
bit.Reserved(size=2)
image_origin = bit.Integer(size=2, choices=ORIGINS)
alpha_depth = bit.Integer(size=4)
class AlphaOrigin(bits.Structure):
bits.Reserved(size=2)
image_origin = bits.Integer(size=2, choices=ORIGINS)
alpha_depth = bits.Integer(size=4)


class TGA(byte.Structure, endianness=byte.LittleEndian):
Expand Down
12 changes: 6 additions & 6 deletions examples/mods/_669.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ def __unicode__(self):
return self.title


class Note(bit.Structure):
pitch = bit.Integer(size=6)
sample = bit.Integer(size=6)
volume = bit.Integer(size=4)
command = bit.Integer(size=4)
command_value = bit.Integer(size=4)
class Note(bits.Structure):
pitch = bits.Integer(size=6)
sample = bits.Integer(size=6)
volume = bits.Integer(size=4)
command = bits.Integer(size=4)
command_value = bits.Integer(size=4)

@sample.getter
def sample(self, index):
Expand Down
18 changes: 9 additions & 9 deletions examples/mods/mod.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from steel import bit, byte, common


class FineTune(bit.Structure):
bit.Reserved(size=4)
value = bit.Integer(size=4)
class FineTune(bits.Structure):
bits.Reserved(size=4)
value = bits.Integer(size=4)


class SampleLength(bit.Integer):
class SampleLength(bits.Integer):
def encode(self, value):
return int(value / 2)

Expand Down Expand Up @@ -35,11 +35,11 @@ def __unicode__(self):
return self.name


class Note(bit.Structure):
sample_hi = bit.Integer(size=4)
period = bit.Integer(size=12)
sample_lo = bit.Integer(size=4)
effect = bit.Integer(size=12)
class Note(bits.Structure):
sample_hi = bits.Integer(size=4)
period = bits.Integer(size=12)
sample_lo = bits.Integer(size=4)
effect = bits.Integer(size=12)

@property
def sample(self):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1ae9dc3

Please sign in to comment.