commit/galaxy-central: dannon: Missed a file in the previous commit, continuation of StoredWorkflowAnnotation for toolshed-imported workflows.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/af1a9f44b529/ Changeset: af1a9f44b529 User: dannon Date: 2013-06-18 20:27:34 Summary: Missed a file in the previous commit, continuation of StoredWorkflowAnnotation for toolshed-imported workflows. Affected #: 1 file diff -r f720e8e003f750a8c1f9c4f72ac4acadae9e761d -r af1a9f44b529bf8e46a5baf4ee693c0c4b7a390d lib/tool_shed/util/workflow_util.py --- a/lib/tool_shed/util/workflow_util.py +++ b/lib/tool_shed/util/workflow_util.py @@ -4,6 +4,7 @@ import galaxy.webapps.galaxy.controllers.workflow from galaxy import eggs from galaxy.util import json +from galaxy.util.sanitize_html import sanitize_html from galaxy.workflow.modules import InputDataModule from galaxy.workflow.modules import ToolModule from galaxy.workflow.modules import WorkflowModuleFactory @@ -390,7 +391,7 @@ # that's not possible here. This entire module # needs to die and get replaced with the regular # galaxy/workflow methods. - from galaxy.util.sanitize_html import sanitize_html + # See WORKFLOW_REFACTOR below. annotation = step_dict.get( 'annotation', '') if annotation: annotation = sanitize_html( annotation, 'utf-8', 'text/html' ) @@ -436,13 +437,25 @@ break return module_name -def save_workflow( trans, workflow ): +def save_workflow( trans, workflow, workflow_dict = None): """Use the received in-memory Workflow object for saving to the Galaxy database.""" stored = trans.model.StoredWorkflow() stored.name = workflow.name workflow.stored_workflow = stored stored.latest_workflow = workflow stored.user = trans.user + + # One more temporary hack like above to support workflow level annotations. + # Same caveats. + # WORKFLOW_REFACTOR + if workflow_dict and workflow_dict.get('annotation',''): + annotation = sanitize_html( workflow_dict['annotation'], 'utf-8', 'text/html' ) + new_annotation = trans.model.StoredWorkflowAnnotationAssociation() + new_annotation.annotation = annotation + new_annotation.user = trans.user + stored.annotations.append(new_annotation) + # End temporary hack + trans.sa_session.add( stored ) trans.sa_session.flush() # Add a new entry to the Workflows menu. Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org