Commit d73539b7 authored by Dave Kuhlman's avatar Dave Kuhlman

v. 2.29.21 Fix (cleanupName) for simpleType name

parent 34354b6f
......@@ -141,6 +141,12 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Change history
--------------
Version 2.29.21 (08/02/2018)
- Fix to use of simpleType name. Needed to do cleanupName() on the
class name. Thanks to Daniel Ramirez for reporting this and for
suggesting a fix.
Version 2.29.20 (07/30/2018)
- Fix to generation of regular expression used to validate a
......
......@@ -220,7 +220,7 @@ They are used by updateversion.py. -->
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.29.20</td>
<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.29.21</td>
</tr>
</tbody>
</table>
......@@ -229,7 +229,7 @@ They are used by updateversion.py. -->
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">date:</th><td class="field-body">July 30, 2018</td>
<tr class="field"><th class="field-name">date:</th><td class="field-body">August 02, 2018</td>
</tr>
</tbody>
</table>
......@@ -3392,7 +3392,7 @@ following among others:</p>
<div class="footer">
<hr class="footer" />
<a class="reference external" href="generateDS.txt">View document source</a>.
Generated on: 2018-07-30 20:37 UTC.
Generated on: 2018-08-02 19:16 UTC.
Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
......
......@@ -227,7 +227,7 @@ _log = logging.getLogger(__name__)
# Do not modify the following VERSION comments.
# Used by updateversion.py.
##VERSION##
VERSION = '2.29.20'
VERSION = '2.29.21'
##VERSION##
BaseStrTypes = six.string_types
......@@ -5678,8 +5678,8 @@ class GeneratedsSuper(object):
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......@@ -6712,16 +6712,17 @@ def generateSimpleTypes(wrt, prefix, simpleTypeDict):
def writeEnumClass(simpleType):
enumValues = simpleType.getEnumValues()
simpleTypeName = cleanupName(simpleType.getName())
if enumValues:
output = ""
try:
validateIdentifier(simpleType.getName())
validateIdentifier(simpleTypeName)
except ValueError:
err_msg(
'*** The Simple Type name "%s" is not a valid '
'Python identifier\n' % simpleType.getName())
'Python identifier\n' % simpleTypeName)
return
output += 'class %s(object):\n' % simpleType.getName()
output += 'class %s(object):\n' % simpleTypeName
for enumValue in enumValues:
try:
validatedEnumValue = validateIdentifier(enumValue)
......
......@@ -12,7 +12,7 @@ generateDS -- Generate Data Structures from XML Schema
.. version
:revision: 2.29.20
:revision: 2.29.21
.. version
......
......@@ -220,7 +220,7 @@ They are used by updateversion.py. -->
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.29.20</td>
<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.29.21</td>
</tr>
</tbody>
</table>
......@@ -229,7 +229,7 @@ They are used by updateversion.py. -->
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">date:</th><td class="field-body">July 30, 2018</td>
<tr class="field"><th class="field-name">date:</th><td class="field-body">August 02, 2018</td>
</tr>
</tbody>
</table>
......@@ -401,7 +401,7 @@ $ mv generateds_gui.mo locale/ru/LC_MESSAGES/
<div class="footer">
<hr class="footer" />
<a class="reference external" href="generateds_gui_notes.txt">View document source</a>.
Generated on: 2018-07-30 20:37 UTC.
Generated on: 2018-08-02 19:16 UTC.
Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
......
......@@ -12,7 +12,7 @@ GenerateDS GUI Notes
.. version
:revision: 2.29.20
:revision: 2.29.21
.. version
......
......@@ -41,7 +41,7 @@ from libgenerateDS.gui import generateds_gui_session
# Do not modify the following VERSION comments.
# Used by updateversion.py.
##VERSION##
VERSION = '2.29.20'
VERSION = '2.29.21'
##VERSION##
......
......@@ -217,7 +217,7 @@ dkuhlman (at) davekuhlman (dot) org
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.29.20</td>
<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.29.21</td>
</tr>
</tbody>
</table>
......@@ -226,7 +226,7 @@ dkuhlman (at) davekuhlman (dot) org
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">date:</th><td class="field-body">July 30, 2018</td>
<tr class="field"><th class="field-name">date:</th><td class="field-body">August 02, 2018</td>
</tr>
</tbody>
</table>
......@@ -380,7 +380,7 @@ this command for your needs. For example, you may need to use
<div class="footer">
<hr class="footer" />
<a class="reference external" href="librarytemplate_howto.txt">View document source</a>.
Generated on: 2018-07-30 20:37 UTC.
Generated on: 2018-08-02 19:16 UTC.
Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
......
......@@ -8,7 +8,7 @@ How to package a generateDS.py generated library
.. version
:revision: 2.29.20
:revision: 2.29.21
.. version
......
......@@ -40,7 +40,7 @@ except ImportError:
# Do not modify the following VERSION comments.
# Used by updateversion.py.
##VERSION##
VERSION = '2.29.20'
VERSION = '2.29.21'
##VERSION##
CatalogDict = {}
......
......@@ -8,7 +8,7 @@ setup(
# Do not modify the following VERSION comments.
# Used by updateversion.py.
##VERSION##
version="2.29.20",
version="2.29.21",
##VERSION##
author="Dave Kuhlman",
author_email="dkuhlman@davekuhlman.org",
......
......@@ -342,8 +342,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -342,8 +342,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -342,8 +342,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -342,8 +342,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -342,8 +342,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -342,8 +342,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -342,8 +342,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -340,8 +340,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ class GeneratedsSuper(object):
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -340,8 +340,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -340,8 +340,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -340,8 +340,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -340,8 +340,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -340,8 +340,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ class GeneratedsSuper(object):
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -342,8 +342,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -341,8 +341,8 @@ except ImportError as exp:
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.fullmatch(patterns2, target)
if mo is not None:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
......
......@@ -343,8 +343,8 @@ except ImportError as exp: