Exemple #1
0
def init_repo(path):
    """Clone the gh-pages repo to a given location."""
    sh("git clone {} {}".format(pages_repo, path))
    here = os.getcwdu()
    cd(path)
    sh("git checkout gh-pages")
    cd(here)
Exemple #2
0
def init_repo(path):
    """clone the gh-pages repo if we haven't already."""
    sh("git clone %s %s"%(pages_repo, path))
    here = os.getcwdu()
    cd(path)
    sh('git checkout gh-pages')
    cd(here)
Exemple #3
0
    def simulate(self):
        os.environ['EXPORT_ABNORMAL_FLOW'] = 'TRUE' if self.args.export_ano else 'FALSE'
        cd(self.ROOT + '/Simulator')
        sh('python fs.py %s -t %d' % (self.dot_file, self.sim_t))
        dir = self.args.dir
        if dir:
            if not os.path.exists(dir): os.makedirs(dir)
            sh('cp *.txt %s' % (dir))

        cd(self.ROOT)
def run():
        '''pick a file/dir from the current directory. If it's a file, play it. 
        Else (we picked a directory) cd into that directory and recurse.'''

        f = pickAFile()
        if '.' in f:	# f is a file\
                cmd('"C:\\Program Files\\VideoLAN\\VLC\\vlc.exe" "%s"&' %f)
        else:	# f is a dir
                cd(f)
                run()
def play(rootDir, playerPath=None):
	cd(rootDir)
	files = [i for i in ls('.') if not ignore in i or not (isdir(i) and not(ls(i)))]
	choice = files[rand(0, len(files)-1)]
	if isdir(choice):
		play(choice)
	else:
		if not playerPath:
			cmd("%s %s" %(getPlayer(), choice))
		else:
			cmd("%s %s" %(playerPath, choice))
Exemple #6
0
 def _ensure_checkouts(self):
   if not os.path.exists(PYFASTIMPORT):
     cd(VENDOR)
     bzr('branch', 'lp:python-fastimport')
   if not os.path.exists(BZRFASTIMPORT):
     cd(VENDOR)
     bzr('branch', 'lp:bzr-fastimport', BZRFASTIMPORT)
   python_path = ('PYTHONPATH' in os.environ
                  and os.environ['PYTHONPATH']
                  or '')
   if not python_path.startswith(PYFASTIMPORT):
     os.environ['PYTHONPATH'] = PYFASTIMPORT
   os.environ['BZR_PLUGIN_PATH'] = VENDOR
   os.environ['BZR_PDB'] = '1'
Exemple #7
0
  def _setup_bzr_branches(self):
    memo = '%s_%s_%s' % (TESTDIR, self.__class__.__name__, TIMESTAMP)
    if os.path.exists(memo):
      rmdir(TESTDIR)
      shutil.copytree(memo, TESTDIR)
    else:
      # make a bzr branch to interact with
      rmdir(TESTDIR)
      mkdir(TESTDIR)
      cd(TESTDIR)
      bzr('init', BZRBRANCH)
      cd(BZRBRANCH)
      open('touch.txt', 'w').write('touch')
      bzr('add', '-v', 'touch.txt')
      bzr('commit', '-v', '-m', 'touch test')
      open('touch2.txt', 'w').write('touch2')
      bzr('add', 'touch2.txt')
      bzr('commit', '-m', 'touch2 test')
      bzr('tag', 'some_tag')

      # make another branch to test import later
      cd(TESTDIR)
      bzr('branch', BZRBRANCH, '%s_imported' % BZRBRANCH)

      # make a default clone
      cd(TESTDIR)
      gitbzr('clone', BZRBRANCH, '%s_cloned' % BZRBRANCHNAME)

      # clear old memos and copy it to our memo
      old_memo_glob = '%s_%s_*' % (TESTDIR, self.__class__.__name__)
      old_memos = glob.iglob(old_memo_glob)
      for path in old_memos:
        shutil.rmtree(path)
      shutil.copytree(TESTDIR, memo)
