From 85fe89849ec90251911b17b5081694ff87871bbe Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 9 May 2005 19:35:52 +0000 Subject: [PATCH] =?utf8?q?Se=20agregan=20script=20de=20instalaci=C3=B3n=20?= =?utf8?q?y=20para=20generar=20el=20contenido=20del=20disquette.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- util/clases2spec.py | 130 -------------------------------------------- util/install.sh | 16 ++++++ util/pack.sh | 16 ++++++ 3 files changed, 32 insertions(+), 130 deletions(-) delete mode 100755 util/clases2spec.py create mode 100755 util/install.sh create mode 100755 util/pack.sh diff --git a/util/clases2spec.py b/util/clases2spec.py deleted file mode 100755 index 4822cd1..0000000 --- a/util/clases2spec.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env python -# -*- coding: iso-8859-1 -*- - -from xml.sax import saxutils - -# Estados -E_CLASS = 1 -E_CLASS_NAME = 2 -E_CLASS_COMMENT = 3 -E_ATTRS = 4 -E_ATTR = 5 -E_ATTR_NAME = 6 -E_ATTR_COMMENT = 7 -E_ATTR_TYPE = 8 - -# Caracteres a eliminar -STRIPCHARS = '#\t\n ' - -class ObjFinder(saxutils.DefaultHandler): - def __init__(self): - self.estado = None - self.clases = [] - self.curr = None - self.curr_attr = None - def startElement(self, name, attrs): - #print " #### Start <%s %s>" % (name, dict(attrs)) - if name == 'dia:object': # Comienzo de una clase - if attrs.get('type', None) == 'UML - Class': - self.curr = {} - self.estado = E_CLASS - elif name == 'dia:attribute': - name = attrs.get('name', None) - if self.estado == E_CLASS: # Datos de la clase - if name == 'name': # Nombre de la clase - self.curr['name'] = '' - self.estado = E_CLASS_NAME - elif name == 'comment': # Es la descripción de la clase - self.curr['comment'] = '' - self.estado = E_CLASS_COMMENT - elif name == 'attributes': # Paso empezó a encontrar atributos - self.curr['attrs'] = [] - self.estado = E_ATTRS - elif self.estado == E_ATTR: # Datos del atributo - if name == 'name': # Nombre del atributo - self.curr_attr['name'] = '' - self.estado = E_ATTR_NAME - elif name == 'type': # Es el tipo del atributo - self.curr_attr['type'] = '' - self.estado = E_ATTR_TYPE - elif name == 'comment': # Es la descripción del atributo - self.curr_attr['comment'] = '' - self.estado = E_ATTR_COMMENT - elif name == 'dia:composite': # Comienzo de attributos de clase - if self.estado == E_ATTRS: # Si estoy en una clase - self.curr_attr = {} - self.estado = E_ATTR # Paso a buscar sus atributos - def characters(self, data): - if self.estado == E_CLASS_NAME: - self.curr['name'] += data.strip(STRIPCHARS) - elif self.estado == E_CLASS_COMMENT: - self.curr['comment'] += data.strip(STRIPCHARS) - elif self.estado == E_ATTR_NAME: - self.curr_attr['name'] += data.strip(STRIPCHARS) - elif self.estado == E_ATTR_TYPE: - self.curr_attr['type'] += data.strip(STRIPCHARS) - elif self.estado == E_ATTR_COMMENT: - self.curr_attr['comment'] += data.strip(STRIPCHARS) - def endElement(self, name): - #print " #### Endt " % name - if name == 'dia:object': - if self.estado == E_CLASS: - self.clases.append(self.curr) - self.estado = None - self.curr = None - elif name == 'dia:attribute': - if self.estado == E_CLASS_NAME: - self.estado = E_CLASS - if self.estado == E_CLASS_COMMENT: - self.estado = E_CLASS - if self.estado == E_ATTR_NAME: - self.estado = E_ATTR - if self.estado == E_ATTR_TYPE: - self.estado = E_ATTR - if self.estado == E_ATTR_COMMENT: - self.estado = E_ATTR - if self.estado == E_ATTRS: - self.estado = E_CLASS - elif name == 'dia:composite': - if self.estado == E_ATTR: - self.curr['attrs'].append(self.curr_attr) - self.curr_attr = None - self.estado = E_ATTRS - - -if __name__ == '__main__': - import sys - from xml.sax import make_parser - from xml.sax.handler import feature_namespaces - - # Verifica parámetros - if len(sys.argv) < 2: - print >>sys.stderr, 'Uso:', sys.argv[0], 'archivo.dia' - sys.exit(1) - - # Create a parser - parser = make_parser() - - # Tell the parser we are not interested in XML namespaces - parser.setFeature(feature_namespaces, 0) - - # Create the handler - dh = ObjFinder() - - # Tell the parser to use our handler - parser.setContentHandler(dh) - - # Parse the input - parser.parse(sys.argv[1]) - - # Recorro clases obtenidas - for c in dh.clases: - print - print 'Clase:', c['name'] - print 'Descripción:', c['comment'] - print 'Atributos:' - for a in c['attrs']: - print ' %(name)s (%(type)s): %(comment)s' % a - - -# vim: set et sw=4 sts=4 : diff --git a/util/install.sh b/util/install.sh new file mode 100755 index 0000000..bea56bc --- /dev/null +++ b/util/install.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# vim: set binary noeol et sw=4 sts=4 : +# Grupo 10 +# +# Lucarella, Schein, Arena +# +# Creado: Leandro Lucarella (lun may 9 16:27:41 ART 2005) +# +# $Id$ + +mv -f ~/public_html ~/public_html.old +cp -r ../sisdis10 ~/public_html +chmod a+r -R ~/public_html +chmod a+w -R ~/public_html/data ~/public_html/fotos ~/public_html/temas +echo "Listo! Diríjase a http://localhost/~$USER/ para ingresar al sistema." +echo "Recuerde iniciar el apache, si aún no está funcionando." diff --git a/util/pack.sh b/util/pack.sh new file mode 100755 index 0000000..5e32108 --- /dev/null +++ b/util/pack.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# vim: set binary noeol et sw=4 sts=4 : +# Grupo 10 +# +# Lucarella, Schein, Arena +# +# Creado: Leandro Lucarella (lun may 9 16:27:20 ART 2005) +# +# $Id$ + +rm -fR floppy +mkdir -p floppy/scripts +cp install.sh floppy/scripts/ +svn export -q http://svn.llucax.hn.org/svn/7543/src/ floppy/sisdis10/ +svn export -q http://svn.llucax.hn.org/svn/7543/docs/informe/ floppy/informe/ +echo "Listo! Copiar el contenido del directorio 'floppy' al disquette!" \ No newline at end of file -- 2.43.0