Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
MimetypesRegistry.mime_types.magic.magicTest Class Reference
Collaboration diagram for MimetypesRegistry.mime_types.magic.magicTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def test
def compare

Public Attributes

 offset
 type
 msg
 subTests
 op
 mask
 value

Static Public Attributes

string c = ''
 s = s+c
 data = s

Detailed Description

Definition at line 273 of file magic.py.


Constructor & Destructor Documentation

def MimetypesRegistry.mime_types.magic.magicTest.__init__ (   self,
  offset,
  t,
  op,
  value,
  msg,
  mask = None 
)

Definition at line 274 of file magic.py.

00274 
00275     def __init__(self, offset, t, op, value, msg, mask = None):
00276         if t.count('&') > 0:
00277             mask = strToNum(t[t.index('&')+1:])
00278             t = t[:t.index('&')]
00279         if type(offset) == type('a'):
00280             self.offset = strToNum(offset)
00281         else:
00282             self.offset = offset
00283         self.type = t
00284         self.msg = msg
00285         self.subTests = []
00286         self.op = op
00287         self.mask = mask
00288         self.value = value

Here is the call graph for this function:


Member Function Documentation

Definition at line 304 of file magic.py.

00304 
    def compare(self, data):

Definition at line 289 of file magic.py.

00289 
00290     def test(self, data):
00291         if self.mask:
00292             data = data & self.mask
00293         if self.op == '=':
00294             if self.value == data: return self.msg
00295         elif self.op ==  '<':
00296             pass
00297         elif self.op ==  '>':
00298             pass
00299         elif self.op ==  '&':
00300             pass
00301         elif self.op ==  '^':
00302             pass
00303         return None


Member Data Documentation

Definition at line 308 of file magic.py.

Definition at line 313 of file magic.py.

Definition at line 286 of file magic.py.

Definition at line 283 of file magic.py.

Definition at line 279 of file magic.py.

Definition at line 285 of file magic.py.

Definition at line 311 of file magic.py.

Definition at line 284 of file magic.py.

Definition at line 282 of file magic.py.

Definition at line 287 of file magic.py.


The documentation for this class was generated from the following file: