Commit 6fcffc95 authored by Patrick Gerken's avatar Patrick Gerken

Merge default encoding change into trunk

parent b1b8a205
...@@ -28,6 +28,8 @@ Products.DCWorkflow Changelog ...@@ -28,6 +28,8 @@ Products.DCWorkflow Changelog
- Deal with deprecation warnings for Zope 2.13. - Deal with deprecation warnings for Zope 2.13.
- Change default encoding of exports from None to utf-8.
2.2.0-beta (2009-12-06) 2.2.0-beta (2009-12-06)
----------------------- -----------------------
......
...@@ -148,7 +148,7 @@ class WorkflowDefinitionConfigurator( Implicit ): ...@@ -148,7 +148,7 @@ class WorkflowDefinitionConfigurator( Implicit ):
return self._extractScripts(self._obj) return self._extractScripts(self._obj)
security.declareProtected( ManagePortal, 'parseWorkflowXML' ) security.declareProtected( ManagePortal, 'parseWorkflowXML' )
def parseWorkflowXML( self, xml, encoding=None ): def parseWorkflowXML( self, xml, encoding='utf-8' ):
""" Pseudo API. """ Pseudo API.
""" """
dom = parseString( xml ) dom = parseString( xml )
...@@ -648,7 +648,7 @@ def _getScriptFilename( workflow_id, script_id, meta_type ): ...@@ -648,7 +648,7 @@ def _getScriptFilename( workflow_id, script_id, meta_type ):
return 'workflows/%s/scripts/%s.%s' % ( wf_dir, script_id, suffix ) return 'workflows/%s/scripts/%s.%s' % ( wf_dir, script_id, suffix )
def _extractCreationGuard(root, encoding=None) : def _extractCreationGuard(root, encoding='utf-8') :
icc = root.getElementsByTagName('instance-creation-conditions') icc = root.getElementsByTagName('instance-creation-conditions')
assert len(icc) <= 1 assert len(icc) <= 1
if icc : if icc :
...@@ -657,7 +657,7 @@ def _extractCreationGuard(root, encoding=None) : ...@@ -657,7 +657,7 @@ def _extractCreationGuard(root, encoding=None) :
else : else :
return None return None
def _extractStateNodes( root, encoding=None ): def _extractStateNodes( root, encoding='utf-8' ):
result = [] result = []
...@@ -718,7 +718,7 @@ def _extractStateNodes( root, encoding=None ): ...@@ -718,7 +718,7 @@ def _extractStateNodes( root, encoding=None ):
return result return result
def _extractTransitionNodes( root, encoding=None ): def _extractTransitionNodes( root, encoding='utf-8' ):
result = [] result = []
...@@ -751,7 +751,7 @@ def _extractTransitionNodes( root, encoding=None ): ...@@ -751,7 +751,7 @@ def _extractTransitionNodes( root, encoding=None ):
return result return result
def _extractVariableNodes( root, encoding=None ): def _extractVariableNodes( root, encoding='utf-8' ):
result = [] result = []
...@@ -780,7 +780,7 @@ def _extractVariableNodes( root, encoding=None ): ...@@ -780,7 +780,7 @@ def _extractVariableNodes( root, encoding=None ):
return result return result
def _extractWorklistNodes( root, encoding=None ): def _extractWorklistNodes( root, encoding='utf-8' ):
result = [] result = []
...@@ -799,7 +799,7 @@ def _extractWorklistNodes( root, encoding=None ): ...@@ -799,7 +799,7 @@ def _extractWorklistNodes( root, encoding=None ):
return result return result
def _extractScriptNodes( root, encoding=None ): def _extractScriptNodes( root, encoding='utf-8' ):
result = [] result = []
...@@ -830,7 +830,7 @@ def _extractScriptNodes( root, encoding=None ): ...@@ -830,7 +830,7 @@ def _extractScriptNodes( root, encoding=None ):
return result return result
def _extractPermissionNodes( root, encoding=None ): def _extractPermissionNodes( root, encoding='utf-8' ):
result = [] result = []
...@@ -840,7 +840,7 @@ def _extractPermissionNodes( root, encoding=None ): ...@@ -840,7 +840,7 @@ def _extractPermissionNodes( root, encoding=None ):
return result return result
def _extractActionNode( parent, encoding=None ): def _extractActionNode( parent, encoding='utf-8' ):
nodes = parent.getElementsByTagName( 'action' ) nodes = parent.getElementsByTagName( 'action' )
assert len( nodes ) <= 1, nodes assert len( nodes ) <= 1, nodes
...@@ -856,7 +856,7 @@ def _extractActionNode( parent, encoding=None ): ...@@ -856,7 +856,7 @@ def _extractActionNode( parent, encoding=None ):
, 'icon' : _queryNodeAttribute( node, 'icon', '', encoding ) , 'icon' : _queryNodeAttribute( node, 'icon', '', encoding )
} }
def _extractGuardNode( parent, encoding=None ): def _extractGuardNode( parent, encoding='utf-8' ):
nodes = parent.getElementsByTagName( 'guard' ) nodes = parent.getElementsByTagName( 'guard' )
assert len( nodes ) <= 1, nodes assert len( nodes ) <= 1, nodes
...@@ -883,7 +883,7 @@ def _extractGuardNode( parent, encoding=None ): ...@@ -883,7 +883,7 @@ def _extractGuardNode( parent, encoding=None ):
, 'expression' : expr_text , 'expression' : expr_text
} }
def _extractDefaultNode( parent, encoding=None ): def _extractDefaultNode( parent, encoding='utf-8' ):
nodes = parent.getElementsByTagName( 'default' ) nodes = parent.getElementsByTagName( 'default' )
assert len( nodes ) <= 1, nodes assert len( nodes ) <= 1, nodes
...@@ -918,7 +918,7 @@ def _extractDefaultNode( parent, encoding=None ): ...@@ -918,7 +918,7 @@ def _extractDefaultNode( parent, encoding=None ):
_SEMICOLON_LIST_SPLITTER = re.compile( r';[ ]*' ) _SEMICOLON_LIST_SPLITTER = re.compile( r';[ ]*' )
def _extractMatchNode( parent, encoding=None ): def _extractMatchNode( parent, encoding='utf-8' ):
nodes = parent.getElementsByTagName( 'match' ) nodes = parent.getElementsByTagName( 'match' )
...@@ -1242,7 +1242,7 @@ def _initDCWorkflowScripts( workflow, scripts, context ): ...@@ -1242,7 +1242,7 @@ def _initDCWorkflowScripts( workflow, scripts, context ):
# #
_marker = object() _marker = object()
def _queryNodeAttribute( node, attr_name, default, encoding=None ): def _queryNodeAttribute( node, attr_name, default, encoding='utf-8' ):
""" Extract a string-valued attribute from node. """ Extract a string-valued attribute from node.
...@@ -1260,7 +1260,7 @@ def _queryNodeAttribute( node, attr_name, default, encoding=None ): ...@@ -1260,7 +1260,7 @@ def _queryNodeAttribute( node, attr_name, default, encoding=None ):
return value return value
def _getNodeAttribute( node, attr_name, encoding=None ): def _getNodeAttribute( node, attr_name, encoding='utf-8' ):
""" Extract a string-valued attribute from node. """ Extract a string-valued attribute from node.
""" """
...@@ -1294,7 +1294,7 @@ def _getNodeAttributeBoolean( node, attr_name ): ...@@ -1294,7 +1294,7 @@ def _getNodeAttributeBoolean( node, attr_name ):
return value in ( 'true', 'yes', '1' ) return value in ( 'true', 'yes', '1' )
def _coalesceTextNodeChildren( node, encoding=None ): def _coalesceTextNodeChildren( node, encoding='utf-8' ):
""" Concatenate all childe text nodes into a single string. """ Concatenate all childe text nodes into a single string.
""" """
...@@ -1317,7 +1317,7 @@ def _coalesceTextNodeChildren( node, encoding=None ): ...@@ -1317,7 +1317,7 @@ def _coalesceTextNodeChildren( node, encoding=None ):
return ''.join( [ line.lstrip() for line in joined.splitlines(True) ] ).rstrip() return ''.join( [ line.lstrip() for line in joined.splitlines(True) ] ).rstrip()
def _extractDescriptionNode(parent, encoding=None): def _extractDescriptionNode(parent, encoding='utf-8'):
d_nodes = parent.getElementsByTagName('description') d_nodes = parent.getElementsByTagName('description')
if d_nodes: if d_nodes:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment