| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | Private Attributes | Static Private Attributes | List of all members
validate_patch.SavannahParser Class Reference

parse the More...

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

## Public Member Functions
def | __init__ (self)
def | handle_starttag (self, tag, attrs)
def | handle_endtag (self, tag)
def | handle_data (self, 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.

41 def __init__(self):
42 HTMLParser.__init__(self)
43 # data collected
44 self.patch = None
45
46 # parsing flags and temporary data
47 self._parsingAttachments = 0 # depth of span tag in the attachment block
48 self._currentFileId = None
49 self._currentFileData = ""
50
51 # temporary storage
52
validate_patch.SavannahParser._currentFileId
_currentFileId
Definition: validate_patch.py:48
validate_patch.SavannahParser.__init__
def __init__(self)
Definition: validate_patch.py:41
validate_patch.SavannahParser._parsingAttachments
_parsingAttachments
Definition: validate_patch.py:47
validate_patch.SavannahParser.patch
patch
Definition: validate_patch.py:44
validate_patch.SavannahParser._currentFileData
_currentFileData
Definition: validate_patch.py:49

## Member Function Documentation

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

Definition at line 78 of file validate_patch.py.

78 def handle_data(self, data):
79 if self._currentFileId:
80 data = data.replace("&nbsp;", " ")
81 self._currentFileData += data
82
validate_patch.SavannahParser._currentFileId
_currentFileId
Definition: validate_patch.py:48
validate_patch.SavannahParser.handle_data
def handle_data(self, data)
Definition: validate_patch.py:78
validate_patch.SavannahParser._currentFileData
_currentFileData
Definition: validate_patch.py:49

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

Definition at line 67 of file validate_patch.py.

67 def handle_endtag(self, tag):
68 if tag == "span" and self._parsingAttachments:
69 self._parsingAttachments -= 1
70 elif tag == "a" and self._currentFileId:
71 #print self._currentFileData
72 filename = self._currentFileData.split(":")[-1].strip()
73 #print filename, self._currentFileId
74 self.patch.files.append((filename, int(self._currentFileId)))
75 self._currentFileId = None
76 self._currentFileData = ""
77
validate_patch.SavannahParser._currentFileId
_currentFileId
Definition: validate_patch.py:48
validate_patch.SavannahParser._parsingAttachments
_parsingAttachments
Definition: validate_patch.py:47
validate_patch.SavannahParser.handle_endtag
def handle_endtag(self, tag)
Definition: validate_patch.py:67
validate_patch.SavannahParser._currentFileData
_currentFileData
Definition: validate_patch.py:49

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

Definition at line 53 of file validate_patch.py.

53 def handle_starttag(self, tag, attrs):
54 attrs = dict(attrs)
55 if tag == "html":
56 # new file: new patch data
57 self.patch = PatchData()
58 elif tag == "span":
59 if attrs.get("id", None) == self.__attachments_id__:
60 self._parsingAttachments = 1
61 elif self._parsingAttachments:
62 self._parsingAttachments += 1
63 elif (self._parsingAttachments
64 and tag == "a"
65 and "file_id=" in attrs.get("href", "")):
66 self._currentFileId = attrs["href"].split("file_id=")[-1]
validate_patch.SavannahParser._currentFileId
_currentFileId
Definition: validate_patch.py:48
validate_patch.SavannahParser.handle_starttag
def handle_starttag(self, tag, attrs)
Definition: validate_patch.py:53
validate_patch.SavannahParser._parsingAttachments
_parsingAttachments
Definition: validate_patch.py:47
validate_patch.PatchData
Definition: validate_patch.py:21
validate_patch.SavannahParser.patch
patch
Definition: validate_patch.py:44
validate_patch.SavannahParser.__attachments_id__
string __attachments_id__
Definition: validate_patch.py:40

## 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 49 of file validate_patch.py.

validate_patch.SavannahParser._currentFileId
| private

Definition at line 48 of file validate_patch.py.

validate_patch.SavannahParser._parsingAttachments
| private

Definition at line 47 of file validate_patch.py.

validate_patch.SavannahParser.patch

Definition at line 44 of file validate_patch.py.

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

- GaudiRelease/cmt/validate_patch.py