Exemple #1
0
def parse_error(error_file):
    if not path(error_file).exists():
        return 'adel', 'caribu'

    s = open(error_file).read()
    lines = s.split('\n')
    lines = [l.strip() for l in lines if l.startswith('  ')]
    n = len(lines)
    for i in range(n):
        if lines[-i - 1].strip().startswith('File '):
            break

    lines = lines[-i - 1:]
    l = lines[0]
    filename = l.split(',')[0].split(' ')[-1].strip('"')
    src = str(path(filename).namebase)
    msg = '\n'.join(lines[1:])
    for pkg in universe:
        if pkg in msg:
            tgt = pkg
            break
        else:
            print msg
            tgt = ''

    path(error_file).move(curdir / 'errors' / error_file + str(count))

    if src in universe and tgt in universe:
        return src, tgt
    else:
        return 'adel', 'mtg'
def parse_error(error_file):
    if not path(error_file).exists():
        return 'adel', 'caribu'

    s = open(error_file).read()
    lines = s.split('\n')
    lines = [l.strip() for l in lines if l.startswith('  ')]
    n = len(lines)
    for i in range(n):
        if lines[-i-1].strip().startswith('File '):
            break

    lines = lines[-i-1:]
    l = lines[0]
    filename = l.split(',')[0].split(' ')[-1].strip('"')
    src = str(path(filename).namebase)
    msg = '\n'.join(lines[1:])
    for pkg in universe:
        if pkg in msg:
            tgt = pkg
            break
        else:
            print msg
            tgt = ''

    path(error_file).move(curdir/'errors'/error_file+str(count))

    if src in universe and tgt in universe:
        return src, tgt
    else:
        return 'adel', 'mtg'
Exemple #3
0
def run(cmd=None, error_file='error.txt', curdir=curdir):
    if cmd is None:
        cmd = 'ipython %s' % (curdir / 'test_adel.py')

    #sh('rm simple/*/*.pyc')
    status = sh(cmd)
    if path(error_file).exists():
        if liquidparser.knowcaller:
            return parse_error(error_file)
        else:
            path(error_file).move(curdir / 'errors' / error_file + str(count))
            return -1, -1
    else:
        return status
def run(cmd=None, error_file='error.txt', curdir=curdir):
    if cmd is None:
        cmd = 'ipython %s' % (curdir/'test_adel.py')

    #sh('rm simple/*/*.pyc')
    status = sh(cmd)
    if path(error_file).exists():
        if liquidparser.knowcaller:
            return parse_error(error_file)
        else:
            path(error_file).move(curdir/'errors'/error_file+str(count))
            return -1, -1
    else:
        return status
Exemple #5
0
repos['adel'] = 'svn'
repos['caribu'] = 'svn'
repos['mtg'] = 'svn'
repos['rpy2'] = 'pypi'
repos['pandas'] = 'pypi'

pkgs = liquid.pkg_versions(universe, init_config, versions, endof)

env = liquid.MyEnv(universe, pkgs)

###############################################################################
# Script Execution
###############################################################################

# Where?
curdir = path('.').abspath()
pkg_dir = curdir

# Alias
pkg2int = env.pkg2int  # dict(zip(universe, range(1, len(universe)+1)))
int2pkg = env.int2pkg  # dict(zip(pkg2int.values(), pkg2int.keys()))
bidir = env.bidir_commits  # _convert_commits(pkgs)

###############################################################################
# Usefuff methods
###############################################################################

# TODO: remove all the side effects


def clock():
repos['mtg'] = 'svn'
repos['rpy2'] = 'pypi'
repos['pandas'] = 'pypi'



pkgs = liquid.pkg_versions(universe, init_config, versions, endof)

env = liquid.MyEnv(universe, pkgs)

###############################################################################
# Script Execution
###############################################################################

# Where?
curdir = path('.').abspath()
pkg_dir = curdir


# Alias
pkg2int = env.pkg2int  # dict(zip(universe, range(1, len(universe)+1)))
int2pkg = env.int2pkg  # dict(zip(pkg2int.values(), pkg2int.keys()))
bidir = env.bidir_commits  # _convert_commits(pkgs)

###############################################################################
# Usefuff methods
###############################################################################

# TODO: remove all the side effects

def clock():