Back to index

enigmail  1.4.3
Public Member Functions | Static Public Attributes
expandlibs.LibDescriptor Class Reference

List of all members.

Public Member Functions

def __init__
def __str__

Static Public Attributes

list KEYS = ['OBJS', 'LIBS']

Detailed Description

Definition at line 94 of file expandlibs.py.


Constructor & Destructor Documentation

def expandlibs.LibDescriptor.__init__ (   self,
  content = None 
)
Creates an instance of a lib descriptor, initialized with contents
from a list of strings when given. This is intended for use with
file.readlines()

Definition at line 97 of file expandlibs.py.

00097 
00098     def __init__(self, content=None):
00099         '''Creates an instance of a lib descriptor, initialized with contents
00100         from a list of strings when given. This is intended for use with
00101         file.readlines()'''
00102         if isinstance(content, list) and all([isinstance(item, str) for item in content]):
00103             pass
00104         elif content is not None:
00105             raise TypeError("LibDescriptor() arg 1 must be None or a list of strings")
00106         super(LibDescriptor, self).__init__()
00107         for key in self.KEYS:
00108             self[key] = []
00109         if not content:
00110             return
00111         for key, value in [(s.strip() for s in item.split('=', 2)) for item in content if item.find('=') >= 0]:
00112             if key in self.KEYS:
00113                 self[key] = value.split()


Member Function Documentation

Serializes the lib descriptor

Definition at line 114 of file expandlibs.py.

00114 
00115     def __str__(self):
00116         '''Serializes the lib descriptor'''
00117         return '\n'.join('%s = %s' % (k, ' '.join(self[k])) for k in self.KEYS if len(self[k]))


Member Data Documentation

list expandlibs.LibDescriptor.KEYS = ['OBJS', 'LIBS'] [static]

Definition at line 95 of file expandlibs.py.


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