Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Properties
configparser.ParsingError Class Reference
Inheritance diagram for configparser.ParsingError:
Inheritance graph
[legend]
Collaboration diagram for configparser.ParsingError:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def filename
def filename
def append
def __repr__

Public Attributes

 source
 errors
 args

Properties

 message = property(_get_message, _set_message)

Detailed Description

Raised when a configuration file does not follow legal syntax.

Definition at line 293 of file configparser.py.


Constructor & Destructor Documentation

def configparser.ParsingError.__init__ (   self,
  source = None,
  filename = None 
)

Definition at line 296 of file configparser.py.

00296 
00297     def __init__(self, source=None, filename=None):
00298         # Exactly one of `source'/`filename' arguments has to be given.
00299         # `filename' kept for compatibility.
00300         if filename and source:
00301             raise ValueError("Cannot specify both `filename' and `source'. "
00302                              "Use `source'.")
00303         elif not filename and not source:
00304             raise ValueError("Required argument `source' not given.")
00305         elif filename:
00306             source = filename
00307         Error.__init__(self, 'Source contains parsing errors: %s' % source)
00308         self.source = source
00309         self.errors = []
00310         self.args = (source, )

Here is the caller graph for this function:


Member Function Documentation

def configparser.Error.__repr__ (   self) [inherited]

Definition at line 168 of file configparser.py.

00168 
00169     def __repr__(self):
00170         return self.message

def configparser.ParsingError.append (   self,
  lineno,
  line 
)

Definition at line 331 of file configparser.py.

00331 
00332     def append(self, lineno, line):
00333         self.errors.append((lineno, line))
00334         self.message += '\n\t[line %2d]: %s' % (lineno, line)
00335 

Here is the caller graph for this function:

Deprecated, use `source'.

Definition at line 312 of file configparser.py.

00312 
00313     def filename(self):
00314         """Deprecated, use `source'."""
00315         warnings.warn(
00316             "The 'filename' attribute will be removed in future versions.  "
00317             "Use 'source' instead.",
00318             DeprecationWarning, stacklevel=2
00319         )
00320         return self.source

Here is the call graph for this function:

Here is the caller graph for this function:

def configparser.ParsingError.filename (   self,
  value 
)
Deprecated, user `source'.

Definition at line 322 of file configparser.py.

00322 
00323     def filename(self, value):
00324         """Deprecated, user `source'."""
00325         warnings.warn(
00326             "The 'filename' attribute will be removed in future versions.  "
00327             "Use 'source' instead.",
00328             DeprecationWarning, stacklevel=2
00329         )
00330         self.source = value

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Reimplemented in configparser.MissingSectionHeaderError.

Definition at line 309 of file configparser.py.

Definition at line 308 of file configparser.py.

Reimplemented in configparser.MissingSectionHeaderError.

Definition at line 307 of file configparser.py.


Property Documentation

configparser.Error.message = property(_get_message, _set_message) [static, inherited]

Definition at line 162 of file configparser.py.


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