[gentoo-commits] proj/javatoolkit:master commit in: src/py/javatoolkit/xml/

2017-09-08 Thread Patrice Clement
commit: 358365183a2ece6b193f5b766e8d8e89e756f98a
Author: Patrice Clement  gentoo  org>
AuthorDate: Fri Sep  8 21:36:35 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Fri Sep  8 21:36:55 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=35836518

decode bytes string to unicode string

 src/py/javatoolkit/xml/DomRewriter.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/py/javatoolkit/xml/DomRewriter.py 
b/src/py/javatoolkit/xml/DomRewriter.py
index 7cd5a2f..d1200b6 100644
--- a/src/py/javatoolkit/xml/DomRewriter.py
+++ b/src/py/javatoolkit/xml/DomRewriter.py
@@ -71,6 +71,6 @@ class DomRewriter:
 
 
 def write(self,stream):
-stream.write(self.document.toxml("utf-8"))
+stream.write(self.document.toxml('utf-8').decode('utf-8'))
 
 # vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap:



[gentoo-commits] proj/javatoolkit:master commit in: src/py/

2017-08-13 Thread Patrice Clement
commit: 9ab6d637e57caba3be41c3379d50b96184afd5e5
Author: Patrice Clement  gentoo  org>
AuthorDate: Sun Aug 13 22:13:41 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Sun Aug 13 22:14:59 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=9ab6d637

rework SaxRewriterBase and SaxRewriter classes

 src/py/xml-rewrite-2.py | 22 ++
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/src/py/xml-rewrite-2.py b/src/py/xml-rewrite-2.py
index 1135cc3..c56de1d 100755
--- a/src/py/xml-rewrite-2.py
+++ b/src/py/xml-rewrite-2.py
@@ -79,7 +79,7 @@ class DomRewriter:
 
 
 class StreamRewriterBase:
-def __init__(self, elems=[], attributes=[], values=[], index,
+def __init__(self, elems, attributes, values, index,
  sourceElems=[], sourceAttributes=[], sourceValues=[],
  targetElems=[], targetAttributes=[], targetValues=[]):
 self.buffer = io.StringIO()
@@ -170,6 +170,20 @@ class SaxRewriter(XMLGenerator, StreamRewriterBase):
 def __init__(self, elems, attributes, values, index,
  sourceElems=[], sourceAttributes=[], sourceValues=[],
  targetElems=[], targetAttributes=[], targetValues=[]):
+if not sourceElems:
+sourceElems = []
+if not sourceAttributes:
+sourceAttributes = []
+if not sourceValues:
+sourceValues = []
+if not targetElems:
+targetElems = []
+if not targetAttributes:
+targetAttributes = []
+if not targetValues:
+targetValues = []
+if not index:
+index = 0
 StreamRewriterBase.__init__(self, elems, attributes, values, index,
 sourceElems, sourceAttributes, 
sourceValues,
 targetElems, targetAttributes, 
targetValues)
@@ -327,9 +341,9 @@ parameters will break the script."""
 
 def get_rewriter(options):
 if options.index or options.doDelete or options.gentoo_classpath:
-# java-ant-2.eclass does not use these options so we can 
optimize the ExpatWriter
-# and let the DomRewriter do these. Also keeps the index option
-# compatible for sure.
+# java-ant-2.eclass does not use these options so we can optimize 
the ExpatWriter
+# and let the DomRewriter do these. Also keeps the index option
+# compatible for sure.
 rewriter = DomRewriter(
 options.elements,
 options.attributes,



[gentoo-commits] proj/javatoolkit:master commit in: src/py/

2017-08-13 Thread Patrice Clement
commit: c89b5735ea1e57c2f0b7ca5db181b53432d11c4b
Author: Patrice Clement  gentoo  org>
AuthorDate: Sun Aug 13 21:14:02 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Sun Aug 13 21:14:02 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=c89b5735

assign a default value to these args

 src/py/xml-rewrite-2.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/py/xml-rewrite-2.py b/src/py/xml-rewrite-2.py
index 5c115eb..1135cc3 100755
--- a/src/py/xml-rewrite-2.py
+++ b/src/py/xml-rewrite-2.py
@@ -79,7 +79,7 @@ class DomRewriter:
 
 
 class StreamRewriterBase:
-def __init__(self, elems, attributes, values, index,
+def __init__(self, elems=[], attributes=[], values=[], index,
  sourceElems=[], sourceAttributes=[], sourceValues=[],
  targetElems=[], targetAttributes=[], targetValues=[]):
 self.buffer = io.StringIO()



[gentoo-commits] proj/javatoolkit:master commit in: src/py/

2017-08-13 Thread Patrice Clement
commit: beda047cd7289f0e1c4f8f9fa55bee3910b91fb4
Author: Patrice Clement  gentoo  org>
AuthorDate: Sun Aug 13 19:06:09 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Sun Aug 13 19:06:09 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=beda047c

reformat header

 src/py/class-version-verify.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/py/class-version-verify.py b/src/py/class-version-verify.py
index a53b10d..8b5598f 100755
--- a/src/py/class-version-verify.py
+++ b/src/py/class-version-verify.py
@@ -1,9 +1,7 @@
 #!/usr/bin/env python3
-#
 # Copyright(c) 2005, Thomas Matthijs 
 # Copyright(c) 2005, Gentoo Foundation
-#
-# Licensed under the GNU General Public License, v2
+# Distributed under the terms of the GNU General Public Licence v2
 
 import os
 import sys



[gentoo-commits] proj/javatoolkit:master commit in: src/py/

2017-08-13 Thread Patrice Clement
commit: d0bce58024d109dfc5a91a074841836e92fe542b
Author: Patrice Clement  gentoo  org>
AuthorDate: Sun Aug 13 19:02:06 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Sun Aug 13 19:02:06 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=d0bce580

remove useless header once again

 src/py/xml-rewrite.py | 16 
 1 file changed, 16 deletions(-)

diff --git a/src/py/xml-rewrite.py b/src/py/xml-rewrite.py
index b164b6e..bb9141c 100755
--- a/src/py/xml-rewrite.py
+++ b/src/py/xml-rewrite.py
@@ -1,18 +1,6 @@
 #!/usr/bin/env python3
-# -*- coding: UTF-8 -*-
-
 # Copyright 2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public Licence v2
-# $Header: /var/cvsroot/gentoo-src/javatoolkit/src/bsfix/xml-rewrite.py,v 1.6 
2005/07/19 10:35:18 axxo Exp $
-
-# Author: Saleem Abdulrasool 
-# Maintainer: Gentoo Java Herd 
-# Python based XML modifier
-
-# ChangeLog
-# Saleem A. 
-#  December 23, 2004 - Initial Write
-#  December 24, 2004 - Added usage information
 
 
 import sys
@@ -87,10 +75,6 @@ def main():
 print("ERROR: " + message)
 sys.exit(1)
 
-
-#if len(sys.argv) == 1:
-#usage(True)
-
 options_list = [
 make_option("-f", "--file", type="string", dest="file",
 help="Read input from file instead of stdin"),



[gentoo-commits] proj/javatoolkit:master commit in: src/py/

2017-08-12 Thread Patrice Clement
commit: 520e5210196c081acee700cb1fcde0ad558b3ccb
Author: Patrice Clement  gentoo  org>
AuthorDate: Fri Aug 11 19:44:37 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Sat Aug 12 08:50:00 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=520e5210

reformat usage text

 src/py/xml-rewrite-2.py | 25 +---
 src/py/xml-rewrite-3.py | 52 +
 2 files changed, 36 insertions(+), 41 deletions(-)

diff --git a/src/py/xml-rewrite-2.py b/src/py/xml-rewrite-2.py
index 2b4702d..5c115eb 100755
--- a/src/py/xml-rewrite-2.py
+++ b/src/py/xml-rewrite-2.py
@@ -186,17 +186,20 @@ class SaxRewriter(XMLGenerator, StreamRewriterBase):
 
 def main():
 usage = """Copyright 2004, 2006, 2007, 2017 Gentoo Foundation
-Distributed under the terms of the GNU General Public Lincense v2
-Please contact the Gentoo Java Team  with problems.
+Distributed under the terms of the GNU General Public Licence v2
+
+Reach out to the Gentoo Java Team  for questions/problems.
+
 Usage:
-xml-rewrite.py [-f file] --delete [-g] -e tag [-e tag] -a attribute [-a 
attribute] [-i index]
-xml-rewrite.py [-f file] --change [-g] -e tag [-e tag] -a attribute -v 
value [-a attribute -v value]
-   [--source-element tag] [--source-attribute attribute --source-value 
value]
-   [--target-element tag] [--target-attribute attribute --target-value 
value] [-i index]
-Or:
-xml-rewrite.py [-f file] -g
-
-If the -f parameter is not utilized, the script will read and
+xml-rewrite-2.py [-f file] --delete [-g] -e tag [-e tag] -a attribute [-a 
attribute] [-i index]
+xml-rewrite-2.py [-f file] --change [-g] -e tag [-e tag] -a attribute -v 
value [-a attribute -v value]
+xml-rewrite-2.py [-f file] -g
+
+Additional parameters:
+[--source-element tag] [--source-attribute attribute --source-value value]
+[--target-element tag] [--target-attribute attribute --target-value value] 
[-i index]
+
+If the -f parameter is not used, the script will read and
 write to stdin and stdout respectively. The use of quotes on
 parameters will break the script."""
 
@@ -371,4 +374,4 @@ parameters will break the script."""
 
 
 if __name__ == '__main__':
-main()
\ No newline at end of file
+main()

diff --git a/src/py/xml-rewrite-3.py b/src/py/xml-rewrite-3.py
index b64ceda..04131e4 100755
--- a/src/py/xml-rewrite-3.py
+++ b/src/py/xml-rewrite-3.py
@@ -12,35 +12,27 @@ from javatoolkit.xml.SaxRewriter import SaxRewriter
 
 
 def main():
-usage = "XML Rewrite Python Module"
-usage += "Copyright 2004,2006,2007 Gentoo Foundation\n"
-usage += "Distributed under the terms of the GNU General Public Lincense 
v2\n"
-usage += "Please contact the Gentoo Java Team  with 
problems.\n"
-usage += "\n"
-usage += "Usage:\n"
-usage += "  " + \
-sys.argv[0] + " [-f file] --delete [-g] -n tag [-n tag] -m attribute 
[-m attribute] [-i index]\n"
-usage += "  " + \
-sys.argv[0] + " [-f file] --change [-g] -e tag [-e tag] -a attribute 
-v value [-a attribute -v value] \\\n"
-usage += "  [--source-element tag] [--source-attribute attribute 
--source-value value] \\\n"
-usage += "  [--target-element tag] [--target-attribute attribute 
--target-value value] [-i index]\n"
-usage += "Or:\n"
-usage += "  " + \
-sys.argv[0] + " [-f file] --javadoc --source-directory dir 
[--source-directory dir2] --output-directory dir3 \n"
-usage += "Or:\n"
-usage += "  " + sys.argv[0] + " [-f file] -g\n"
-usage += "\n"
-usage += "Or:\n"
-usage += "  " + sys.argv[0] + " [-f file] --maven-cleaning\n"
-usage += "\n"
-usage += "Or for more detailed help:\n"
-usage += "  " + sys.argv[0] + " -h\n"
-usage += "\n"
-usage += "Multiple actions can be done simultaneously\n"
-usage += "\n"
-usage += "If the -f parameter is not utilized, the script will read and\n"
-usage += "write to stdin and stdout respectively.  The use of quotes on\n"
-usage += "parameters will break the script.\n"
+usage = """Copyright 2004, 2006, 2007, 2017 Gentoo Foundation
+Distributed under the terms of the GNU General Public Licence v2
+
+Reach out to the Gentoo Java Team  for questions/problems.
+
+Usage:
+xml-rewrite-3.py [-f file] --delete [-g] -n tag [-n tag] -m attribute [-m 
attribute] [-i index]
+xml-rewrite-3.py [-f file] --change [-g] -e tag [-e tag] -a attribute -v 
value [-a attribute -v value]
+xml-rewrite-3.py [-f file] --javadoc --source-directory dir 
[--source-directory dir2] --output-directory dir3
+xml-rewrite-3.py [-f file] --maven-cleaning
+xml-rewrite-3.py [-f file] -g
+
+Additional parameters:
+[--source-element tag] [--source-attribute attribute --source-value value]
+[--target-element tag] [--target-attribute attribute --target-value value] 

[gentoo-commits] proj/javatoolkit:master commit in: src/py/

2017-08-12 Thread Patrice Clement
commit: 75a7b951a560d5325eac83df884aab9db0d73139
Author: Patrice Clement  gentoo  org>
AuthorDate: Fri Aug 11 17:38:09 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Sat Aug 12 08:50:00 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=75a7b951

reorganise imports

 src/py/xml-rewrite-2.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/py/xml-rewrite-2.py b/src/py/xml-rewrite-2.py
index 42cb7d3..721147b 100755
--- a/src/py/xml-rewrite-2.py
+++ b/src/py/xml-rewrite-2.py
@@ -2,10 +2,12 @@
 # Copyright 2004-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public Licence v2
 
+
 import sys
 import io
 from xml.sax.saxutils import quoteattr, escape
 from optparse import OptionParser, make_option
+from xml.sax.saxutils import XMLGenerator
 
 
 def add_gentoo_classpath(document):
@@ -159,9 +161,6 @@ class ExpatRewriter(StreamRewriterBase):
 self.p(escape(data))
 
 
-from xml.sax.saxutils import XMLGenerator
-
-
 class SaxRewriter(XMLGenerator, StreamRewriterBase):
 """
 Using Sax gives us the support for writing back doctypes and all easily



[gentoo-commits] proj/javatoolkit:master commit in: src/py/

2017-08-12 Thread Patrice Clement
commit: 8dddc208c5c24c559e4a5308926f29ae1a3bf723
Author: Patrice Clement  gentoo  org>
AuthorDate: Fri Aug 11 17:35:11 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Sat Aug 12 08:50:00 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=8dddc208

remove useless or statements

In fact, those statements are not needed since the constructor relies on
keyword arguments.

 src/py/xml-rewrite-2.py | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/py/xml-rewrite-2.py b/src/py/xml-rewrite-2.py
index 030a939..42cb7d3 100755
--- a/src/py/xml-rewrite-2.py
+++ b/src/py/xml-rewrite-2.py
@@ -82,15 +82,15 @@ class StreamRewriterBase:
  targetElems=[], targetAttributes=[], targetValues=[]):
 self.buffer = io.StringIO()
 self.__write = self.buffer.write
-self.elems = elems or []
-self.attributes = attributes or []
-self.values = values or []
-self.sourceElems = sourceElems or []
-self.sourceAttributes = sourceAttributes or []
-self.sourceValues = sourceValues or []
-self.targetElems = targetElems or []
-self.targetAttributes = targetAttributes or []
-self.targetValues = targetValues or []
+self.elems = elems
+self.attributes = attributes
+self.values = values
+self.sourceElems = sourceElems
+self.sourceAttributes = sourceAttributes
+self.sourceValues = sourceValues
+self.targetElems = targetElems
+self.targetAttributes = targetAttributes
+self.targetValues = targetValues
 
 def p(self, str):
 self.__write(str)



[gentoo-commits] proj/javatoolkit:master commit in: src/py/

2017-08-12 Thread Patrice Clement
commit: dc5097071cfe535c83a52bc1185f03c629e62f2f
Author: Patrice Clement  gentoo  org>
AuthorDate: Fri Aug 11 17:26:11 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Sat Aug 12 08:50:00 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=dc509707

remove ChangeLog

 src/py/xml-rewrite-2.py | 18 --
 1 file changed, 18 deletions(-)

diff --git a/src/py/xml-rewrite-2.py b/src/py/xml-rewrite-2.py
index 943a512..030a939 100755
--- a/src/py/xml-rewrite-2.py
+++ b/src/py/xml-rewrite-2.py
@@ -1,25 +1,7 @@
 #!/usr/bin/env python3
-# -*- coding: UTF-8 -*-
-# vim: set ai ts=8 sts=0 sw=8 tw=0 noexpandtab:
-
 # Copyright 2004-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public Licence v2
 
-# Authors:
-#  Saleem Abdulrasool 
-#  Petteri Räty 
-# Maintainer: Gentoo Java Herd 
-# Python based XML modifier
-
-# ChangeLog
-# Petteri Räty 
-# December 23, 2004 - Initial Write
-# December 24, 2004 - Added usage information
-
-
 import sys
 import io
 from xml.sax.saxutils import quoteattr, escape



[gentoo-commits] proj/javatoolkit:master commit in: src/py/

2017-08-12 Thread Patrice Clement
commit: c5a30f5dc7a54d81714a30f7f8140347db173e8f
Author: Patrice Clement  gentoo  org>
AuthorDate: Fri Aug 11 17:42:34 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Sat Aug 12 08:50:00 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=c5a30f5d

use context managers wherever possible

 src/py/xml-rewrite-2.py | 28 
 1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/src/py/xml-rewrite-2.py b/src/py/xml-rewrite-2.py
