|
From: <ai...@us...> - 2013-07-07 18:00:12
|
Revision: 12405
http://sourceforge.net/p/plplot/code/12405
Author: airwin
Date: 2013-07-07 18:00:07 +0000 (Sun, 07 Jul 2013)
Log Message:
-----------
Initial commit of python script to follow includes in gtk jhbuild
xml module files to generate an equivalent single module file.
At this stage, the script does not follow includes so simply copies
the file specified as an argument to the script to stdout.
Tested by: Alan W. Irwin <ai...@us...> using
./gtk_xml_recursive_process.py README |diff - README
Added Paths:
-----------
trunk/cmake/build_projects/gtk_xml_recursive_process.py
Added: trunk/cmake/build_projects/gtk_xml_recursive_process.py
===================================================================
--- trunk/cmake/build_projects/gtk_xml_recursive_process.py (rev 0)
+++ trunk/cmake/build_projects/gtk_xml_recursive_process.py 2013-07-07 18:00:07 UTC (rev 12405)
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+
+# Recursively read gtk jhbuild xml module files following include
+# elements to produce the equivalent single xml file.
+
+# Copyright (C) 2013 Alan W. Irwin
+
+# This file is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this file; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+import sys
+
+def recursive_process(path, filename, if_included):
+ fullpath = path + "/" + filename
+ fileobject = open(fullpath)
+ line = fileobject.readline()
+ while line:
+ sys.stdout.write(line)
+ line = fileobject.readline()
+ fileobject.close()
+
+fullpath = sys.argv[1]
+index = fullpath.rfind("/")
+if index >=0 and len(fullpath) > index + 1:
+ path = fullpath[:index]
+ filename = fullpath[index+1:]
+elif index < 0 and len(fullpath) >= 1:
+ path = "."
+ filename = fullpath
+else:
+ print("%s is invalid fullpath name of a file" % fullpath)
+ sys.exit()
+
+recursive_process(path, filename, False)
Property changes on: trunk/cmake/build_projects/gtk_xml_recursive_process.py
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|