Commit ae9a5ccb authored by Ayush Tiwari's avatar Ayush Tiwari

erp5_data_notebook bt5: Merge portal_components JupyterCompile and AddPersistentMapping

parent 39334a31
# -*- coding: utf-8 -*-
from Products.ERP5Type.Globals import PersistentMapping
def AddPersistentMapping(self):
"""
Function to add PersistentMapping object which can be used as a dictionary
"""
new_dict = PersistentMapping()
return new_dict
def UpdatePersistentMapping(self, existing_dict):
"""
Function to update PersistentMapping object
"""
new_dict = PersistentMapping()
for key, value in existing_dict.iteritems():
new_dict[key]=value
return new_dict
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Extension Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>AddPersistentMapping</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>extension.erp5.AddPersistentMapping</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Extension Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
from StringIO import StringIO from StringIO import StringIO
from IPython.utils import py3compat from IPython.utils import py3compat
from IPython.utils.py3compat import unicode_type from IPython.utils.py3compat import unicode_type
from Products.ERP5Type.Globals import PersistentMapping
import sys import sys
import traceback import traceback
...@@ -85,3 +86,19 @@ def Base_compileJupyterCode(self, jupyter_code, old_local_variable_dict): ...@@ -85,3 +86,19 @@ def Base_compileJupyterCode(self, jupyter_code, old_local_variable_dict):
'traceback': tb_list, 'traceback': tb_list,
} }
return result return result
def AddPersistentMapping(self):
"""
Function to add PersistentMapping object which can be used as a dictionary
"""
new_dict = PersistentMapping()
return new_dict
def UpdatePersistentMapping(self, existing_dict):
"""
Function to update PersistentMapping object
"""
new_dict = PersistentMapping()
for key, value in existing_dict.iteritems():
new_dict[key]=value
return new_dict
\ No newline at end of file
...@@ -46,8 +46,8 @@ ...@@ -46,8 +46,8 @@
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple>
<string>W: 45, 18: Use of eval (eval-used)</string> <string>W: 46, 18: Use of eval (eval-used)</string>
<string>W: 58, 6: Use of exec (exec-used)</string> <string>W: 59, 6: Use of exec (exec-used)</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</item> </item>
<item> <item>
<key> <string>_module</string> </key> <key> <string>_module</string> </key>
<value> <string>AddPersistentMapping</string> </value> <value> <string>JupyterCompile</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</item> </item>
<item> <item>
<key> <string>_module</string> </key> <key> <string>_module</string> </key>
<value> <string>AddPersistentMapping</string> </value> <value> <string>JupyterCompile</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
extension.erp5.JupyterCompile extension.erp5.JupyterCompile
extension.erp5.AddPersistentMapping \ No newline at end of file
\ No newline at end of file
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