# Argumentos interesantes
obj = sys.argv[1]
+try:
+ pos = obj.index('.')
+ attr = obj[pos+1:]
+ obj = obj[:pos]
+except:
+ attr = None
cmd = sys.argv[2]
oid = None
args = sys.argv[3:]
else:
objs = eval(obj).select(connection=conn)
for o in objs:
- print o
+ if attr is None:
+ print o
+ else:
+ print o
+ print attr + ':'
+ import pprint
+ attr = eval('o.' + attr)
+ pprint.pprint(attr)
elif cmd in ('rm', 'remove', 'delete', 'del'):
if oid is not None:
objs = [eval(obj).get(oid, connection=conn)]
log.info('Nuevo intento a probar (%s)', intento)
# Obtengo paths
intento_dir = os.path.join(data_dir, intento.path('intentos'))
- entrega_dir = os.path.join(data_dir, intento.path('entregas'))
+ entrega_dir = os.path.join(data_dir, 'ejercicios', str(intento.entrega.ejercicioID))
+ print entrega_dir
# Busco makefile
makefile = os.path.join(entrega_dir, 'Makefile')
if not os.path.exists(makefile):
makefile = os.path.join(data_dir, 'Makefile')
shutil.copy(makefile, intento_dir)
# Compilo
- log.debug('A punto de ejecutar el comando: make -f %s', makefile)
+ log.debug('Ejecutando: make -f %s', makefile)
intento.inicioCompila = datetime.datetime.now()
make = subprocess.Popen(('make', '-f', makefile), stdout=subprocess.PIPE,
stderr=subprocess.PIPE, cwd=intento_dir)