/[gentoo-src]/portage/pym/portage_metadata.py
Gentoo

Contents of /portage/pym/portage_metadata.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download) (as text)
Sun Nov 7 21:34:51 2004 UTC (9 years, 8 months ago) by ferringb
Branch: MAIN
CVS Tags: portage_041204, HEAD
Branch point for: portage_2_1
Changes since 1.1: +1 -2 lines
File MIME type: text/x-python
removed an uneeded import string.

1 #!/usr/bin/python -O
2 # Copyright 1999-2004 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header: /var/cvsroot/gentoo-src/portage/pym/portage_metadata.py,v 1.1 2004/11/07 13:31:43 ferringb Exp $
5
6 from xml.sax import saxutils, make_parser, handler
7 from xml.sax.handler import feature_namespaces
8
9 class Metadata_XML(handler.ContentHandler):
10 _inside_herd="No"
11 _inside_maintainer="No"
12 _inside_email="No"
13 _inside_longdescription="No"
14
15 _herds = []
16 _maintainers = []
17 _longdescription = ""
18
19 def startElement(self, tag, attr):
20 if tag == "herd":
21 self._inside_herd="Yes"
22 if tag == "longdescription":
23 self._inside_longdescription="Yes"
24 if tag == "maintainer":
25 self._inside_maintainer="Yes"
26 if tag == "email":
27 self._inside_email="Yes"
28
29 def endElement(self, tag):
30 if tag == "herd":
31 self._inside_herd="No"
32 if tag == "longdescription":
33 self._inside_longdescription="No"
34 if tag == "maintainer":
35 self._inside_maintainer="No"
36 if tag == "email":
37 self._inside_email="No"
38
39 def characters(self, contents):
40 if self._inside_herd == "Yes":
41 self._herds.append(contents)
42
43 if self._inside_longdescription == "Yes":
44 self._longdescription = contents
45
46 if self._inside_maintainer=="Yes" and self._inside_email=="Yes":
47 self._maintainers.append(contents)

  ViewVC Help
Powered by ViewVC 1.1.20