[Python-ogre-commit] SF.net SVN: python-ogre:[771] trunk/python-ogre
Brought to you by:
andy_miller,
roman_yakovenko
From: <and...@us...> - 2008-10-21 09:56:53
|
Revision: 771 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=771&view=rev Author: andy_miller Date: 2008-10-21 09:53:59 +0000 (Tue, 21 Oct 2008) Log Message: ----------- Fix for extra escape characters in doc string (Linux requirement) Simplified data stamp so it didn't change every code generation run Modified Paths: -------------- trunk/python-ogre/code_generators/common_utils/__init__.py trunk/python-ogre/code_generators/common_utils/extract_documentation.py trunk/python-ogre/scripts/UnitTest.py Modified: trunk/python-ogre/code_generators/common_utils/__init__.py =================================================================== --- trunk/python-ogre/code_generators/common_utils/__init__.py 2008-10-21 07:34:11 UTC (rev 770) +++ trunk/python-ogre/code_generators/common_utils/__init__.py 2008-10-21 09:53:59 UTC (rev 771) @@ -67,7 +67,7 @@ po = ".".join( (env.PythonOgreMajorVersion,env.PythonOgreMinorVersion, env.PythonOgrePatchVersion) ) t = datetime.datetime.now().isoformat(' ').strip() - t = datetime.date.today().isoformat() # making this less granular so it doesn't change 'every' time I do a regenerate + t = str (datetime.date.today().month) # making this less granular so it doesn't change 'every' time I do a regenerate v = envClass.version s = getSVNVersion( env ) detail = "_".join( (po,s,envClass.name, v, t) ) Modified: trunk/python-ogre/code_generators/common_utils/extract_documentation.py =================================================================== --- trunk/python-ogre/code_generators/common_utils/extract_documentation.py 2008-10-21 07:34:11 UTC (rev 770) +++ trunk/python-ogre/code_generators/common_utils/extract_documentation.py 2008-10-21 09:53:59 UTC (rev 771) @@ -222,22 +222,39 @@ _str = clean(_str, "\\image", "Image: ") ## nxPhysics _str = clean(_str, "\\examples", "Examples: ") ## nxOgre - _str = clean(_str, "\\default", "Default: ") ## nxOgre + _str = clean(_str, "\\default", "Default: ") ## nxOgre - _str = clean(_str, "\\version", "@version ") ## cegui - _str = clean(_str, "\\date", "@date ") # - _str = clean(_str, "\\todo", "@todo ") ## - _str = clean(_str, "\\bug", "@Bug ") ## - _str = clean(_str, "\\author", "@Author ") ## + _str = clean(_str, "\\version", "@version ") ## cegui + _str = clean(_str, "\\date", "@date ") # + _str = clean(_str, "\\todo", "@todo ") ## + _str = clean(_str, "\\bug", "@Bug ") ## + _str = clean(_str, "\\author", "@Author ") ## ## now clean up the rest - _str = reduce(clean, [_str, '/', '*', '!', "\\brief", '\\fn', + _str = reduce(clean, [_str, '/', "\\brief", '\\fn', "@brief", "@fn", '"', "@{", "\\c", "\\a"]) ## somtimes there are '"' in the doc strings and other "\\"... # return _str.lstrip() # return " " + _str.lstrip() - return _str ## no removale of white space so Epytext can handle sections etc + # another fix to remove stray escape sequences - only new lines allowed + # last character should never be a backslash, however lets fix it just in case... + # and we need to make a new copy because strings are immutable... + newStr="" + for x in range ( len ( _str) -1 ): # handle upto 2nd to last character + if _str[x] == '\\' and _str[x+1] != 'n': + print "fixing stray escape sequence", x, _str + newStr += ' ' + else: + newStr += _str[x] + x = len (_str) -1 # need to handle last character + if _str[x] == '\\' : + print "fixing stray escape sequence EOL", _str + newStr += ' ' + else: + newStr += _str[x] + return newStr ## no removale of white space so Epytext can handle sections etc + def make_epytext ( str ): """ turn this string into something more Epytext compatible """ Modified: trunk/python-ogre/scripts/UnitTest.py =================================================================== --- trunk/python-ogre/scripts/UnitTest.py 2008-10-21 07:34:11 UTC (rev 770) +++ trunk/python-ogre/scripts/UnitTest.py 2008-10-21 09:53:59 UTC (rev 771) @@ -108,7 +108,11 @@ FAILHARD=False def parseInput(): """Handle command line input """ - usage = "usage: %prog [options] [demo_program to test] " + usage = "Usage: %prog [options] [demo_program to test] \n\ + \n Example: - run all tests in a number of demo directories\ + \n %prog -d ogre -d cegui -d ogreode\n\ + \n Example: - run a specific demo (base defaults to ogre)\ + \n %prog demo_smoke\n" parser = OptionParser(usage=usage, version="%prog 1.0") parser.add_option("-v", "--verbose", action="store_true", default=False,dest="verbose", help="Output all output to stdout rather then saving to the log file") parser.add_option("-s", "--ScreenShotPath", default=os.path.join(os.getcwd(), "..", "screenshots"), action="store_true", dest="ScreenShotPath", help="Specify the directory for the snapshots") @@ -142,6 +146,9 @@ for d in getDemoFiles ( options.DemoParentPath, b ): shortName = os.path.splitext( os.path.split(d)[1])[0] runTest ( b, shortName, d ) - else: - pass \ No newline at end of file + shortName = args[0] + b = options.DemoBases[0] + d = os.path.abspath( os.path.join ( options.DemoParentPath, b, shortName ) ) + runTest ( b, shortName, d ) + \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |