From 3f3ef2946498735ebb3170ab304d84fed9865ce1 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 21 Feb 2005 19:46:37 +0000 Subject: [PATCH] =?utf8?q?Nueva=20opci=C3=B3n=20para=20ver=20atributos=20d?= =?utf8?q?e=20un=20objeto=20con=20el=20comando=20ls=20de=20sc=5Fdbq.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/sc_dbq | 15 ++++++++++++++- src/sc_test | 5 +++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/sc_dbq b/src/sc_dbq index e105f1f..34b0e7b 100755 --- a/src/sc_dbq +++ b/src/sc_dbq @@ -43,6 +43,12 @@ conn = sqlobject.connectionForURI(conf.get('dbo', 'database')) # 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:] @@ -62,7 +68,14 @@ try: 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)] diff --git a/src/sc_test b/src/sc_test index f9518f1..fad2a06 100755 --- a/src/sc_test +++ b/src/sc_test @@ -112,14 +112,15 @@ while continuar: 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) -- 2.43.0