[pywin32-checkins] pywin32/AutoDuck makedfromi.py,1.6,1.7
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2005-01-30 13:37:40
|
Update of /cvsroot/pywin32/pywin32/AutoDuck In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17753 Modified Files: makedfromi.py Log Message: Fix a number of issues found when Roger pointed out many @pyparms were being dropped. Index: makedfromi.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/AutoDuck/makedfromi.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** makedfromi.py 8 Nov 2004 02:58:35 -0000 1.6 --- makedfromi.py 30 Jan 2005 13:37:24 -0000 1.7 *************** *** 29,33 **** def make_doc_summary(inFile, outFile): methods = [] - nativeMethods = [] modDoc = "" modName = "" --- 29,32 ---- *************** *** 55,74 **** doc, lineNo = GetComments(line, lineNo, lines) constants.append((cname, doc)) ! elif line[:2]=="//": ! rest = line[2:].strip() ! if rest.startswith("@pyswig"): ! doc, lineNo = GetComments(line, lineNo, lines) ! curMethod = doc[8:], [] ! methods.append(curMethod) ! elif rest.startswith("@pymeth "): ! doc, lineNo = GetComments(line, lineNo, lines) ! nativeMethods.append(line+doc) else: ! if rest.startswith("@"): doc, lineNo = GetComments(line, lineNo, lines) ! if curMethod: ! curMethod[1].append("// " + doc + '\n') ! else: ! extra_tags.append("// " + doc + '\n') except: print "Line %d is badly formed - %s" % (lineNo, str(sys.exc_value)) --- 54,82 ---- doc, lineNo = GetComments(line, lineNo, lines) constants.append((cname, doc)) ! else: ! try: ! pos = line.index("//") ! except ValueError: ! pass else: ! rest = line[pos+2:].strip() ! if rest.startswith("@pymeth"): ! # manual markup - reset the current method. ! curMethod = None ! if rest.startswith("@doc"): ! pass ! elif rest.startswith("@pyswig"): doc, lineNo = GetComments(line, lineNo, lines) ! curMethod = doc[8:], [] ! methods.append(curMethod) ! elif rest.startswith("@const"): ! doc, lineNo = GetComments(line, lineNo, lines) ! else: ! if rest.startswith("@"): ! doc, lineNo = GetComments(line, lineNo, lines) ! if curMethod: ! curMethod[1].append("// " + doc + '\n') ! else: ! extra_tags.append("// " + doc + '\n') except: print "Line %d is badly formed - %s" % (lineNo, str(sys.exc_value)) *************** *** 79,85 **** # creating a synthetic module name when this happens. max_methods = 90 ! # native ones first - hopefully never more than 90 of them! ! assert len(nativeMethods) < max_methods ! method_num = len(nativeMethods) chunk_number = 0 while 1: --- 87,91 ---- # creating a synthetic module name when this happens. max_methods = 90 ! method_num = 0 chunk_number = 0 while 1: *************** *** 97,100 **** --- 103,107 ---- thisModName = thisModName + " (more %d)" % (chunk_number+1,) + outFile.write("\n") for (meth, extras) in these_methods: fields = string.split(meth,'|') *************** *** 102,106 **** print "**Error - %s does not have enough fields" % meth else: ! outFile.write("\n// @pymethod %s|%s|%s|%s\n" % (fields[0],thisModName,fields[1], fields[2])) for extra in extras: outFile.write(extra) --- 109,113 ---- print "**Error - %s does not have enough fields" % meth else: ! outFile.write("// @pymethod %s|%s|%s|%s\n" % (fields[0],thisModName,fields[1], fields[2])) for extra in extras: outFile.write(extra) *************** *** 113,128 **** fields = string.split(meth,'|') outFile.write("// @pymeth %s|%s\n" % (fields[1], fields[2])) - if chunk_number == 0: - for meth in nativeMethods: - outFile.write(meth) - outFile.write("\n") chunk_number += 1 method_num += max_methods outFile.write("\n") - for (cname, doc) in constants: - outFile.write("// @const %s|%s|%s\n" % (modName, cname, doc) ) for extra in extra_tags: outFile.write("%s\n" % (extra) ) --- 120,131 ---- fields = string.split(meth,'|') outFile.write("// @pymeth %s|%s\n" % (fields[1], fields[2])) chunk_number += 1 method_num += max_methods outFile.write("\n") for extra in extra_tags: outFile.write("%s\n" % (extra) ) + for (cname, doc) in constants: + outFile.write("// @const %s|%s|%s\n" % (modName, cname, doc) ) |