| # Gaudi Framework, version v21r7 |

Home |  | Generated: 22 Jan 2010

# 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.

## Member Function Documentation

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

Definition at line 41 of file validate_patch.py.

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

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

Definition at line 53 of file validate_patch.py.

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

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

Definition at line 67 of file validate_patch.py.

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

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

Definition at line 78 of file validate_patch.py.

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

## Member Data Documentation

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

Definition at line 40 of file validate_patch.py.

validate_patch::SavannahParser::patch

Definition at line 44 of file validate_patch.py.

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

Definition at line 47 of file validate_patch.py.

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

Definition at line 48 of file validate_patch.py.

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

Definition at line 49 of file validate_patch.py.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r7/GaudiRelease/cmt/validate_patch.py