Exemple #8
0
  def test_push_relative_path(self):
    cd('%s_cloned' % BZRBRANCH)
    open('touch2.txt', 'w').write('CLONED')
    git('add', 'touch2.txt')
    git('commit', '-m', 'touched touch2')

    # push back to previous bzr branch
    gitbzr('push', '../%s' % BZRBRANCHNAME)
    self.assertEqual('CLONED', open('%s/touch2.txt' % BZRBRANCH).read())

    open('touch2.txt', 'w').write('CLONED2')
    git('add', 'touch2.txt')
    git('commit', '-m', 'touched2 touch2')
    gitbzr('push')
    self.assertEqual('CLONED2', open('%s/touch2.txt' % BZRBRANCH).read())

    # push to a new repo
    gitbzr('push', '../%s_new' % BZRBRANCHNAME)
    cd('%s_new' % BZRBRANCH)
    bzr('checkout', '.')
    self.assertEqual('CLONED2', open('%s_new/touch2.txt' % BZRBRANCH).read())
def gitclone(repo, setup_arg='install'):

    cd(CODE)

    # Clone the code.
    run('git clone %s' % repo)

    # Install requirements.
    _, folder = os.path.split(repo)
    folder, _ = os.path.splitext(folder)
    requirements = join(CODE, folder, 'requirements.txt')
    try:
        with open(requirements):
            pass
    except IOError:
        pass
    else:
        run('%s install -r %s' % (pip, requirements))

    # Setup.
    cd(folder)
    run('%s setup.py %s' % (python, setup_arg))
Exemple #10
0
 def test_gitbzr_init_master(self):
   # make a new git repo
   INITGIT = os.path.join(TESTDIR, 'init_master_git')
   INITBZR = os.path.join(TESTDIR, 'init_master_bzr')
   cd(TESTDIR)
   git('init', INITGIT)
   cd(INITGIT)
   open('touch.txt', 'w').write('touch')
   git('add', 'touch.txt')
   git('commit', '-a', '-m', 'touch1')
   gitbzr('init')
   gitbzr('push', INITBZR)
   cd(TESTDIR)
   bzr('branch', INITBZR, '%s_working' % INITBZR)
   cd('%s_working' % INITBZR)
   self.assertEquals('touch', open('touch.txt').read())
Exemple #11
0
  def _setup_bzr_branches(self):
    # make a bzr branch to interact with
    rmdir(TESTDIR)
    mkdir(TESTDIR)
    cd(TESTDIR)
    bzr('init', BZRBRANCH)
    cd(BZRBRANCH)
    open('touch.txt', 'w').write('touch')
    print "hmm?"
    bzr('add', '-v', 'touch.txt')
    bzr('commit', '-v', '-m', 'touch test')
    print "hmm2?"
    open('touch2.txt', 'w').write('touch2')
    bzr('add', 'touch2.txt')
    bzr('commit', '-m', 'touch2 test')

    # make another branch to test import later
    cd(TESTDIR)
    bzr('branch', BZRBRANCH, '%s_imported' % BZRBRANCH)

    # make a default clone
    cd(TESTDIR)
    gitbzr('clone', BZRBRANCH, '%s_cloned' % BZRBRANCHNAME)
Exemple #12
0
        [v.split("=")[1].strip(" '\n.") for v in info_lines if re.match("^_version_(major|minor|micro|extra)", v)]
    )
    print("Source version: ", source_version)

    # check for dev tag
    if source_version.split(".")[-1] == "dev":
        dev = True
        print("Development Version detected")
    else:
        dev = False

    # pull current docs_repo
    if not os.path.exists(docs_repo_path):
        print("docs_repo not found, pulling from git..")
        sh("git clone %s %s" % (docs_repo_url, docs_repo_path))
    cd(docs_repo_path)
    print("Moved to " + os.getcwd())
    try:
        sh("git checkout gh-pages")
    except:
        while 1:
            print("\nLooks like gh-pages branch does not exist!")
            print("Do you want to create a new one? (y/n)")
            choice = str(input()).lower()
            if choice == "y":
                sh("git checkout -b gh-pages")
                sh("rm -rf *")
                sh("git add .")
                sh("git commit -m 'cleaning gh-pages branch'")
                sh("git push origin gh-pages")
                break
Exemple #13
0
	run('curl -o .gitignore https://raw.githubusercontent.com/github/gitignore/master/Node.gitignore')	
	gitignore = open(name + '.gitignore', 'a')
	gitignore.write('lib\n')

commands = [
	"curl -u '" + user + "' https://api.github.com/user/repos -d '{\"name\":\"" + name + "\"}'",
	'mkdir app',
	'touch README'
	'git init',
	"git remote add origin https://github.com/" + user + "/" + name + ".git",
	'touch app/.bowerrc'
	'touch app/index.html'
	'mkdir app/css',
	'touch app/css/main.css',
	'mkdir app/js',
	'touch app/js/main.js',
	'mkdir app/lib',
	'mkdir app/img',
]

run('mkdir ' + name)
cd(name)

for command in commands:
	print(command)
	run(command)

setup_bower()
setup_gitignore()

Exemple #14
0
def setup_gitignore():
	cd('app')
	run('curl -o .gitignore https://raw.githubusercontent.com/github/gitignore/master/Node.gitignore')	
	gitignore = open(name + '.gitignore', 'a')
	gitignore.write('lib\n')
Exemple #15
0
#!/usr/bin/python

from os import system as call
from os import chdir as cd
from os import environ as env
from getpass import getuser as user
from sys import exit

print 'Building map files...'
cd(env['QIE10ROOT'] + '/src')
call('./remap')

print 'Building the analyzer core...'
call('python generate.py')
cd(env['QIE10ROOT'])

print 'Compiling the analyzer...'
call('scram b -j 8')
print 'Analyzer compiled.'

print 'Installion complete.'
def init_repo(path):
    """clone the gh-pages repo if we haven't already."""
    sh("git clone %s %s" % (pages_repo, path))
    cd(path)
    sh("git checkout %s" % dest_branch)
Exemple #17
0
  def test_all(self):
    """Test most of the functionality.

    This test is a bit large, it is ported directly from a shell script.
    """
    # TEST: clone with git-bzr-ng
    # it should guess the name correctly but notice that the directory already
    # exists and failed
    cd(TESTDIR)
    self.assertRaises(subprocess.CalledProcessError,
                      gitbzr, 'clone', BZRBRANCH)

    # TEST: clone it again with a better name
    gitbzr('clone', BZRBRANCH, '%s_git' % BZRBRANCHNAME)

    # Check for the branches we want
    cd('%s_git' % BZRBRANCH)
    branches = git('branch', '-a')
    if 'bzr/master' not in branches:
      self.fail('no bzr/master branch')
    if '* master' not in branches:
      self.fail('not on master branch')

    # Check for files we expect
    self.assertEqual('touch', open('touch.txt').read())

    # push to a new branch
    git('checkout', '-b', 'pushed')
    open('touch2.txt', 'w').write('touch3')
    git('add', 'touch2.txt')
    git('commit', '-m', 'touch3 test')
    gitbzr('push', '%s_pushed' % BZRBRANCH)

    # do it again
    open('touch2.txt', 'w').write('touch4')
    git('add', 'touch2.txt')
    git('commit', '-m', 'touch4 test')
    gitbzr('push')

    # update the bzr branch and sync the changes
    # that bzr repo is not a working tree repo so we need to branch it in bzr
    # and then push the changes back
    cd(TESTDIR)
    bzr('branch', '%s_pushed' % BZRBRANCH, '%s_branched' % BZRBRANCH)
    cd('%s_branched' % BZRBRANCH)
    open('touch2.txt', 'w').write('touch5')
    bzr('commit', '-m', 'touch5')
    bzr('push', '%s_pushed' % BZRBRANCH)
    cd('%s_git' % BZRBRANCH)
    gitbzr('sync')

    # try to push again from git, should fail because we have not merged the
    # changes
    self.assertEquals('touch4', open('touch2.txt').read())
    self.assertRaises(subprocess.CalledProcessError, gitbzr, 'push')

    # this one should fail since there is nothing to commit
    git('pull', '.', '--', 'bzr/pushed')
    self.assertEquals('touch5', open('touch2.txt').read())
    self.assertRaises(subprocess.CalledProcessError, gitbzr, 'push')

    # edit a file and try to push
    open('touch2.txt', 'w').write('touch6')
    git('add', 'touch2.txt')
    git('commit', '-m', 'touch6')
    gitbzr('push')

    # pull in our bzr branch and make sure we get the change
    cd('%s_branched' % BZRBRANCH)
    bzr('pull')
    self.assertEquals('touch6', open('touch2.txt').read())

    # TEST: import another branch and pull changes from `pushed`
    cd('%s_git' % BZRBRANCH)
    gitbzr('import', '%s_imported' % BZRBRANCH, 'imported')
    git('checkout', 'imported')
    git('pull', '.', '--', 'pushed')
    gitbzr('push')
