[Spedit-commits] CVS: prototype/Support Application.py,1.3,1.4 SP-Configuration.xml,1.1,1.2
Status: Planning
Brought to you by:
krunte
|
From: S?bastien P. <kaz...@us...> - 2001-11-28 13:13:00
|
Update of /cvsroot/spedit/prototype/Support In directory usw-pr-cvs1:/tmp/cvs-serv1455 Modified Files: Application.py SP-Configuration.xml Log Message: New configuration file that has been updated to support the new XML Schema. There are many improvements in the overall construction. Best thing is to have a look at the diffs. Index: Application.py =================================================================== RCS file: /cvsroot/spedit/prototype/Support/Application.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Application.py 2001/11/21 11:02:31 1.3 --- Application.py 2001/11/28 13:12:58 1.4 *************** *** 1,15 **** # --------------------------------------------------@RisingSun//Jython//1.0//EN ! # Module : SPEdit-GUI Prototype ! # Version : 0.01 ! # Type : GUI utility # ThreadSafe : - # Description : # URL : <http://SPEdit.sourceforge.net> # ----------------------------------------------------------------------------- ! # Author : Sebastien Pierre <sp...@is...> # ----------------------------------------------------------------------------- # Creation date : 19-Sep-2001 ! # Last mod. : 19-Sep-2001 # History : # 19-Sep-2001 First implementation. # --- 1,17 ---- # --------------------------------------------------@RisingSun//Jython//1.0//EN ! # Module : SPEdit ! # Version : 0.1 ! # Type : Application support library # ThreadSafe : - # Description : # URL : <http://SPEdit.sourceforge.net> # ----------------------------------------------------------------------------- ! # Author : Sbastien Pierre <sp...@is...> # ----------------------------------------------------------------------------- # Creation date : 19-Sep-2001 ! # Last mod. : 27-Nov-2001 # History : + # 27-Nov-2001 Added the getInstance and the checkAncestors + # methods.(sp) # 19-Sep-2001 First implementation. # *************** *** 20,24 **** # -Test suite ! import java, javax, sys from javax.swing import * --- 22,30 ---- # -Test suite ! # Jython imports ! import sys, string ! ! # Java imports ! import java, javax from javax.swing import * *************** *** 73,78 **** menubar.add(menu) return menubar ! class MenuListener( java.awt.event.ActionListener ): --- 79,124 ---- menubar.add(menu) return menubar ! ! def getInstance( name, parameters ): ! """Generates a new instance of the fully qualified Python class ! given by the 'name' paremeter. The 'parameters' is the tuple that ! will be given to the constructor. ! ! In case the constructor fails or that the class has not been found ! None is returned, otherwise the new instance is returned.""" ! ! module = None ! for i in range(0,len(name)): ! if name[i]=='.': ! module = name[:i] ! break ! ! if module!=None: ! constructor = None ! try: ! constructor = eval(name) ! except: ! exec "import %s" % (module) ! constructor = eval(name) ! instance = apply(eval(name), parameters) ! return instance ! else: ! return None + def checkAncestors( ancestors, element ): + """Checks if the given element has the ancestor list given by the + expression. The expression is a descendant list like 'document/section/title', + which means that the current element must be a title, that its parent must be a section + and its grandparent a document.""" + if type(ancestors)==type(""): + ancestors = string.split(ancestors,"/") + if element==None: return 0 + if len(ancestors)==1: + if element.getName()==ancestors[0]: return 1 + else: return 0 + else: + if checkAncestors(ancestors[:-1], element.getParent()) and\ + element.getName()==ancestors[-1]: return 1 + else: return 0 class MenuListener( java.awt.event.ActionListener ): Index: SP-Configuration.xml =================================================================== RCS file: /cvsroot/spedit/prototype/Support/SP-Configuration.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SP-Configuration.xml 2001/11/21 11:02:31 1.1 --- SP-Configuration.xml 2001/11/28 13:12:58 1.2 *************** *** 19,23 **** Creation date : 20-Nov-2001 ! Last revision : 21-Sep-2001 Revision : 0.5 History : --- 19,23 ---- Creation date : 20-Nov-2001 ! Last revision : 20-Nov-2001 Revision : 0.5 History : *************** *** 116,119 **** --- 116,124 ---- <element name='swissprot'> <Style> + <Font> + <name string="Palatino"/> + <type string="plain"/> + <size int="12"/> + </Font> <Title> <content string="SwissProt - Protein editing interface"/> *************** *** 123,126 **** --- 128,134 ---- <size int="26"/> </Font> + <Padding> + <left int="150"/> + </Padding> </Title> <Padding> *************** *** 139,142 **** --- 147,157 ---- <element name='entry'> + <Style> + <Padding> + <stick string="attributes.lower-left"/> + <padding int="10"/> + </Padding> + <Attributes><display string="spml.EntryDisplay"/></Attributes> + </Style> <Views> <use name="block"/> *************** *** 155,159 **** --- 170,183 ---- <Style> <inherit from="contentItem"/> + <Padding> + <stick string="attributes.upper-right"/> + </Padding> <Title><content string="Protein name"/></Title> + <Attributes> + <display string="spml.ProteinNameDisplay"/> + <Padding> + <left int="70"/> + </Padding> + </Attributes> </Style> <Views><use name="label"/></Views> *************** *** 261,264 **** --- 285,293 ---- <element name='author'> + <Style> + <Attributes> + <display string="spml.AuthorDisplay"/> + </Attributes> + </Style> <Views><use name="label"/></Views> </element> *************** *** 273,283 **** --- 302,329 ---- </element> + <element name='published/comments/comment'> + <Style> + <inherit from="listItem"/> + <Title><content string="COMMENTS/COMMENT"/></Title> + </Style> + <Views><use name="paragraph"/></Views> + </element> + <element name='comment'> <Style> <inherit from="listItem"/> + <Title><content string="COMMENT"/></Title> </Style> <Views><use name="paragraph"/></Views> </element> + <element name='dbreference'> + <Style> + <inherit from="listItem"/> + <Attributes><display string="net.sourceforge.spedit.spml.DataBaseDisplay"/></Attributes> + </Style> + <Views><use name="label"/></Views> + </element> + </Document> |