Beispiel #1
0
 def _register_and_run_actiongroup(self, actiongroup_name, task,
                                   context_object):
     # helper function
     # Shortcut for registering and starting an ActionGroup
     # as this will need to be set up frequently.
     batchregistry.Registry.get_instance().add_actiongroup(
         batchregistry.ActionGroup(
             name=actiongroup_name,
             mode=batchregistry.ActionGroup.MODE_ASYNCHRONOUS,
             actions=[task]))
     batchregistry.Registry.get_instance()\
         .run(actiongroup_name=actiongroup_name,
              context_object=context_object,
              test='test')
Beispiel #2
0
    def ready(self):
        from devilry.devilry_examiner.views.assignment.download_files import backends
        from devilry.devilry_compressionutil import backend_registry
        from ievv_opensource.ievv_batchframework import batchregistry
        from devilry.devilry_examiner import tasks

        backend_registry.Registry.get_instance().add(
            backends.DevilryExaminerZipBackend)

        # Add zip backend to registry
        batchregistry.Registry.get_instance().add_actiongroup(
            batchregistry.ActionGroup(
                name='batchframework_compress_assignment',
                mode=batchregistry.ActionGroup.MODE_ASYNCHRONOUS,
                actions=[tasks.AssignmentCompressAction]))
    def _run_actiongroup(self, name, task, context_object, started_by):
        """
        Helper method for adding operation and running task.

        Saves a little code in the test-function.
        """
        batchregistry.Registry.get_instance().add_actiongroup(
            batchregistry.ActionGroup(
                name=name,
                mode=batchregistry.ActionGroup.MODE_SYNCHRONOUS,
                actions=[task]))
        batchregistry.Registry.get_instance().run(
            actiongroup_name=name,
            context_object=context_object,
            started_by=started_by,
            test='test')
Beispiel #4
0
    def ready(self):
        # Add models to cradmin superuserui
        from django_cradmin.superuserui import superuserui_registry
        from devilry.devilry_group.views.download_files import backends
        from devilry.devilry_compressionutil import backend_registry
        from ievv_opensource.ievv_batchframework import batchregistry
        from devilry.devilry_group import tasks
        appconfig = superuserui_registry.default.add_djangoapp(
            superuserui_registry.DjangoAppConfig(app_label='devilry_group'))
        appconfig.add_all_models()

        # add zip backend to registry
        backend_registry.Registry.get_instance().add(
            backends.DevilryGroupZipBackend)

        # add actiongroup for zipping all files in a feedbackset to registry
        batchregistry.Registry.get_instance().add_actiongroup(
            batchregistry.ActionGroup(
                name='batchframework_compress_feedbackset',
                mode=batchregistry.ActionGroup.MODE_ASYNCHRONOUS,
                actions=[tasks.FeedbackSetCompressAction]))
Beispiel #5
0
    def ready(self):
        from devilry.devilry_admin.views.assignment.download_files import backends
        from devilry.devilry_compressionutil import backend_registry
        from ievv_opensource.ievv_batchframework import batchregistry
        from devilry.devilry_report import generator_registry as report_generator_registry
        from devilry.devilry_admin.views.period import all_results_generator
        from devilry.devilry_admin import tasks

        backend_registry.Registry.get_instance().add(
            backends.DevilryAdminZipBackend)

        # Add zip backend to registry
        batchregistry.Registry.get_instance().add_actiongroup(
            batchregistry.ActionGroup(
                name='batchframework_admin_compress_assignment',
                mode=batchregistry.ActionGroup.MODE_ASYNCHRONOUS,
                actions=[tasks.AssignmentCompressAction]))

        # All period-all-results-generator to the registry.
        report_generator_registry.Registry.get_instance().add(
            generator_class=all_results_generator.
            AllResultsExcelReportGenerator)