<commit_before>import os.path
from fabric.api import run, local, put, cd, sudo, env


def lgru():
    env.hosts = ['<EMAIL>:222']
    env.path = '/var/www/vhosts/aa.lgru.net/'

#def sarma():
    #env.hosts = ['<EMAIL>']
    #env.path = '/home/sarma/www/fr.stdin.oralsite2/'

def sarma():
    env.hosts = ['<EMAIL>']
    env.path = '/home/sarma/www/be.sarma/'

def aa():
    env.hosts = ['<EMAIL>']
    env.path = '/var/www/vhosts/activearchives.org/wsgi/vj13/'

def fix_permissions():
    # fixes permission issues
    sudo('chown -R %s:www-data %s' % (env.user, env.path))
    sudo('chmod -R g+w %saa.core' % env.path)
    sudo('apache2ctl graceful')

def deploy(treeish='HEAD'):
    # makes a tarball of the django project and transfers it
    local('git archive %s . | gzip > project.tar.gz' % treeish)
    put('project.tar.gz', env.path)
    local('rm project.tar.gz')

    # backups old versions
    with cd(env.path):
        import time
        timestamp = time.strftime('%Y%m%d%H%M%S')
        try:
            run('mv aa.core aa.core.%s.bak' % timestamp)
        except:
            pass
        run('mkdir aa.core')

    # gunzips the new django project
    with cd(env.path + 'aa.core/'):
        run('tar zxvf ../project.tar.gz')
        run('rm ../project.tar.gz')
        # put back the database and the git repository
        run('cp ../aa.core.%s.bak/run/aa.db run/' % timestamp)
        #run('cp ../aa.core.%s.bak/run/*.db run/' % timestamp)
        run('cp -r ../aa.core.%s.bak/run/repositories run/' % timestamp)
        # make alias media
        #run('ln -s /root/src/Django-1.2.1/django/contrib/admin/media/')

    fix_permissions()<commit_msg>Changed fabfile for the new devellopment scheme<commit_after>import os.path
from fabric.api import run, local, put, cd, sudo, env


def lgru():
    env.hosts = ['<EMAIL>:222']
    env.path = '/var/www/vhosts/aa.lgru.net/'

#def sarma():
    #env.hosts = ['<EMAIL>']
    #env.path = '/home/sarma/www/fr.stdin.oralsite2/'

def sarma():
    env.hosts = ['<EMAIL>']
    env.path = '/home/sarma/www/be.sarma/'

def aa():
    env.hosts = ['<EMAIL>']
    env.path = '/var/www/vhosts/activearchives.org/wsgi/vj13/'

def fix_permissions():
    # fixes permission issues
    sudo('chown -R %s:www-data %s' % (env.user, env.path))
    sudo('chmod -R g+w %saa.core' % env.path)
    sudo('apache2ctl graceful')

def deploy(treeish='HEAD'):
    # makes a tarball of the django project and transfers it
    local('git archive %s . | gzip > project.tar.gz' % treeish)
    put('project.tar.gz', env.path)
    local('rm project.tar.gz')

    # backups old versions
    with cd(env.path):
        import time
        timestamp = time.strftime('%Y%m%d%H%M%S')
        try:
            run('mv aa.core aa.core.%s.bak' % timestamp)
        except:
            pass
        run('mkdir aa.core')

    # gunzips the new django project
    with cd(env.path + 'aa.core/'):
        run('tar zxvf ../project.tar.gz')
        run('rm ../project.tar.gz')
        # put back the database and the git repository
        #run('cp ../aa.core.%s.bak/run/aa.db run/' % timestamp)
        #run('cp ../aa.core.%s.bak/run/*.db run/' % timestamp)
        #run('cp -r ../aa.core.%s.bak/run/repositories run/' % timestamp)
        # make alias media
        #run('ln -s /root/src/Django-1.2.1/django/contrib/admin/media/')

    fix_permissions()
{'fraction_non_alphanumeric': 0.17874109263657958, 'fraction_numerical': 0.0059382422802850355, 'mean_word_length': 2.3723723723723724, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 10, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1108939', 'n_tokens_mistral': 1301, 'n_tokens_neox': 1220, 'n_words': 273}