Exemple #18
0
elif args.op == 'list':
    print('\n'.join(selected))

elif args.op == 'show':
    text = '\n\n'.join(entries[k] for k in selected)
    if stdout.isatty():
        temp_file = mkstemp(FILE_EXTENSION)[1]
        with open(temp_file, 'w') as fd:
            fd.write(text)
        chmod(temp_file, S_IRUSR)
        if fork():
            wait()
            rm(temp_file)
        else:
            cd(args.directory)
            editor = environ.get('VISUAL', environ.get('EDITOR', 'nvim'))
            vim_args = [editor, temp_file, '-c', 'set hlsearch nospell']
            if args.terms:
                vim_args[-1] += ' ' + ('nosmartcase' if args.icase else 'noignorecase')
                vim_args.extend(("-c", r'let @/="\\v' + "|".join("({})".format(term) for term in args.terms).replace('"', r'\"').replace("@", r"\\@") + "\""))
            execvp('nvim', vim_args)
    else:
        print(text)

elif args.op == 'update':
    for journal in journal_files:
        rel_path = relpath(journal, args.directory)
        with open(journal) as fd:
            lines = fd.read().splitlines()
        for line_number, line in enumerate(lines, start=1):
Exemple #19
0
from os import system as cmd
from os import chdir as cd
from os.path import join
from os.path import normcase as nc
from os.path import normpath as np
path = "C:\\"
cd(path)
while True:
    i = input('> ')
    if i.startswith('cd ') and not i == 'cd ':
        path = nc(np(join(path, i[3:])))
        cd(path)
    else:
        cmd(i)
 the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
'''

from os import system as cmd, listdir as ls, chdir as cd

def convertToTIFF():
    for i in ls('.'):
            fname = i.split('.')[0].replace(" ", "\\ ")
            cmd('ddjvu -format=tiff %s.djvu %s_tiff.tiff' %(fname, fname))
            cmd('rm -f "%s"' %i)

def converToPDF():
    for i in (_ for _ in ls('.') if _.endswith(".tiff")):
            fname = i.split('.')[0].replace(" ", "\\ ")
            cmd('tiff2pdf -j -o  "%s.pdf"  "%s_tiff.tiff"' %(fname, fname))
            cmd('rm -f "%s"' %i)

if __name__ == "__main__":
    cd('/home/ashwin/Desktop/Trying/')
    convertToTIFF()
    converToPDF()

Exemple #21
0
    try:
        tag = sys.argv[1]
    except IndexError:
        try:
            tag = sh2('git describe --exact-match')
        except CalledProcessError:
            tag = "dev"   # Fallback
            print("Using dev")
    
    startdir = os.getcwdu()
    if not os.path.exists(pages_dir):
        # init the repo
        init_repo(pages_dir)
    else:
        # ensure up-to-date before operating
        cd(pages_dir)
        sh('git checkout gh-pages')
        sh('git pull')
        cd(startdir)

    dest = pjoin(pages_dir, tag)

    # don't `make html` here, because gh-pages already depends on html in Makefile
    # sh('make html')
    if tag != 'dev':
        # only build pdf for non-dev targets
        #sh2('make pdf')
        pass

    # This is pretty unforgiving: we unconditionally nuke the destination
    # directory, and then copy the html tree in there
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
'''

from os import getcwd as pwd, listdir as ls, system as cmd, chdir as cd
from random import randint as rand

def pickAFile():
        '''Pick a random file or directory from the current directory and return it'''
        files = [i for i in ls('.') if not ignore in i]
        f = files[rand(0, (len(files) -1))]
        return f

def run():
        '''pick a file/dir from the current directory. If it's a file, play it. 
        Else (we picked a directory) cd into that directory and recurse.'''

        f = pickAFile()
        if '.' in f:	# f is a file\
                cmd('"C:\\Program Files\\VideoLAN\\VLC\\vlc.exe" "%s"&' %f)
        else:	# f is a dir
                cd(f)
                run()

if __name__ == "__main__":
        ignore = pwd().split('\\')[-1]
        cd("..")
        run()
Exemple #23
0
  def test_import_strip_tags(self):
    # assert that the imported repo has our tag
    cd(TESTDIR)
    cd('%s_cloned' % BZRBRANCHNAME)
    rv = git('tag')
    self.assert_('some_tag' in rv)

    # add an invalid tag and make sure it doesn't get imported
    cd('%s_imported' % BZRBRANCH)
    bzr('tag', 'some~invalid!tag')
    cd(TESTDIR)
    cd('%s_cloned' % BZRBRANCHNAME)

    # the first try should fail due to an invalid tag
    self.assertRaises(subprocess.CalledProcessError,
                      gitbzr,
                      'import',
                      '%s_imported' % BZRBRANCH,
                      'import_fail')
    gitbzr('import', '--strip_tags', '%s_imported' % BZRBRANCH, 'import_win')
    rv = git('tag')
    self.assert_('some~invalid!tag' not in rv)

    # test that clone supports the flag also
    cd(TESTDIR)
    self.assertRaises(subprocess.CalledProcessError,
                      gitbzr, 'clone', '%s_imported' % BZRBRANCH, 'import_fail')
    gitbzr('clone', '--strip_tags', '%s_imported' % BZRBRANCH, 'import_win')
Exemple #24
0
from src.game import game_world as game
from os import chdir as cd

if __name__ == '__main__':
    cd("src")  # gamb mode-on
    game()
Exemple #25
0
        tag = sys.argv[1]
    except IndexError:
        tag = sh2('git describe')
        
    startdir = os.getcwd()
    dest = pjoin(gh_pages, tag)

    sh('make html')
    
    # This is pretty unforgiving: we unconditionally nuke the destination
    # directory, and then copy the html tree in there
    shutil.rmtree(dest, ignore_errors=True)
    shutil.copytree(html_dir, dest)

    try:
        cd(gh_pages)
        status = sh2('git status | head -1')
        branch = re.match('\# On branch (.*)$', status).group(1)
        if branch != 'gh-pages':
            e = 'On %r, git branch is %r, MUST be "gh-pages"' % (gh_pages,
                                                                 branch)
            raise RuntimeError(e)

        sh('git add %s' % tag)
        new_htmlindex('index.html', tag)
        sh('git add index.html')
        sh('git commit -m"Created new doc release, named: %s"' % tag)
        print
        print 'Most recent 3 commits:'
        sys.stdout.flush()
        sh('git --no-pager log --oneline HEAD~3..')
Created on Aug 7, 2010

@author: ashwin

 Licensed to Ashwin Panchapakesan under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 Ashwin licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
