Update of /cvsroot/wisp/wisp/users/dig
In directory sc8-pr-cvs1:/tmp/cvs-serv17848
Modified Files:
bits.py linkie.py
Log Message:
moved the _skipped slot from Bits to Linkie
Index: bits.py
===================================================================
RCS file: /cvsroot/wisp/wisp/users/dig/bits.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- bits.py 26 Apr 2003 21:31:19 -0000 1.8
+++ bits.py 26 Apr 2003 21:33:49 -0000 1.9
@@ -11,8 +11,7 @@
from types import SliceType
class Bits (object):
- __slots__ = ['_contents', '_skipped', '_byte_order',
- 'emit_wyde', 'emit_tetra']
+ __slots__ = ['_contents', '_byte_order', 'emit_wyde', 'emit_tetra']
def __init__ (this, byte_order = None):
this._contents = array('c')
if byte_order == None: pass
@@ -23,25 +22,18 @@
this.emit_wyde = this.emit_bewyde
this.emit_tetra = this.emit_betetra
else: raise "Unknown byte order", byte_order
- this._skipped = 0
this._byte_order = byte_order
def emit_byte (this, b):
- if this._skipped <> 0: raise "Events out of order", this
this._contents.append(chr(b & 0xff))
def emit_bewyde (this, w):
- if this._skipped <> 0: raise "Events out of order", this
this._contents.fromstring(pack('>H', w)) # FIXME?
def emit_lewyde (this, w):
- if this._skipped <> 0: raise "Events out of order", this
this._contents.fromstring(pack('<H', w)) # FIXME?
def emit_betetra (this, t):
- if this._skipped <> 0: raise "Events out of order", this
this._contents.fromstring(pack('>L', t)) # FIXME?
def emit_letetra (this, t):
- if this._skipped <> 0: raise "Events out of order", this
this._contents.fromstring(pack('<L', t)) # FIXME?
def emit_string (this, s):
- if this._skipped <> 0: raise "Events out of order", this
this._contents.fromstring(s)
def from_array (this, a):
this._contents.extend(a)
Index: linkie.py
===================================================================
RCS file: /cvsroot/wisp/wisp/users/dig/linkie.py,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- linkie.py 26 Apr 2003 21:22:20 -0000 1.42
+++ linkie.py 26 Apr 2003 21:33:49 -0000 1.43
@@ -12,6 +12,7 @@
class Linkie (Bits):
def __init__ (this, byte_order = None):
Bits.__init__(this, byte_order)
+ this._skipped = 0
this._byte_order = byte_order
this._symbols = [] # symbol -> address
this._alignment = 1 # minimal required alignment constraint
|