Пример #1
0
    def handle(self, *args, **options):
        from devilry.apps.core.testhelper import TestHelper
        verbosity = get_verbosity(options)
        self.no_groups = options['no_groups']
        setup_logging(verbosity)

        # NOTE: Not running flush - it messes up migrations
        #logging.info('Running manage.py flush')
        #management.call_command('flush', verbosity=0, interactive=False)

        self.testhelper = TestHelper()
#        from django.db import transaction
#        with transaction.commit_on_success():
        self.testhelper.create_superuser('grandma')
        self.testhelper.grandma.is_staff = True
        self.testhelper.grandma.save()
        logging.info('Creating users')
        self.create_users(bad_students)
        self.create_users(medium_students)
        self.create_users(good_students)
        self.create_users([('donald', 'Donald Duck'),
                           ('daisy', 'Daisy Duck'),
                           ('clarabelle', 'Clarabelle Duck'),
                           ('scrooge', 'Scrooge McDuck'),
                           ('della', 'Duck'),
                           ('gladstone', 'Gladstone Gander'),
                           ('fethry', 'Fethry Duck')])
        self._distributeStudentToExaminers()
        logging.info('Generating data (nodes, periods, subjects, deliveries...). Run with -v3 for more details.')
        self.create_duck1010()
        self.create_duck2500p()
        self.create_duck4000()
        self.create_duck6000()
        self.create_duck1100()
        self._unset_groupnames()
Пример #2
0
    def handle(self, *args, **options):
        verbosity = get_verbosity(options)
        setup_logging(verbosity)
        logging.info("Running manage.py flush")
        management.call_command("flush", verbosity=0, interactive=False)

        self.testhelper = TestHelper()
        #        from django.db import transaction
        #        with transaction.commit_on_success():
        self.testhelper.create_superuser("grandma")
        self.testhelper.grandma.is_staff = True
        self.testhelper.grandma.save()
        logging.info("Creating users")
        self.create_users(bad_students)
        self.create_users(medium_students)
        self.create_users(good_students)
        self.create_users(
            [
                ("donald", "Donald Duck"),
                ("daisy", "Daisy Duck"),
                ("clarabelle", "Clarabelle Duck"),
                ("scrooge", "Scrooge McDuck"),
                ("della", "Duck"),
                ("gladstone", "Gladstone Gander"),
                ("fethry", "Fethry Duck"),
            ]
        )
        self._distributeStudentToExaminers()
        logging.info("Generating data (nodes, periods, subjects, deliveries...). Run with -v3 for more details.")
        self.create_duck2500p()
        self.create_duck4000()
        self.create_duck6000()
        self.create_duck1100()
        self.create_duck1010()
        self._unset_groupnames()
Пример #3
0
    def handle(self, *args, **options):
        verbosity = get_verbosity(options)
        setup_logging(verbosity)
        logging.info('Running manage.py flush')
        management.call_command('flush', verbosity=0, interactive=False)

        self.testhelper = TestHelper()
        self.testhelper.create_superuser('grandma')
        self.testhelper.grandma.is_staff = True
        self.testhelper.grandma.save()
        logging.info('Creating users')
        self.create_users(bad_students)
        self.create_users(medium_students)
        self.create_users(good_students)
        self.create_users([('donald', 'Donald Duck'),
                           ('daisy', 'Daisy Duck'),
                           ('clarabelle', 'Clarabelle Duck'),
                           ('scrooge', 'Scrooge McDuck'),
                           ('della', 'Duck'),
                           ('gladstone', 'Gladstone Gander'),
                           ('fethry', 'Fethry Duck')])
        self._distributeStudentToExaminers()
        logging.info('Generating data (nodes, periods, subjects, deliveries...). Run with -v3 for more details.')
        self.create_duck4000()
        self.create_duck6000()
        self.create_duck1100()
        self.create_duck1010()
    def handle(self, *args, **options):
        setup_logging(get_verbosity(options))
        if len(args) != 1:
            raise CommandError('Requires an <appname>.')
        appname = args[0]
        appdir = get_staticdir_from_appname(appname)
        appfile = join(appdir, 'app.js')

        jsfile = AppFile(appfile, appname)
        #jsfile.prettyprint()
        jsfiles = jsfile.get_all_jsfiles()
        ordered = orderJsFiles(jsfiles)

        outfile = join(appdir, 'app-all.js')
        content = '\n\n'.join([j.filecontent for j in ordered])
        content += '\n\n' + jsfile.filecontent
        open(outfile, 'wb').write(content)
Пример #5
0
    def handle(self, *args, **options):
        verbosity = get_verbosity(options)
        setup_logging(verbosity)

        installhelp = options['installhelp']
        if installhelp:
            self.print_install_help()
            return

        if len(args) != 1:
            raise CommandError('<outdir> is required.')
        outdir = args[0]
        openbrowser = options['openbrowser']

        if not exists(outdir):
            raise CommandError('<outdir> {0} does not exist'.format(outdir))

        self.build(outdir, openbrowser)
 def handle(self, *args, **options):
     setup_logging(get_verbosity(options))
     all_modelnames = self._create_files_for_all_modules(get_restful_apps())
     self._create_requireall_file(all_modelnames)