def update_workflows(request): """ ajax function for updating available workflows from galaxy """ print "analysis_manager.views.update_workflows" if request.is_ajax(): #print "is ajax" workflow_engines = WorkflowEngine.objects.all() workflows = 0 for engine in workflow_engines: # function for updating workflows from galaxy instance get_workflows(engine) new_workflow_count = engine.workflow_set.all().count() print "Engine: " + engine.name + " - " + str( (new_workflow_count)) + ' workflows after.' workflows += new_workflow_count # getting updated available workflows workflows = Workflow.objects.all() json_serializer = serializers.get_serializer("json")() return HttpResponse(json_serializer.serialize(workflows, ensure_ascii=False), mimetype='application/javascript') else: return HttpResponse(status=400)
def import_workflows(request): workflow_engines = WorkflowEngine.objects.all() workflows = 0 for engine in workflow_engines: get_workflows(engine) new_workflow_count = engine.workflow_set.all().count() logger.debug("Engine: " + engine.name + " - " + str(new_workflow_count) + ' workflows after.') workflows += new_workflow_count return HttpResponse(str(workflows) + ' workflows imported.')
def update_workflows(request): """ajax function for updating available workflows from galaxy""" logger.debug("analysis_manager.views.update_workflows") if request.is_ajax(): workflow_engines = WorkflowEngine.objects.all() workflows = 0 for engine in workflow_engines: # function for updating workflows from galaxy instance get_workflows(engine) new_workflow_count = engine.workflow_set.all().count() logger.debug("Engine: %s - %s workflows after", engine.name, str(new_workflow_count)) workflows += new_workflow_count # getting updated available workflows workflows = Workflow.objects.all() json_serializer = serializers.get_serializer("json")() return HttpResponse(json_serializer.serialize(workflows, ensure_ascii=False), content_type='application/javascript') return HttpResponse(status=400)
def update_workflows(request): """ajax function for updating available workflows from galaxy""" logger.debug("analysis_manager.views.update_workflows") if request.is_ajax(): workflow_engines = WorkflowEngine.objects.all() workflows = 0 for engine in workflow_engines: # function for updating workflows from galaxy instance get_workflows(engine) new_workflow_count = engine.workflow_set.all().count() logger.debug("Engine: %s - %s workflows after", engine.name, str(new_workflow_count)) workflows += new_workflow_count # getting updated available workflows workflows = Workflow.objects.all() json_serializer = serializers.get_serializer("json")() return HttpResponse( json_serializer.serialize(workflows, ensure_ascii=False), mimetype='application/javascript') else: return HttpResponse(status=400)
def handle(self, **options): workflow_engines = WorkflowEngine.objects.all() workflows = 0 self.stdout.write("%d workflow engines found" % workflow_engines.count()) for engine in workflow_engines: self.stdout.write("Importing from workflow engine '%s' ..." % engine.name) old_workflow_count = engine.workflow_set.all().count() engine_issues = get_workflows(engine) if len(engine_issues) > 0: self.stdout.write("\n".join(engine_issues)) new_workflow_count = engine.workflow_set.all().count() self.stdout.write( "%d workflows imported from engine '%s'..." % (new_workflow_count-old_workflow_count, engine.name)) workflows += new_workflow_count - old_workflow_count self.stdout.write("%d workflows imported from %d workflow engines" % (workflows, workflow_engines.count()))
def handle(self, **options): workflow_engines = WorkflowEngine.objects.all() workflows = 0 self.stdout.write("%d workflow engines found" % workflow_engines.count()) for engine in workflow_engines: self.stdout.write("Importing from workflow engine '%s' ..." % engine.name) old_workflow_count = engine.workflow_set.all().count() engine_issues = get_workflows(engine) if len(engine_issues) > 0: self.stdout.write("\n".join(engine_issues)) new_workflow_count = engine.workflow_set.all().count() self.stdout.write( "%d workflows imported from engine '%s'..." % (new_workflow_count - old_workflow_count, engine.name)) workflows += new_workflow_count - old_workflow_count self.stdout.write("%d workflows imported from %d workflow engines" % (workflows, workflow_engines.count()))
def handle(self, **options): """ workflow_engine_objects = [] WorkflowEngine.objects.all().delete() for instance in Instance.objects.all(): workflow_engine_object = WorkflowEngine.objects.create( instance=instance, name=instance.description, summary=instance.base_url + " " + instance.api_key ) # TODO: introduce group managers and assign ownership to them workflow_engine_object.set_manager_group( ExtendedGroup.objects.public_group().manager_group ) #workflow_engine_object.share( ExtendedGroup.objects.public_group() ) workflow_engine_objects.append( workflow_engine_object ) for workflow_engine in workflow_engine_objects: print(str(workflow_engine)) """ workflow_engines = WorkflowEngine.objects.all() workflows = 0 print str( workflow_engines.count() ) + " workflow engines found" for engine in workflow_engines: print "Importing from workflow engine \"" + engine.name + "\" ..." old_workflow_count = engine.workflow_set.all().count() engine_issues = get_workflows( engine ); if len( engine_issues ) > 0: print "\n".join( engine_issues ) new_workflow_count = engine.workflow_set.all().count() print str( ( new_workflow_count-old_workflow_count ) ) + " workflows imported from workflow \"" + engine.name + "\" ..." workflows += (new_workflow_count-old_workflow_count) print str( workflows ) + " workflows imported from " + str( workflow_engines.count() ) + " workflow engines"