index 721147b..2b4702d 100755
--- a/src/py/xml-rewrite-2.py
+++ b/src/py/xml-rewrite-2.py
@@ -204,8 +204,6 @@ parameters will break the script."""
 print("ERROR: " + message)
 sys.exit(1)
 
-#  if len(sys.argv) == 1:
-#  usage(True)
 options_list = [
 make_option(
 "-f",
@@ -320,8 +318,7 @@ parameters will break the script."""
 if options.doAdd and (len(options.values or []) != 
len(options.attributes or [])
   or len(options.source_values or []) != 
len(options.source_attributes or [])
   or len(options.target_values or []) != 
len(options.target_attributes or [])):
-error(
-"You must give attribute(s)/value(s) for every element you 
are changing.")
+error("You must give attribute(s)/value(s) for every element 
you are changing.")
 
 # End Invalid Arguments Check
 
@@ -354,17 +351,16 @@ parameters will break the script."""
 dirname = os.path.dirname(file)
 if dirname != '':  # for file = build.xml comes out as ''
 os.chdir(os.path.dirname(file))
-f = open(os.path.basename(file), "r")
-if options.gentoo_classpath:
-rewriter.process(f, add_gentoo_classpath)
-else:
-rewriter.process(f)
-os.chdir(cwd)
-f.close()
-# Then write it back to the file
-f = open(file, "w")
-rewriter.write(f)
-f.close()
+
+with open(os.path.basename(file), 'r') as f:
+if options.gentoo_classpath:
+rewriter.process(f, add_gentoo_classpath)
+else:
+rewriter.process(f)
+
+# Then write it back out to the file
+with open(file, 'w') as f:
+rewriter.write(f)
 
 else:
 if options.gentoo_classpath:
@@ -375,4 +371,4 @@ parameters will break the script."""
 
 
 if __name__ == '__main__':
-main()
+main()
\ No newline at end of file



[gentoo-commits] proj/javatoolkit:master commit in: src/py/

2017-08-12 Thread Patrice Clement
commit: c14bc98dd90aac83b86ffb781db40b13d51ec37a
Author: Patrice Clement  gentoo  org>
AuthorDate: Fri Aug 11 19:20:17 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Sat Aug 12 08:50:00 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=c14bc98d

clean up header

 src/py/xml-rewrite-3.py | 21 -
 1 file changed, 21 deletions(-)

diff --git a/src/py/xml-rewrite-3.py b/src/py/xml-rewrite-3.py
index b17f4d5..b64ceda 100755
--- a/src/py/xml-rewrite-3.py
+++ b/src/py/xml-rewrite-3.py
@@ -1,28 +1,7 @@
 #!/usr/bin/env python3
-# -*- coding: UTF-8 -*-
-
 # Copyright 2004-2008 Gentoo Foundation
 # Distributed under the terms of the GNU General Public Licence v2
 
-# Authors:
-#   Saleem Abdulrasool 
-#   Petteri Räty 
-#   kiorky 
-# Maintainer: Gentoo Java Herd 
-# Python based XML modifier
-
-# ChangeLog
-# kiorky  
-#  May 2007 - Now, all things can be done in one pass, saving us some 
times :)
-#   - javadoc target generation added
-#   - Rewritten to be more logical
-# Petteri Räty 
-#  December 23, 2004 - Initial Write
-#  December 24, 2004 - Added usage information
-
 
 import os
 import sys



[gentoo-commits] proj/javatoolkit:master commit in: src/py/

2017-08-11 Thread Patrice Clement
commit: d843ddcc7909964331385920d1116350c65f33cd
Author: Patrice Clement  gentoo  org>
AuthorDate: Thu Aug 10 12:04:08 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Thu Aug 10 12:04:08 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=d843ddcc

doesn't convert str to UTF8

 src/py/xml-rewrite-2.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/py/xml-rewrite-2.py b/src/py/xml-rewrite-2.py
index a6b88ee..943a512 100755
--- a/src/py/xml-rewrite-2.py
+++ b/src/py/xml-rewrite-2.py
@@ -111,7 +111,7 @@ class StreamRewriterBase:
 self.targetValues = targetValues or []
 
 def p(self, str):
-self.__write(str.encode('utf8'))
+self.__write(str)
 
 def write(self, out_stream):
 value = self.buffer.getvalue()



[gentoo-commits] proj/javatoolkit:master commit in: src/py/javatoolkit/xml/

2017-08-11 Thread Patrice Clement
commit: 0742a5a62058db8c3b8ff5d21e8fe662915d8cd2
Author: Patrice Clement  gentoo  org>
AuthorDate: Thu Aug 10 12:27:21 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Thu Aug 10 12:27:21 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=0742a5a6

swap around string encoding

 src/py/javatoolkit/xml/SaxRewriter.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/py/javatoolkit/xml/SaxRewriter.py 
b/src/py/javatoolkit/xml/SaxRewriter.py
index bd6e8de..f9e224a 100644
--- a/src/py/javatoolkit/xml/SaxRewriter.py
+++ b/src/py/javatoolkit/xml/SaxRewriter.py
@@ -115,7 +115,7 @@ class SaxRewriter(XMLGenerator):
 
 
 def p(self,str):
-self.buffer.write(str.encode('utf8'))
+self.buffer.write(str)
 
 
 def write_attr(self,a,v):
@@ -125,7 +125,7 @@ class SaxRewriter(XMLGenerator):
 def process(self, in_stream, callback):
 self.startElement = callback
 from xml.sax import parseString
-parseString(in_stream, self)
+parseString(in_stream.encode('UTF8'), self)
 self.p('\n')
 
 # vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap:



[gentoo-commits] proj/javatoolkit:master commit in: src/py/

2017-08-09 Thread Patrice Clement
commit: 477dbfbb5e308ddcfc8b16513fe2183f618d8a23
Author: Patrice Clement  gentoo  org>
AuthorDate: Wed Aug  9 22:28:46 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Wed Aug  9 22:28:46 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=477dbfbb

convert usage to a multi line string

 src/py/xml-rewrite-2.py | 29 ++---
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/src/py/xml-rewrite-2.py b/src/py/xml-rewrite-2.py
index 46b4bfd..a6b88ee 100755
--- a/src/py/xml-rewrite-2.py
+++ b/src/py/xml-rewrite-2.py
@@ -204,21 +204,20 @@ class SaxRewriter(XMLGenerator, StreamRewriterBase):
 
 
 def main():
-usage = "Copyright 2004,2006,2007 Gentoo Foundation\n"
-usage += "Distributed under the terms of the GNU General Public Lincense 
v2\n"
-usage += "Please contact the Gentoo Java Team  with 
problems.\n"
-usage += "\n"
-usage += "Usage:\n"
-usage += " xml-rewrite.py [-f file] --delete [-g] -e tag [-e tag] -a 
attribute [-a attribute] [-i index]\n"
-usage += " xml-rewrite.py [-f file] --change [-g] -e tag [-e tag] -a 
attribute -v value [-a attribute -v value] \\\n"
-usage += " [--source-element tag] [--source-attribute 
attribute --source-value value] \\\n"
-usage += " [--target-element tag] [--target-attribute 
attribute --target-value value] [-i index]\n"
-usage += "Or:\n"
-usage += " xml-rewrite.py [-f file] -g\n"
-usage += "\n"
-usage += "If the -f parameter is not utilized, the script will read and\n"
-usage += "write to stdin and stdout respectively.  The use of quotes on\n"
-usage += "parameters will break the script.\n"
+usage = """Copyright 2004, 2006, 2007, 2017 Gentoo Foundation
+Distributed under the terms of the GNU General Public Lincense v2
+Please contact the Gentoo Java Team  with problems.
+Usage:
+xml-rewrite.py [-f file] --delete [-g] -e tag [-e tag] -a attribute [-a 
attribute] [-i index]
+xml-rewrite.py [-f file] --change [-g] -e tag [-e tag] -a attribute -v 
value [-a attribute -v value]
+   [--source-element tag] [--source-attribute attribute --source-value 
value]
+   [--target-element tag] [--target-attribute attribute --target-value 
value] [-i index]
+Or:
+xml-rewrite.py [-f file] -g
+
+If the -f parameter is not utilized, the script will read and
+write to stdin and stdout respectively. The use of quotes on
+parameters will break the script."""
 
 def error(message):
 print("ERROR: " + message)



[gentoo-commits] proj/javatoolkit:master commit in: src/py/javatoolkit/

2017-08-08 Thread Patrice Clement
commit: ca174fbdc542a10c4bd69ee15f705ee856789691
Author: Patrice Clement  gentoo  org>
AuthorDate: Tue Aug  8 20:24:03 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Tue Aug  8 20:39:00 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=ca174fbd

format strings in a saner way

 src/py/javatoolkit/cvv.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/py/javatoolkit/cvv.py b/src/py/javatoolkit/cvv.py
index b5f817e..6ae2501 100644
--- a/src/py/javatoolkit/cvv.py
+++ b/src/py/javatoolkit/cvv.py
@@ -16,9 +16,9 @@ class CVVMagic:
 
 def add(self, version, jar, file):
 if version <= self.target:
-self.good.append(("1."+str(version), jar, file))
+self.good.append(("1.%s" % (version), jar, file))
 else:
-self.bad.append(("1."+str(version), jar, file))
+self.bad.append(("1.%s" % (version), jar, file))
 
 def do_class(self,filename):
 classFile = file(filename,"rb")



[gentoo-commits] proj/javatoolkit:master commit in: src/py/javatoolkit/, src/py/

2017-08-08 Thread Patrice Clement
commit: 7d1d602b655317b1f7996d2e88943b1924eca511
Author: Patrice Clement  gentoo  org>
AuthorDate: Tue Aug  8 20:13:48 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Tue Aug  8 20:38:57 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=7d1d602b

change variable name

because cvv is indeed a magic class (except for James)

 src/py/class-version-verify.py | 22 ++
 src/py/javatoolkit/cvv.py  |  3 +--
 2 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/src/py/class-version-verify.py b/src/py/class-version-verify.py
index b46d99c..a53b10d 100755
--- a/src/py/class-version-verify.py
+++ b/src/py/class-version-verify.py
@@ -4,13 +4,11 @@
 # Copyright(c) 2005, Gentoo Foundation
 #
 # Licensed under the GNU General Public License, v2
-#
-# $Id$
 
 import os
 import sys
 from optparse import OptionParser, make_option
-from javatoolkit.cvv import *
+from javatoolkit.cvv import CVVMagic
 
 
 def main():
@@ -62,35 +60,35 @@ def main():
 
 options.version = int(options.version.split(".")[-1])
 
-cvv = cvv(options.version)
+cvv_magic = CVVMagic(options.version)
 
 for arg in args:
 if os.path.isfile(arg):
-cvv.do_file(arg)
+cvv_magic.do_file(arg)
 
 if options.deep and os.path.isdir(arg):
 for root, dirs, files in os.walk(arg):
 for filename in files:
-cvv.do_file("%s/%s" % (root, filename))
+cvv_magic.do_file("%s/%s" % (root, filename))
 
 if options.file_only:
-lst = set([set[1] for set in cvv.bad])
+lst = set([set[1] for set in cvv_magic.bad])
 for i in lst:
 print(i)
 else:
 if options.verbose:
-for set in cvv.good:
+for set in cvv_magic.good:
 print("Good: %s %s %s" % set)
 
 if not options.silent:
-for set in cvv.bad:
+for set in cvv_magic.bad:
 print("Bad: %s %s %s" % set)
 
 print("CVV: %s\nChecked: %i Good: %i Bad: %i" %
-  (options.version, len(cvv.good) +
-   len(cvv.bad), len(cvv.good), len(cvv.bad)))
+  (options.version, len(cvv_magic.good) +
+   len(cvv_magic.bad), len(cvv_magic.good), len(cvv_magic.bad)))
 
-if len(cvv.bad) > 0:
+if len(cvv_magic.bad) > 0:
 sys.exit(1)
 else:
 sys.exit(0)

diff --git a/src/py/javatoolkit/cvv.py b/src/py/javatoolkit/cvv.py
index c72cfcc..b5f817e 100644
--- a/src/py/javatoolkit/cvv.py
+++ b/src/py/javatoolkit/cvv.py
@@ -1,7 +1,6 @@
 # Copyright 2005, Thomas Matthijs 
 # Copyright 1999-2008 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: $
 
 import os
 import sys
@@ -9,7 +8,7 @@ from struct import unpack
 from zipfile import ZipFile
 
 
-class cvv:
+class CVVMagic:
 def __init__(self, target):
 self.target = target
 self.good = []



[gentoo-commits] proj/javatoolkit:master commit in: src/py/

2017-08-07 Thread Patrice Clement
commit: 14576a84b715a958bab1dbb9ca892e7cabec8e6c
Author: Patrice Clement  gentoo  org>
AuthorDate: Mon Aug  7 23:38:19 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Mon Aug  7 23:38:19 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=14576a84

remove __version__ variable references

 src/py/eclipse-build.py | 2 +-
 src/py/maven-helper.py  | 2 +-
 src/py/xml-rewrite-3.py | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/py/eclipse-build.py b/src/py/eclipse-build.py
index 3baa23f..7da09da 100755
--- a/src/py/eclipse-build.py
+++ b/src/py/eclipse-build.py
@@ -16,7 +16,7 @@ from javatoolkit.java.properties import PropertiesParser
 
 
 if __name__ == '__main__':
-usage = "Eclipse Ant Build File writer " + __version__ + "\n"
+usage = "Eclipse Ant Build File writer"
 usage += "Copyright 2008 Gentoo Foundation\n"
 usage += "Distributed under the terms of the GNU General Public Licence\n"
 usage += "Please contact the Gentoo Java Team  with 
problems.\n"

diff --git a/src/py/maven-helper.py b/src/py/maven-helper.py
index cf924f6..01c9557 100755
--- a/src/py/maven-helper.py
+++ b/src/py/maven-helper.py
@@ -25,7 +25,7 @@ from javatoolkit.maven.MavenPom import MavenPom
 
 
 def main():
-usage = "XML MAVEN POM MODULE " + __version__ + "\n"
+usage = "XML MAVEN POM MODULE"
 usage += "Copyright 2004,2006,2007 Gentoo Foundation\n"
 usage += "Distributed under the terms of the GNU General Public Lincense 
v2\n"
 usage += "Please contact the Gentoo Java Team  with 
problems.\n"

diff --git a/src/py/xml-rewrite-3.py b/src/py/xml-rewrite-3.py
index 82255c9..b17f4d5 100755
--- a/src/py/xml-rewrite-3.py
+++ b/src/py/xml-rewrite-3.py
@@ -33,7 +33,7 @@ from javatoolkit.xml.SaxRewriter import SaxRewriter
 
 
 def main():
-usage = "XML Rewrite Python Module Version " + __version__ + "\n"
+usage = "XML Rewrite Python Module"
 usage += "Copyright 2004,2006,2007 Gentoo Foundation\n"
 usage += "Distributed under the terms of the GNU General Public Lincense 
v2\n"
 usage += "Please contact the Gentoo Java Team  with 
problems.\n"



[gentoo-commits] proj/javatoolkit:master commit in: src/py/

2017-08-07 Thread Patrice Clement
commit: a5af39e2e0c3f00226be6a3ca4bacabf6ea39118
Author: Patrice Clement  gentoo  org>
AuthorDate: Mon Aug  7 23:32:12 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Mon Aug  7 23:34:55 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=a5af39e2

autopep8 format

 src/py/build-xml-rewrite   |  28 ++-
 src/py/buildparser |  23 +-
 src/py/class-version-verify.py |  52 +++-
 src/py/eclipse-build.py|  88 +--
 src/py/findclass   |  13 +-
 src/py/jarjarclean |   3 +-
 src/py/maven-helper.py |  90 +--
 src/py/xml-rewrite-2.py| 542 -
 src/py/xml-rewrite-3.py| 273 -
 src/py/xml-rewrite.py  |  59 +++--
 10 files changed, 785 insertions(+), 386 deletions(-)

diff --git a/src/py/build-xml-rewrite b/src/py/build-xml-rewrite
index 229de89..5a67145 100755
--- a/src/py/build-xml-rewrite
+++ b/src/py/build-xml-rewrite
@@ -4,17 +4,28 @@ import sys
 import xml.etree.cElementTree as et
 from optparse import OptionParser
 
+
 def main():
 parser = OptionParser()
-parser.add_option('-c', '--changeattributes', dest='change', 
action="append", nargs=3)
-parser.add_option('-g', '--gentooclasspath', dest="gcp", 
action="store_true", default=False)
+parser.add_option(
+'-c',
+'--changeattributes',
+dest='change',
+action="append",
+nargs=3)
+parser.add_option(
+'-g',
+'--gentooclasspath',
+dest="gcp",
+action="store_true",
+default=False)
 parser.add_option('-e', '--encoding', dest="encoding")
 (options, args) = parser.parse_args()
 
 changes = []
 if options.change:
 for c in options.change:
-changes.append((c[0].split(),c[1], c[2]))
+changes.append((c[0].split(), c[1], c[2]))
 
 gcp = options.gcp
 gcp_str = '${gentoo.classpath}'
@@ -26,8 +37,8 @@ def main():
 for javac in tree.getiterator('javac'):
 if gcp:
 javac.attrib['classpath'] = gcp_str
-if options.encoding:
-javac.attrib['encoding'] = options.encoding
+if options.encoding:
+javac.attrib['encoding'] = options.encoding
 for javadoc in tree.getiterator('javadoc'):
 if gcp:
 javadoc.attrib['classpath'] = gcp_str
