| # Gaudi Framework, version v22r2 |

Home |  | Generated: Tue May 10 2011

Public Member Functions | Public Attributes | Private Attributes | Static Private Attributes

# validate_patch::SavannahParser Class Reference

parse the More...

Inheritance diagram for validate_patch::SavannahParser:
[legend]
Collaboration diagram for validate_patch::SavannahParser:
[legend]

List of all members.

## Public Member Functions
def | __init__
def | handle_starttag
def | handle_endtag
def | handle_data
## Public Attributes
| patch
## Private Attributes
| _parsingAttachments
| _currentFileId
| _currentFileData
## Static Private Attributes
string | __attachments_id__ = "hidsubpartcontentattached"

## Detailed Description

parse the

Definition at line 39 of file validate_patch.py.

## Constructor & Destructor Documentation

def validate_patch::SavannahParser::__init__ | ( |  | self ) |

Definition at line 41 of file validate_patch.py.

    00042                       :
    00043         HTMLParser.__init__(self)
    00044         # data collected
    00045         self.patch = None
    00046
    00047         # parsing flags and temporary data
    00048         self._parsingAttachments = 0 # depth of span tag in the attachment block
    00049         self._currentFileId = None
    00050         self._currentFileData = ""
    00051
    00052         # temporary storage

## Member Function Documentation

def validate_patch::SavannahParser::handle_data | ( |  | self,
|  |  | data
| ) |  |

Definition at line 78 of file validate_patch.py.

    00079                                :
    00080         if self._currentFileId:
    00081             data = data.replace("&nbsp;", " ")
    00082             self._currentFileData += data

def validate_patch::SavannahParser::handle_endtag | ( |  | self,
|  |  | tag
| ) |  |

Definition at line 67 of file validate_patch.py.

    00068                                 :
    00069         if tag == "span" and self._parsingAttachments:
    00070             self._parsingAttachments -= 1
    00071         elif tag == "a" and self._currentFileId:
    00072             #print self._currentFileData
    00073             filename = self._currentFileData.split(":")[-1].strip()
    00074             #print filename, self._currentFileId
    00075             self.patch.files.append((filename, int(self._currentFileId)))
    00076             self._currentFileId = None
    00077             self._currentFileData = ""

def validate_patch::SavannahParser::handle_starttag | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 53 of file validate_patch.py.

    00054                                          :
    00055         attrs = dict(attrs)
    00056         if tag == "html":
    00057             # new file: new patch data
    00058             self.patch = PatchData()
    00059         elif tag == "span":
    00060             if attrs.get("id", None) == self.__attachments_id__:
    00061                 self._parsingAttachments = 1
    00062             elif self._parsingAttachments:
    00063                 self._parsingAttachments += 1
    00064         elif (self._parsingAttachments
    00065               and tag == "a"
    00066               and "file_id=" in attrs.get("href", "")):
                self._currentFileId = attrs["href"].split("file_id=")[-1]

## Member Data Documentation

string validate_patch::SavannahParser::__attachments_id__ = "hidsubpartcontentattached"`[static, private]`

Definition at line 40 of file validate_patch.py.

validate_patch::SavannahParser::_currentFileData`[private]`

Definition at line 41 of file validate_patch.py.

validate_patch::SavannahParser::_currentFileId`[private]`

Definition at line 41 of file validate_patch.py.

validate_patch::SavannahParser::_parsingAttachments`[private]`

Definition at line 41 of file validate_patch.py.

validate_patch::SavannahParser::patch

Definition at line 41 of file validate_patch.py.

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

- validate_patch.py

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines