コード例 #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
ファイル: dev_autodb.py プロジェクト: ilyakh/devilry-django
    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
ファイル: dev_autodb.py プロジェクト: TZer0/devilry-django
    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()
コード例 #4
0
    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)
コード例 #6
0
 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)