@@ -35,9 +46,9 @@ def main():
 javadoc.attrib['encoding'] = options.encoding
 for c in changes:
 elems, attr, value = c
-for elem in elems:
-for e in tree.getiterator(elem):
-e.attrib[attr] = value
+for elem in elems:
+for e in tree.getiterator(elem):
+e.attrib[attr] = value
 for junit in tree.getiterator('junit'):
 if gcp:
 junit.append(gcp_sub)
@@ -46,5 +57,6 @@ def main():
 with open(file, 'w') as f:
 tree.write(f)
 
+
 if __name__ == '__main__':
 main()

diff --git a/src/py/buildparser b/src/py/buildparser
index 7af980d..3007d9b 100755
--- a/src/py/buildparser
+++ b/src/py/buildparser
@@ -16,7 +16,8 @@ from javatoolkit.parser.buildproperties import 
BuildPropertiesParser
 from javatoolkit.parser.manifest import ManifestParser
 from javatoolkit.parser.tree import Node, ParseError
 
-__author__ = ["James Le Cuirot ", "Karl Trygve 
Kalleberg "]
+__author__ = ["James Le Cuirot ",
+  "Karl Trygve Kalleberg "]
 __version__ = "0.3.0"
 __productname__ = "buildparser"
 __description__ = "A parser for build.properties and JAR manifest files."
@@ -34,14 +35,14 @@ def parse_args():
 parser = OptionParser(usage, version=about)
 
 parser.add_option('-t', '--type', action='store', type='choice',
-dest='type', choices=['manifest', 'buildprops'],
-help='Type of file to parse: manifest or buildprops')
+  dest='type', choices=['manifest', 'buildprops'],
+  help='Type of file to parse: manifest or buildprops')
 
 parser.add_option('-i', '--in-place', action='store_true', dest='in_place',
-help='Edit file in place when replacing')
+  help='Edit file in place when replacing')
 
 parser.add_option('-w', '--wrap', action='store_true', dest='wrap',
-help='Wrap when returning singular values')
+  help='Wrap when returning singular values')
 
 opt, args = parser.parse_args()
 
@@ -56,6 +57,7 @@ def parse_args():
 
 return opt, args
 
+
 def main():
 opt, args = parse_args()
 
@@ -78,7 +80,9 @@ def main():
 p = BuildPropertiesParser()
 

[gentoo-commits] proj/javatoolkit:master commit in: src/py/javatoolkit/

2017-08-07 Thread Patrice Clement
commit: 148f42293eb0e6c33b39ad2bd11b367362c929fe
Author: Patrice Clement  gentoo  org>
AuthorDate: Mon Aug  7 23:36:52 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Mon Aug  7 23:36:52 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=148f4229

fix imports

 src/py/javatoolkit/__init__.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/py/javatoolkit/__init__.py b/src/py/javatoolkit/__init__.py
index 77b273b..f40ce2e 100644
--- a/src/py/javatoolkit/__init__.py
+++ b/src/py/javatoolkit/__init__.py
@@ -5,8 +5,8 @@
 #
 # Licensed under the GNU General Public License, v2
 
-from classpath import *
-from output import *
+from .classpath import *
+from .output import *
 
 if __name__ == "__main__":
 print("This is not an executable module")



[gentoo-commits] proj/javatoolkit:master commit in: src/py/

2017-08-07 Thread Patrice Clement
commit: a3d76ee426581f537af69825b5348480adea9a3a
Author: Patrice Clement  gentoo  org>
AuthorDate: Mon Aug  7 22:56:07 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Mon Aug  7 22:56:07 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=a3d76ee4

more cleanup

 src/py/eclipse-build.py | 3 ---
 src/py/maven-helper.py  | 6 +-
 src/py/xml-rewrite-2.py | 3 ---
 src/py/xml-rewrite-3.py | 2 --
 src/py/xml-rewrite.py   | 3 ---
 5 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/src/py/eclipse-build.py b/src/py/eclipse-build.py
index 2f41b3a..ab65307 100755
--- a/src/py/eclipse-build.py
+++ b/src/py/eclipse-build.py
@@ -15,9 +15,6 @@ from xml.dom.minidom import parse
 from javatoolkit.java.properties import PropertiesParser
 
 
-__version__ = "$Revision: 1 $"[11:-2]
-
-
 if __name__ == '__main__':
 usage = "Eclipse Ant Build File writer " + __version__ + "\n"
 usage += "Copyright 2008 Gentoo Foundation\n"

diff --git a/src/py/maven-helper.py b/src/py/maven-helper.py
index 108abae..9aa41cc 100755
--- a/src/py/maven-helper.py
+++ b/src/py/maven-helper.py
@@ -24,11 +24,7 @@ from optparse import OptionParser, make_option
 from javatoolkit.maven.MavenPom import MavenPom
 
 
-__version__ = "$Revision: 1.1 $"[11:-2]
-
-
-def main()
-
+def main():
 usage = "XML MAVEN POM MODULE " + __version__ + "\n"
 usage += "Copyright 2004,2006,2007 Gentoo Foundation\n"
 usage += "Distributed under the terms of the GNU General Public Lincense 
v2\n"

diff --git a/src/py/xml-rewrite-2.py b/src/py/xml-rewrite-2.py
index 2755bb6..5c8aa6b 100755
--- a/src/py/xml-rewrite-2.py
+++ b/src/py/xml-rewrite-2.py
@@ -26,9 +26,6 @@ from xml.sax.saxutils import quoteattr,escape
 from optparse import OptionParser, make_option
 
 
-__version__ = "$Revision: 1.7 $"[11:-2]
-
-
 def add_gentoo_classpath(document):
matches = document.getElementsByTagName("classpath")
gcp = document.createElement("location")

