Module pdi.parser
Python-PDI - Library for Personal Data Interchange. Copyright (C)
2002-2003 Peter Gebauer
Provides with nice wrapper functions for parsing from files, strings
and list of strings.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
fromFile(fileName,
inObject,
bufferSize=4096)
Opens a file and parses it line by line. If nothing unexpected happens
the inObject will be populated and returned.
-
- Parameters:
fileName -
The name of the file to read from.
inObject -
An instance of a pdi.core.Component to populate.
bufferSize -
The read buffer and maximum size per line. Default is 4k.
- Returns:
-
The same instance of pdi.core.Component passed in as the second
argument, only populated.
(type=pdi.core.Component )
|
fromString(data,
inObject,
crlf='\n')
Splits a string on CRLF's and parses them. If nothing unexpected
happens the inObject will be populated and returned.
-
- Parameters:
data -
A string containing the data.
(type=string)
inObject -
An instance of a pdi.core.Component.
(type=pdi.core.Component )
crlf -
Split on this substring.
(type=string)
- Returns:
-
The same instance of pdi.core.Component passed in as the second
argument, only populated.
(type=pdi.core.Component )
|
fromStrings(list,
inObject)
Itterates over a list of strings and parses them. If nothing
unexpected happens the inObject will be populated and returned.
-
- Parameters:
list -
A list with strings.
inObject -
An instance of a pdi.core.Component to populate.
- Returns:
-
The same instance of pdi.core.Component passed in as the second
argument, only populated.
(type=pdi.core.Component )
|
RULE_MAY
-
- Type:
-
int
- Value:
|
RULE_MUST
-
- Type:
-
int
- Value:
|
RULE_NOT
-
- Type:
-
int
- Value:
|
RULE_RECOMMENDED
-
- Type:
-
int
- Value:
|