#!/usr/bin/env python # xayagui """ BeginDate:200602017 CurrentRevisionDate:200602017 Development Version : core 001 Release Version: pre-release Author(s): Mishtu Banerjee, Tyler Mitchell, Dean Mikkelson Contact: mishtu@harmeny.com Copyright: The Authors License: Distributed under MIT License [http://opensource.org/licenses/mit-license.html] Environment: Programmed and tested under Python 2.3.3 on Windows 2000. Database Access: Psycopg and Postgres 7.4 Dependencies: CherryPy Python Interpreter and base libraries. Psycopg [website] Postgres [website] test X ============================================== XAYAgui_001 An Interface for Thinking with Data ============================================== XAYAgui is a Pythonic implementation of the Graph Abstraction Logic (GAL) design principles. GAL relationally models information as graphs (an old idea originating in modern logic) as a "little language" that can embedded or embellished. It provides a basis for modelling and querying data from complex systems. Data---> Information--> Knowledge (but wisdom is golden). GAL was inspired by Robert Ulanowicz's ecological network theory of Ascendency, Stan Salthe's developmental theory of Hierarchical Systems, and Charles Peirce's Existential Graphs (a visual method of doing logic). Hopefully beautiful ideas can lead to pragmatic working code ;-} ... Xayacore goes frominstances to ontologies,and points inbetween. One graph to rule them all! And some common sense to bind them ... Send bugs, fixes, suggestions to mishtu@harmeny.com (Thanks). USAGE EXAMPLE: (see examples under individual functions) ALGORITHMs: AlgorithmName -- Reference CODE SOURCES: Guido Code. [webref] Graphlib Code Pydot Code Graphpath Code Python Cookbook Djikstra's Algorithms in Python REFERENCES: Ascendency book. Salthe Hierarchy Book. Peirce Book (Reasoning and the Logic of Things) Graph Algorithms Reference Information Flow Book Foundations of Logic. Tools for Thought book """ # KNOWN BUGS # None Known at this point # UNITTESTS # Unittests are below fn/obj being tested # DESIGN CONTRACTS # Design Contract for each fn/obj is right after docstring #DOCTESTS # Used sparingly where they illustrate code above and beyond unittest # Import CherryPy web application framework import cherrypy import xayastats import os import webbrowser #Put GUI Body Here # ------------------- class XayaGUI: """ Class for all the xaya web access tools. """ # Header and Footer fns set up the top and bottom of a web page def header(self): content = '''
XAYA brought to you by the XAYA team
''' return content # The Index Fn sets up the first page launched by Cherry Py Server def index(self): """ This is the main index startup page. """ content = self.header() content += '''
' # Again -- just a broken link
#Attempt 4
# from cherrypy.lib.cptools import serveFile
# image = open("/XAYA/devcore/xaya_small_web.gif")
# content += serveFile(image,"image/gif") # Based on preview_image fn in Will's pemtools.py
content += self.footer()
return content
def getFilePath(self):
# ask for searchstring.
content='''
| " + self.showFileSelectList(path, file) # Enter Files List in Table content += " | " + self.showFunctionSelectList() # Enter Functions List in Table #content += " | " + self.showParametersSelectList(path, file) # Enter Parameters in a table content += " |
' select_list +='''
''' content = select_list return content def showParametersSelectList(self, path="", filelist=[]): select_list = '''
| " else: content += " | " content += col if row==0: content += "" else: content += " | " content += "
|---|
| " else: content += " | " content += str(col) #must explicitly cast numerical data to strings if row==0: content += "" else: content += " | " content += "
|---|