diff --git a/src/py/xml-rewrite-3.py b/src/py/xml-rewrite-3.py
index 605e927..549443b 100755
--- a/src/py/xml-rewrite-3.py
+++ b/src/py/xml-rewrite-3.py
@@ -32,8 +32,6 @@ from javatoolkit.xml.DomRewriter import DomRewriter
 from javatoolkit.xml.SaxRewriter import SaxRewriter
 
 
-__version__ = "$Revision: 1.7 $"[11:-2]
-
 def main():
 usage = "XML Rewrite Python Module Version " + __version__ + "\n"
 usage += "Copyright 2004,2006,2007 Gentoo Foundation\n"

diff --git a/src/py/xml-rewrite.py b/src/py/xml-rewrite.py
index 7e1dbc4..6bf8ea2 100755
--- a/src/py/xml-rewrite.py
+++ b/src/py/xml-rewrite.py
@@ -21,9 +21,6 @@ from optparse import OptionParser, make_option
 from xml.dom import NotFoundErr
 
 
-__version__ = "$Revision: 1.6 $"[11:-2]
-
-
 class IOWrapper:
 def __init__(self, object):
 self.stream = object



[gentoo-commits] proj/javatoolkit:master commit in: src/py/javatoolkit/xml/, src/py/javatoolkit/java/, src/py/javatoolkit/parser/, ...

2017-08-07 Thread Patrice Clement
commit: 1a722e7e516d75885022ff8c14e668d1c8d73d56
Author: Patrice Clement  gentoo  org>
AuthorDate: Mon Aug  7 19:13:38 2017 +
Commit: Patrice Clement  gentoo  org>
CommitDate: Mon Aug  7 19:13:38 2017 +
URL:https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=1a722e7e

remove a few more headers and add braces around two print functions

 src/py/buildparser   | 2 --
 src/py/javatoolkit/__init__.py   | 4 +---
 src/py/javatoolkit/java/__init__.py  | 4 +---
 src/py/javatoolkit/parser/buildproperties.py | 2 --
 src/py/javatoolkit/parser/helpers.py | 2 --
 src/py/javatoolkit/parser/manifest.py| 3 ---
 src/py/javatoolkit/xml/SaxRewriter.py| 2 --
 7 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/src/py/buildparser b/src/py/buildparser
index a7e656d..7af980d 100755
--- a/src/py/buildparser
+++ b/src/py/buildparser
@@ -5,8 +5,6 @@
 #
 # Licensed under the GNU General Public License, v2
 #
-# $Header:$
-
 import os
 import sys
 from optparse import OptionParser

diff --git a/src/py/javatoolkit/__init__.py b/src/py/javatoolkit/__init__.py
index 5d9dcee..77b273b 100644
--- a/src/py/javatoolkit/__init__.py
+++ b/src/py/javatoolkit/__init__.py
@@ -4,11 +4,9 @@
 # Copyright(c) 2004, Gentoo Foundation
 #
 # Licensed under the GNU General Public License, v2
-#
-# $Header: /var/cvsroot/gentoo-src/javatoolkit/src/javatoolkit/__init__.py,v 
1.2 2004/11/08 19:21:52 karltk Exp $
 
 from classpath import *
 from output import *
 
 if __name__ == "__main__":
-   print "This is not an executable module"
+print("This is not an executable module")

diff --git a/src/py/javatoolkit/java/__init__.py 
b/src/py/javatoolkit/java/__init__.py
index 20432bd..0e3a32d 100644
--- a/src/py/javatoolkit/java/__init__.py
+++ b/src/py/javatoolkit/java/__init__.py
@@ -3,8 +3,6 @@
 # Copyright(c) 2008, Gentoo Foundation
 #
 # Licensed under the GNU General Public License, v2
-#
-# $Header: $
 
 if __name__ == "__main__":
-   print "This is not an executable module"
+print("This is not an executable module")

diff --git a/src/py/javatoolkit/parser/buildproperties.py 
b/src/py/javatoolkit/parser/buildproperties.py
index a09614d..9a73f78 100644
--- a/src/py/javatoolkit/parser/buildproperties.py
+++ b/src/py/javatoolkit/parser/buildproperties.py
@@ -3,8 +3,6 @@
 # Copyright(c) 2004, Gentoo Foundation
 #
 # Licensed under the GNU General Public License, v2
-#
-# $Header: $
 
 from .tree import *
 from . import parser

diff --git a/src/py/javatoolkit/parser/helpers.py 
b/src/py/javatoolkit/parser/helpers.py
index b11b08b..c0e1bb3 100644
--- a/src/py/javatoolkit/parser/helpers.py
+++ b/src/py/javatoolkit/parser/helpers.py
@@ -3,8 +3,6 @@
 # Copyright(c) 2004, Gentoo Foundation
 #
 # Licensed under the GNU General Public License, v2
-#
-# $Header: $
 
 def expand(root, expr, realroot = None):
 """Evaluates a path expression on a given tree.

diff --git a/src/py/javatoolkit/parser/manifest.py 
b/src/py/javatoolkit/parser/manifest.py
index b5a1701..b55a28a 100644
--- a/src/py/javatoolkit/parser/manifest.py
+++ b/src/py/javatoolkit/parser/manifest.py
@@ -1,8 +1,5 @@
 # Copyright(c) 2006, 2008, James Le Cuirot 
-#
 # Licensed under the GNU General Public License, v2
-#
-# $Header: $
 
 from .tree import *
 from . import parser

diff --git a/src/py/javatoolkit/xml/SaxRewriter.py 
b/src/py/javatoolkit/xml/SaxRewriter.py
index 07528c9..bd6e8de 100644
--- a/src/py/javatoolkit/xml/SaxRewriter.py
+++ b/src/py/javatoolkit/xml/SaxRewriter.py
@@ -1,8 +1,6 @@
 # -*- coding: UTF-8 -*-
-
 # Copyright 2004-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: $
 
 import os
 import sys