'''
from os.path import isdir
from os import listdir as ls, chdir as cd
import easygui, shutil
easygui.msgbox("Uninstallation", "Ashwin's Badass Simpsons Player", ok_button="Begin Uninstallation")
easygui.msgbox("By default, this program should be installed in: C:\\Program Files\\Random Player\\", \
				"Ashwin's Badass Simpsons Player", ok_button="Begin Uninstallation")

installpath = easygui.diropenbox("Where is the program installed?", "Ashwin's Badass Simpsons Player", "C:\\Program Files\\Random Player\\")
cd(installpath)
shutil.rmtree(installpath)

easygui.msgbox("Uninstallation Finished", "Ashwin's Badass Simpsons Player")
Exemple #27
0
  def _ensure_checkouts(self):
    exec_path = ('PATH' in os.environ
                 and os.environ['PATH']
                 or '')
    if not exec_path.startswith(BZR):
      os.environ['PATH'] = '%s:%s' % (BZR, exec_path)

    download_url = 'http://launchpad.net/bzr/%s/%s/+download/bzr-%s.tar.gz'
    tarball = 'bzr-%s.tar.gz'
    for v in VERSIONS:
      if not os.path.exists(BZRPATH % v[1]):
        logging.info('Downloading %s', download_url % (v[0], v[1], v[1]))
        cd(VENDOR)
        check_output(['curl', '-O', '-L',
                      download_url % (v[0], v[1], v[1])
                      ])
        check_output(['tar', '-xzf', tarball % v[1]])

    # we need a functional bzr on our path to get anything else
    self._symlink_bzr(BZRPATH % '2.3.1')

    bzr_head = BZRPATH % 'head'
    if not os.path.exists(bzr_head):
      logging.info('Getting HEAD of bzr')
      cd(VENDOR)
      bzr('branch', 'lp:bzr', BZRPATH % 'head')

    if not os.path.exists(PYFASTIMPORT):
      logging.info('Getting a HEAD of python-fastimport')
      cd(VENDOR)
      bzr('branch', 'lp:python-fastimport')

    if not os.path.exists(PLUGINDIR):
      os.mkdir(PLUGINDIR)

    if not os.path.exists(BZRFASTIMPORT_STABLE):
      logging.info('Getting revision 307 of bzr-fastimport')
      cd(VENDOR)
      bzr('branch', 'lp:bzr-fastimport', '-r', '307', BZRFASTIMPORT_STABLE)

    if not os.path.exists(BZRFASTIMPORT_HEAD):
      logging.info('Getting HEAD of bzr-fastimport')
      cd(VENDOR)
      bzr('branch', 'lp:bzr-fastimport', BZRFASTIMPORT_HEAD)

    if not os.path.exists(BZRFASTIMPORT_STABLE_TARBALL):
      logging.info('Downloading bzr-fastimport version 0.10')
      cd(VENDOR)
      check_output(['curl', '-O', '-L',
                    'http://launchpad.net/bzr-fastimport/trunk/'
                    '0.10.0/+download/bzr-fastimport-0.10.0.tar.gz'
                    ])
      check_output(['tar', '-xzf', 'bzr-fastimport-0.10.0.tar.gz'])

    python_path = ('PYTHONPATH' in os.environ
                   and os.environ['PYTHONPATH']
                   or '')
    if not python_path.startswith(PYFASTIMPORT):
      os.environ['PYTHONPATH'] = '%s:%s' % (PYFASTIMPORT, BZR)

    os.environ['BZR_PLUGIN_PATH'] = PLUGINDIR
    os.environ['BZR_PDB'] = '1'
Exemple #28
0
run('svn up')

# create build dir for cmake
if not exists('build'): md('build')

# prepare bin dir and data files
if not exists('bin'): md('bin')
if not exists('bin/data'):
	md('bin/data')
	for i in ls('data'):
		src='data/'+i
		if isfile(src):
			print 'copying:', src
			copy(src, 'bin/data')

# configure cmake
cd('build')
if osname=='nt':
	run('cmake .. -G "MinGW Makefiles"')
else:
	run('cmake ..')

# start make
run('make')

# for the first time, generate dict
cd('../bin')
if isfile('unit_test') and not isfile('data/core.ocd'):
	run('./unit_test')

Exemple #29
0
import sys
from collections import defaultdict
from itertools import product
from os import chdir as cd, environ
from os.path import basename, dirname, join as join_path, realpath
from shutil import copyfile
from subprocess import run as run_process, PIPE, TimeoutExpired
from tempfile import TemporaryDirectory
from textwrap import dedent

DGLIB = join_path(dirname(__file__), 'dglib.py')

DEMOGRADER_ROOT = dirname(realpath(__file__))
django_site_root = join_path(DEMOGRADER_ROOT, '..')
cd(django_site_root)
sys.path.insert(0, django_site_root)
environ.setdefault("DJANGO_SETTINGS_MODULE", "djangosite.settings")

import django
import django_rq

DISPATCH_QUEUE = None
EVALUATION_QUEUE = None

def get_dispatch_queue():
    return django_rq.get_queue('dispatch')

def get_evaluation_queue():
    return django_rq.get_queue('evaluation')

def evaluate_submission(result):