mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 04:28:10 +00:00
Take the XML directory instead of all the XML files as parameter for the genapixml.py script.
This commit is contained in:
parent
fe76b2f4c0
commit
de9538cf8d
1 changed files with 7 additions and 2 deletions
|
|
@ -17,6 +17,7 @@
|
|||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import string
|
||||
import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
|
|
@ -548,6 +549,10 @@ class Project:
|
|||
self.__findCFunction(tree)
|
||||
self.__discoverClasses()
|
||||
|
||||
def initFromDir(self, xmldir):
|
||||
files = [ os.path.join(xmldir, f) for f in os.listdir(xmldir) if (os.path.isfile(os.path.join(xmldir, f)) and f.endswith('.xml')) ]
|
||||
self.initFromFiles(files)
|
||||
|
||||
def check(self):
|
||||
for c in self.classes:
|
||||
for name, p in c.properties.iteritems():
|
||||
|
|
@ -700,7 +705,7 @@ def main(argv = None):
|
|||
argparser.add_argument('-o', '--outputfile', metavar='outputfile', type=argparse.FileType('w'), help="Output XML file describing the Linphone API.")
|
||||
argparser.add_argument('--verbose', help="Increase output verbosity", action='store_true')
|
||||
argparser.add_argument('--pretty', help="XML pretty print", action='store_true')
|
||||
argparser.add_argument('xmlfile', metavar='xmlfile', type=argparse.FileType('r'), nargs='+', help="XML file generated by doxygen.")
|
||||
argparser.add_argument('xmldir', help="XML directory generated by doxygen.")
|
||||
args = argparser.parse_args()
|
||||
if args.outputfile == None:
|
||||
args.outputfile = open('api.xml', 'w')
|
||||
|
|
@ -709,7 +714,7 @@ def main(argv = None):
|
|||
project.verbose = True
|
||||
if args.pretty:
|
||||
project.prettyPrint = True
|
||||
project.initFromFiles(args.xmlfile)
|
||||
project.initFromDir(args.xmldir)
|
||||
project.check()
|
||||
gen = Generator(args.outputfile)
|
||||
gen.generate(project)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue