diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/copyright | 31 | ||||
-rw-r--r-- | docs/dev/BUGS | 2 | ||||
-rw-r--r-- | docs/dev/TODO | 32 | ||||
-rw-r--r-- | docs/dev/TODO_SITEIVY | 80 | ||||
-rw-r--r-- | docs/dev/how2build.html | 29 | ||||
-rw-r--r-- | docs/dev/maintainer_notes.txt | 104 | ||||
-rw-r--r-- | docs/examples/.cvsignore | 1 | ||||
-rwxr-xr-x | docs/examples/pyhello.py | 94 | ||||
-rwxr-xr-x | docs/examples/testtk.py | 192 | ||||
-rwxr-xr-x | docs/examples/vl_isa.py | 140 | ||||
-rw-r--r-- | docs/html/.cvsignore | 1 | ||||
-rw-r--r-- | docs/html/index_tpl.html | 65 | ||||
-rw-r--r-- | docs/html/ivycpy_wrap.html | 93 |
13 files changed, 864 insertions, 0 deletions
diff --git a/docs/copyright b/docs/copyright new file mode 100644 index 0000000..5998bd1 --- /dev/null +++ b/docs/copyright @@ -0,0 +1,31 @@ +This package is maintained by Didier Pavet <pavet@cena.fr> . + +It was probably downloaded from Cvs data base : Cena/Pii: /projet/ivy/cvsroot + +Copyright: + + Copyright (c) 2003,2004 CENA, Didier Pavet -- + + This code is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This code is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this code; if not, write to the Free + Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA. + +Note : + +- Ivy (http://www.tls.cena.fr/products/ivy/) is proposed under LGPL license. + +- Python and Tkinter 2.1 and older are now proposed under the BEOPEN PYTHON OPEN +SOURCE LICENSE AGREEMENT VERSION 1 by the Python Software Foundation. +See http://www.python.org/psf/ for more information about the PSF. + diff --git a/docs/dev/BUGS b/docs/dev/BUGS new file mode 100644 index 0000000..181ec3d --- /dev/null +++ b/docs/dev/BUGS @@ -0,0 +1,2 @@ +None reported up-to-now ; + diff --git a/docs/dev/TODO b/docs/dev/TODO new file mode 100644 index 0000000..0ef6a7f --- /dev/null +++ b/docs/dev/TODO @@ -0,0 +1,32 @@ +evolutions du mode de fabrication de la librairie ivycpy.so : +clarifier avec Martin les besoins en macro m4 ; + + +préparer une version 0.4 ayant ces caractéristiques : +------------------------------------------------------------ +o0 : ajouter les dépendances d'outils de fabrication +install +swig +ivy test include +python test include + +les dépendances de header (include) + +o1 : faciliter le cablage adhoc avec les librairies "dépendances" +(dont ivycpy dépend): +- libivy.so , libtclivy.so +- _tkinter.so (et donc python) +- libtcl + +o2 : faciliter la realisation à la fois : +- installation adhoc (a partir des sources) avec une target +- paquet debian + +o3 : nettoyer le paquet des anciens modes de travail + +o4 : ajouter bindirect dans l'interface et ds les exemples; + +o5 : faire une version 0.4 source et debian ; + +préparer une version beta 0.5 indépendante de python +------------------------------------------------------------
\ No newline at end of file diff --git a/docs/dev/TODO_SITEIVY b/docs/dev/TODO_SITEIVY new file mode 100644 index 0000000..6622824 --- /dev/null +++ b/docs/dev/TODO_SITEIVY @@ -0,0 +1,80 @@ +From: Marcellin Buisson <buisson@cena.fr>, +To: François-Régis Colin <fcolin@cena.fr>, + Yannick Jestin <jestin@cena.fr>, + Christophe Mertz <mertz@intuilab.com>, + Didier PAVET <didier.pavet@ath.cena.fr>, + pascal.brisset@recherche.enac.fr, + Stéphane Chatty <chatty@intuilab.com>, + Sébastien Maury <smaury@apple.com>, + alexandre bustico <alexandre.bustico@cena.fr>, + Philippe Truillet <truillet@irit.fr>, + Alexandre Lemort <lemort@intuilab.com>, Eric Blond <blond@cena.fr>, +Cc: Marcellin Buisson <buisson@cena.fr>, + Gwenael BOTHOREL <bothorel@cena.fr>, +Subject: Ivy, web, sources, binaires et compagnie...., +Date: Mon, 14 Jun 2004 18:17:28 +0200, +Mcnf-Status: ok +Mcnf-Date: Mon Jun 14 18:19:40 2004 +Mcnf-Att: "/pcnfs/usagers/pavet/.amcnf/msg-1622-1.txt" + + Bonjour à tous, + + C'est en tant qu'auteurs ou empaqueteurs usuels des différentes +portages ivy que je sollicite votre aide et vous offre la lecture qui +suit :o) + + Comme vous avez pu le constater par vous même (ou comme vous le voyez +en vous rendant sur +http://www.tls.cena.fr/products/ivy/download/index.html), les sources +et les binaires des différents portages d'ivy qui sont distribuées sur +le site web datent un peu..ou sont incomplets.. bref c'est un peu le +bazar... + + En tant que mainteneur du site web ivy (et donc responsable de +l'obsolescence du code mis en ligne) , je me trouve confronté à +plusieurs problèmes : + + - quand mettre à jour les sources d'un portage ? + (notion de version d'ivy par exemple, pour environ 10 langages +supportés différents, à des états d'avancement différents ) + + - comment gérer les différents empaquetages ? + (pour 5 ou 6 architectures, et quelques unes exotiques) + + - comment respecter la LGPL dans notre distribution ? + (actuellement par exemple le texte de la LGPL, ou une reference à +celle-ci n'est pas présent dans tous les sources disponibles : +http://www.gnu.org/copyleft/lesser.txt) + + En l'absence pour le moment d'un espace de collaboration en ligne type +wiki, d'un accès anonyme la la base CVS ivy du CENA, ainsi que de +méthodes éprouvées pour *livrer* une version d'ivy, je vous propose la +chose suivante (si vous voyez une autre façon de faire, n'hésitez pas à +la proposer ! ) : + + Pour le source non disponible actuellement sur la base cvs du CENA +(c'est-à-dire tout sauf ivy-ada, ivy-c, ivy-c++, ivy-java, ivy-perl), +les auteurs des différents ports pourraient-ils m'envoyer une version +actualisée et respectant la LGPL du source (tar.gz par exemple) +estampillée "ivy-port-juin-2004" et que vous m'autoriseriez à mettre +dans la base cvs du CENA ? (je pense notamment à ivy-csharp, +ivy-python, ivy-metacard, ivy-caml, ivy-flash, ivy-com) + + Pour le source déjà disponible dans la base cvs, pourriez-vous m'aider +à inclure les fichiers de licences corrects et à vérifier qu'il est en +état (c'est à dire compile par exemple, avec des makefile corrects) + + Ce sera une première étape. + + La seconde étape, c'est de livrer un certain nombre de paquets +correspondants à cette livraison de sources. J'aurais alors besoin de +votre aide pour empaqueter sous windows, Mandrake 10.0, debian woody et +sarge, ipaq, macos X etc etc). Ce qui devrait me permettre ensuite de +mettre à jour les pages web ivy et donc de contribuer à son +rayonnement, son expansion..sa prolifération et ainsi de suite... + + J'attends vos idées, réactions, et surtout votre aide !! + +Viva ivy et bonne soirée, + +Marcellin. diff --git a/docs/dev/how2build.html b/docs/dev/how2build.html new file mode 100644 index 0000000..738bf8e --- /dev/null +++ b/docs/dev/how2build.html @@ -0,0 +1,29 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> <head> +<title>Ivycpy - buiding instructions</title> +</head> + +<body> +<H2><A NAME=PURPOSE>Ivycpy - buiding instructions</A></H2> +<p>First of all ivycpy is building process is managed by autoconf.</p> +<p>You should have to do the following actions: +<ul> + <li>say to configure where is ivy-c lib and include files (LD_LIBRARY_PATH , CPPFAGS) + <li>say to configure where is your version of Python (LD_LIBRARY_PATH , +CPPFAGS) (Note: a specific version is required exporting some MACRO def) + <li>launching configure with the suited location of tcl/tk configuration file tclConfig.sh and your target + destination:<br> + <em>./configure --prefix=/opt/ivycpy-dp --with-tcl=/opt/tcltk-8.4.5/lib/</em><br> + verify that every test is ok; normally if all is ok, you should be capable to compile and install + without any problems. + <li><em>make</em> + <li><em>make install </em> +</ul> +</p> + + +<hr> +<!-- hhmts start --> +Last modified: Mon May 24 16:43:51 CEST 2004 +<!-- hhmts end --> +</body> </html> diff --git a/docs/dev/maintainer_notes.txt b/docs/dev/maintainer_notes.txt new file mode 100644 index 0000000..54a6147 --- /dev/null +++ b/docs/dev/maintainer_notes.txt @@ -0,0 +1,104 @@ +Echanges avec Martin Loewis concerant les évolutions de Python et Tkinter +liés au wrapper python <-> ivy + + + +Date: Sun, 13 Jul 2003 18:49:35 +0200 +From: =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= <martin@v.loewis.de> +User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.4) Gecko/20030624 +X-Accept-Language: de, en-us, en +To: Didier PAVET <pavet@ath.cena.fr> +Subject: Re: a request / tkinter (ENTER_TCL ENTER_PYTHON macro) +In-Reply-To: <200307100715.JAA18790@basilic.dev.ath.cena.fr> +Content-Type: text/plain; charset=us-ascii; format=flowed +X-Seen: false +X-ID: rfGYOMZcgeZyNlhDQlB5laNXLu1X06U3wOOZDJ0mi2oMCVtqUb+aQc@t-dialin.net + +Didier PAVET wrote: + +> Have you allready heard some request in that sens ? + +Dear Didier, + +Yes, this is a SourceForge feature request, see + +http://python.org/sf/539907 + +> Does it stand sensible that this patch could be integrated in Python/Tkinter +> distribution and are you the right man to do that ? + +In some form, yes, certainly. Merely copying the macros into a header +file is not sufficient though: the code has been become much more +complex since 2.1, as we now also need to support multi-threaded Tcl +installations. + +Also, in general, you cannot access C variables across different +Python extension modules. Instead, you need to expose a CObject of some +kind. Instead of having that C object refer to the Tcl lock, I'd rather +provide access to some higher-level function pointers which can take +into account the various Tcl installations. + +I'd encourage you to work on this for Python 2.4. Please make either +Python 2.3 or the Python CVS your starting point, and please submit +unified diffs to sf.net/projects/python when you are done. + +If you have any questions about this approach, don#t hesitate to ask. + +Regards, +Martin + + +Date: 10 Jul 2003 09:07:08 +0200 +From: Didier PAVET <pavet@ath.cena.fr> +To: martin@v.loewis.de +Subject: a request / tkinter (ENTER_TCL ENTER_PYTHON macro) + +Martin, + +First of all, thank you for the job to maintain and upgrade python's stuff. +My organisation (french R&D center for air navigation) currently benefits from +python , tkinter material to build prototype, mock-up and so all. + +I have a request concerning _tkinter.h and _tkinter.c . In fact, in order to +build a python wrapper to an in-house middleware library built in C, I have +faced a problem with macro which aim at protecting interaction between tcl/tk +mainloop, thread and so on . I mean these macro ; +ENTER_TCL +LEAVE_TCL +ENTER_PYTHON +LEAVE_PYTHON + +For the moment, these macros are private to _tkinter module and so defined in +_tkinter.c. My need is to be capable from an external python module (in fact +my wrapper) to use (and so to share the data) these macros. + +I have allready carried out a solution patching Python 2.1.3 distribution and +packing my library to verify that it works . The solution is to externalize +and put the macros definition in the header _tkinter.h and allow external +access to lock as tcl_lock, tcl_state . + +2 requests : + +Have you allready heard some request in that sens ? +Does it stand sensible that this patch could be integrated in Python/Tkinter +distribution and are you the right man to do that ? + +Many thanks in advance for your help; it is clear for me that a positive +answer would avoid me to deliver my wrapper with a patched version of +Tkinter (solution which is pretty not handy). + +I just attached as a tar file my version of _tkinter.h and _tkinter.c derived +from Python 2.1.3 (debian woody stable version). + +Didier +-- +Didier PAVET Centre d'Etudes de La Navigation Aerienne / (Chef division ICS) +Office location Phone: (33 1) 69 57 68 89 - Fax: (33 1) 69 57 68 52 +B1608 b025 ou 01 69 57 68 89 ou 01 69 57 68 52 +E-mail: pavet@ath.cena.fr WWW: http://www.ath.cena.fr/~pavet + +Note : the middleware, target of my wrapper is Ivy; +have a look at +http://www.tls.cena.fr/products/ivy/ or +http://freshmeat.net/projects/ivy/ + diff --git a/docs/examples/.cvsignore b/docs/examples/.cvsignore new file mode 100644 index 0000000..93baa45 --- /dev/null +++ b/docs/examples/.cvsignore @@ -0,0 +1 @@ +env.sh
\ No newline at end of file diff --git a/docs/examples/pyhello.py b/docs/examples/pyhello.py new file mode 100755 index 0000000..e0db498 --- /dev/null +++ b/docs/examples/pyhello.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +""" pyhello.py : very simple hello world python program using ivycpy +with a local main loop +""" +import traceback, time, string, os, sys, getopt +# importing ivycpy +from ivycpy import * + +IVYAPPNAME = "pyhello" + +def lprint(fmt,*arg): + print IVYAPPNAME + ": " + fmt % arg + +def usage(scmd): + lpathitem = string.split(scmd,'/') + fmt = '''Usage: %s [-h] [-b IVYBUS | --ivybus=IVYBUS] +where +\t-h provides the usage message; +\t-b IVYBUS | --ivybus=IVYBUS allow to provide the IVYBUS string in the form +\t adresse:port eg. 127.255.255.255:2010 +''' + print fmt % lpathitem[-1] + +def oncxproc(connected): + if connected == IvyApplicationDisconnected : + lprint( "An Ivy application was disconnected ") + else: + lprint( "An Ivy application was connected") + lprint("currents Ivy application are [%s]", IvyGetApplicationList()) + +def ondieproc(id): + lprint( "received the order to die with id = %d", id) + +def onmsgproc(*larg): + lprint( "%s received [%s] ", IVYAPPNAME , larg[0]) + +def onhello(*larg): + sreply = "goodday %s to=%s from=%s " % (larg[0], larg[1],IVYAPPNAME) + lprint( "on hello , %s reply [%s]", IVYAPPNAME, sreply) + IvySendMsg(sreply) + +def ontick(): + lprint( "%s send a tick", IVYAPPNAME) + IvySendMsg("%s_tick" % IVYAPPNAME) + +if __name__ == '__main__': + # initializing ivybus and isreadymsg + sivybus = "" + sisreadymsg = "%s is ready" % IVYAPPNAME + # getting option + try: + optlist, left_args = getopt.getopt(sys.argv[1:],'hb:', ['ivybus=']) + except getopt.GetoptError: + # print help information and exit: + usage(sys.argv[0]) + sys.exit(2) + for o, a in optlist: + if o in ("-h", "--help"): + usage(sys.argv[0]) + sys.exit() + elif o in ("-b", "--ivybus"): + sivybus= a + if sivybus != "" : + sechoivybus = sivybus + elif os.environ.has_key("IVYBUS"): + sechoivybus = os.environ["IVYBUS"] + else: + sechoivybus = "ivydefault" + lprint( "Ivy will broadcast on %s ", sechoivybus) + + # initialising the bus + IvyInit(IVYAPPNAME, # application name for Ivy + sisreadymsg , # ready message + 0, # main loop is local (ie. using IvyMainloop) + oncxproc, # handler called on connection/deconnection + ondieproc # handler called when a diemessage is received + ) + # starting the bus + # Note: env variable IVYBUS will be used if no parameter or empty string + # is given ; this is performed by IvyStart (C) + IvyStart(sivybus) + # binding to every message + IvyBindMsg(onmsgproc, "(.*)") + # binding on dedicated message : starting with "hello ..." + IvyBindMsg(onhello, "^hello=([^ ]*) from=([^ ]*)") + # creating a infinite timer + timerid = IvyTimerRepeatAfter(0, # number of time to be called + 1000, # delay in ms between calls + ontick # handler to call + ) + lprint( "IvyTimerRepeatAfter id is %d", timerid) + + lprint( "%s doing IvyMainLoop", IVYAPPNAME) + IvyMainLoop() diff --git a/docs/examples/testtk.py b/docs/examples/testtk.py new file mode 100755 index 0000000..13bb1f9 --- /dev/null +++ b/docs/examples/testtk.py @@ -0,0 +1,192 @@ +#!/usr/bin/env python +""" programme de test de ivycpy en mode boucle tk """ + +import traceback, time, os, sys, string, getopt +from Tkinter import * +from ivycpy import * + +IVYAPPNAME = "pytesttk" + +def lprint(fmt,*arg): + print IVYAPPNAME + ": " + fmt % arg + +def usage(scmd): + lpathitem = string.split(scmd,'/') + fmt = '''Usage: %s [-h] [-b IVYBUS | --ivybus=IVYBUS] +where +\t-h provides the usage message; +\t-b IVYBUS | --ivybus=IVYBUS allow to provide the IVYBUS string in the form +\t adresse:port eg. 127.255.255.255:2010 +''' + print fmt % lpathitem[-1] + +global hellobindingid +hellobindingid = -1 + +class TopLevel(Tk) : + __single = 0 + def __init__(self,appname = "TopLevel"): + if TopLevel.__single != 0 : + lprint("TopLevel is singleton") + sys.exit(1) + __single = 1 + # the object is tk_root + Tk.__init__(self) + self.appname = appname + self.title(self.appname) + # Frame contenant heure et bouton quit + self.tkFheadpanel = Frame(self) + # Label hour + self.tkLhour = Label(self.tkFheadpanel,text="hh:mm:ss") + self.tkLhour.pack(padx=4 , pady=4 , side = LEFT) + # dummy button +## self.tkBdummy = Button(self.tkFheadpanel, +## text="dummy", bg='pink') +## self.tkBdummy.pack(padx=4 , pady=4, side = RIGHT) + + # button quit + self.tkBquit = Button(self.tkFheadpanel, + text="QUIT", bg='pink', command=self.quit) + self.tkBquit.pack(padx=4 , pady=4, side = RIGHT) + self.tkFheadpanel.pack(side=TOP) + + # Frame contenant un Text et un Scroller + self.tkFreceive_msg = Frame(self) + # Text + self.tkTreceive_msg = Text(self.tkFreceive_msg, height=26, width=50) + # Scrollbar + self.tkSBreceive_scroller = Scrollbar( + self.tkFreceive_msg, + command = self.tkTreceive_msg.yview) + self.tkTreceive_msg.configure( + yscrollcommand = self.tkSBreceive_scroller.set) + + self.tkTreceive_msg.pack(padx=4 , pady=4, + side=LEFT, fill = BOTH, expand = YES) + self.tkSBreceive_scroller.pack(side=RIGHT, fill = Y) + self.tkFreceive_msg.pack(side=BOTTOM, fill = BOTH, expand = YES) + + def add_one_msg(self, smsg) : + self.tkTreceive_msg.insert(END, "%s\n" % smsg ) + + def quit(self): + # cleanup action before detroying tk_root + lprint("doing IvyStop") + IvyStop() + lprint("doing destroy" ) + self.destroy() + lprint("after destroy") + lprint("done.") + + def ontick(self): + lprint("on tick method") + IvySendMsg("testtk_tick") + self.after(1000,self.ontick) + +def oncxproc(connected): + if connected == IvyApplicationDisconnected : + lprint("an IvyApplication was Disconnected") + else: + lprint("an IvyApplication was Connected") + +def ondieproc(id): + lprint("On die proc id=%d", id ) + +def onhelloproc(*larg): + sargs = string.join(larg,":") + sresult = "On <hello %s>, i reply <goodday %s>" % (larg[0], larg[0]) + mytoplevel.add_one_msg(sresult) + # lprint("[%s]" % sresult + IvySendMsg("goodday %s" % (larg[0])) + +def onmsgproc(*larg): + sresult = "On msg proc : arg number = %d , arglist = %s" % \ + (len(larg), string.join(larg,":")) + mytoplevel.add_one_msg(sresult) + + # abonnement selectif + +def oncmd(*larg): + global hellobindingid + lprint("hb =%d", hellobindingid) + lprint("cmd [%s] larg0=%s", string.join(larg,":"), larg[0]) + if larg[0] == 'bindhello' : + if hellobindingid == -1 : + hellobindingid = IvyBindMsg(onhelloproc,"^hello (.*)") + lprint("binding hello id = %d ", hellobindingid) + elif larg[0] == 'unbindhello' : + if hellobindingid != -1 : + lprint("unbinding hello id = %d ", hellobindingid) + IvyUnBindMsg(hellobindingid) + hellobindingid = -1 + elif larg[0] == 'getlist' : + sapplist = IvyGetApplicationList() + lprint("app list return %s" , sapplist) + for sapp in string.split(sapplist): + lprint("app name [%s] host [%s] ", + sapp, IvyGetApplicationHost(IvyGetApplication(sapp))) + lprint(IvyGetApplication(sapp)) + elif larg[0] == 'senddie' : + sapplist = IvyGetApplicationList() + lprint("app list return %s", sapplist) + for sapp in string.split(sapplist): + lprint("sending die to %s ", sapp) + IvySendDieMsg(IvyGetApplication(sapp)) + elif larg[0] == 'senderror' : + sapplist = IvyGetApplicationList() + lprint("app list return %s" , sapplist) + for sapp in string.split(sapplist): + lprint("sending error to %s " , sapp) + IvySendError(IvyGetApplication(sapp),0, + "error msg to %s from %s" % (sapp,IVYAPPNAME)) + # print "[%s]" % sresult + # IvySendMsg("a recu et renvoi [%s]" % sargs) + +def ontick(): + lprint("ontick") + IvySendMsg("testtk_tick") + +if __name__ == '__main__': + # initializing ivybus and isreadymsg + sivybus = "" + sisreadymsg = "[%s is ready]" % IVYAPPNAME + # getting option + try: + optlist, left_args = getopt.getopt(sys.argv[1:],'hb:', ['ivybus=']) + except getopt.GetoptError: + # print help information and exit: + usage(sys.argv[0]) + sys.exit(2) + for o, a in optlist: + if o in ("-h", "--help"): + usage(sys.argv[0]) + sys.exit() + elif o in ("-b", "--ivybus"): + sivybus= a + if sivybus != "" : + sechoivybus = sivybus + elif os.environ.has_key("IVYBUS"): + sechoivybus = os.environ["IVYBUS"] + else: + sechoivybus = "ivydefault" + lprint("Ivy will broadcast on %s " , sechoivybus) + + mytoplevel = TopLevel("%s top window" % IVYAPPNAME) + # myinterface = SocketInt(mytoplevel, delay = 2.0, iter = 5) + sisreadymsg = "%s is ready" % IVYAPPNAME + lprint("IvyApplicationConnected is %s " , IvyApplicationConnected) + lprint("IvyApplicationDisconnected is %s " , IvyApplicationDisconnected) + IvyInit(IVYAPPNAME, sisreadymsg, 1 , oncxproc, ondieproc ) + IvyStart(sivybus) + bindingid = IvyBindMsg(onmsgproc, "([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) (.*)") # "(.*)") + # lprint("IvyBindMsg retourne %d" , bindingid ) + bindingid = IvyBindMsg(oncmd, "^\.(.*)") # "(.*)") + # lprint("IvyBindMsg retourne %d", bindingid) + + # timerid = IvyTimerRepeatAfter(10,1000,ontick) + # print("IvyTimerRepeatAfter retourne %d" % timerid + mytoplevel.after(1000,mytoplevel.ontick) + + lprint("tk mainloop") + mytoplevel.mainloop() + diff --git a/docs/examples/vl_isa.py b/docs/examples/vl_isa.py new file mode 100755 index 0000000..89c70fa --- /dev/null +++ b/docs/examples/vl_isa.py @@ -0,0 +1,140 @@ +#!/usr/bin/env python +""" very light isa hmi mockup +prog de test infrastructure ivy + mini ihm type isa """ + +import traceback, time, os, sys, string, getopt +from Tkinter import * +from ivycpy import * + +APPNAME = "vl_isa" + +def lprint(fmt,*arg): + print APPNAME + ": " + fmt % arg + +def usage(scmd): + lpathitem = string.split(scmd,'/') + fmt = '''Usage: %s [-h] [-b IVYBUS | --ivybus=IVYBUS] [-n APPNAME | --name=APPNAME] +where +\t-h provides the usage message; +\t-n APPNAME | --name=APPNAME +\t-b IVYBUS | --ivybus=IVYBUS allow to provide the IVYBUS string in the form +\t adresse:port eg. 127.255.255.255:2010 +''' + print fmt % lpathitem[-1] + +def oncxproc(connected): + if connected == IvyApplicationDisconnected : + lprint("an IvyApplication was Disconnected") + else: + lprint("an IvyApplication was Connected") + +def ondieproc(id): + lprint("we ask me to die with id [%d]", id ) + +class TopLevel(Tk) : + __single = 0 + def __init__(self,appname = "TopLevel"): + if TopLevel.__single != 0 : + lprint("TopLevel is singleton") + sys.exit(1) + __single = 1 + # the object is tk_root + Tk.__init__(self) + self.appname = appname + self.title(self.appname) + # Frame contenant heure et bouton quit + self.tkFheadpanel = Frame(self) + # Label hour + self.tkLhour = Label(self.tkFheadpanel,text="hh:mm:ss") + self.tkLhour.pack(padx=4 , pady=4 , side = LEFT) + # dummy button +## self.tkBdummy = Button(self.tkFheadpanel, +## text="dummy", bg='pink') +## self.tkBdummy.pack(padx=4 , pady=4, side = RIGHT) + + # button quit + self.tkBquit = Button(self.tkFheadpanel, + text="QUIT", bg='pink', command=self.quit) + self.tkBquit.pack(padx=4 , pady=4, side = RIGHT) + self.tkFheadpanel.pack(side=TOP) + + # Frame contenant un Label, un Text et un Scroller + self.tkFreceive_msg = Frame(self) + # label + self.tkLreceive_msg = Label(self.tkFreceive_msg, text="flyingonthebus") + self.tkLreceive_msg.pack(padx=4 , pady=4, + side=TOP, fill = BOTH, expand = YES) + # Text + self.tkTreceive_msg = Text(self.tkFreceive_msg, height=26, width=50) + # Scrollbar + self.tkSBreceive_scroller = Scrollbar( + self.tkFreceive_msg, + command = self.tkTreceive_msg.yview) + self.tkTreceive_msg.configure( + yscrollcommand = self.tkSBreceive_scroller.set) + + self.tkTreceive_msg.pack(padx=4 , pady=4, + side=LEFT, fill = BOTH, expand = YES) + self.tkSBreceive_scroller.pack(side=RIGHT, fill = Y) + self.tkFreceive_msg.pack(side=BOTTOM, fill = BOTH, expand = YES) + + def add_one_msg(self, smsg) : + self.tkTreceive_msg.insert(END, "%s\n" % smsg ) + + def onmsgproc(self,*arg) : + self.add_one_msg(string.join(arg,"")) + + def quit(self): + # cleanup action before detroying tk_root + lprint("doing IvyStop") + IvyStop() + lprint("doing destroy" ) + self.destroy() + lprint("after destroy") + lprint("done.") + +## def ontick(self): +## lprint("on tick method") +## IvySendMsg("testtk_tick") +## self.after(1000,self.ontick) + +# main prog +if __name__ == '__main__': + # setting some main variable + sivybus = "" + + # getting option + try: + optlist, left_args = getopt.getopt(sys.argv[1:],'hb:n:', ['ivybus=','name']) + except getopt.GetoptError: + # print help information and exit: + usage(sys.argv[0]) + sys.exit(2) + for o, a in optlist: + if o in ("-h", "--help"): + usage(sys.argv[0]) + sys.exit() + elif o in ("-b", "--ivybus"): + sivybus = a + elif o in ("-n","--name"): + APPNAME = a + if sivybus != "" : + sechoivybus = sivybus + elif os.environ.has_key("IVYBUS"): + sechoivybus = os.environ["IVYBUS"] + else: + sechoivybus = "ivydefault" + lprint("Ivy will broadcast on %s " , sechoivybus) + + # initializing ivy : isreadymsg + sisreadymsg = "[%s is ready]" % APPNAME + IvyInit(APPNAME, sisreadymsg, 1 , oncxproc, ondieproc ) + IvyStart(sivybus) + + # initializing top hmi part + mytoplevel = TopLevel("%s top window" % APPNAME) + + # doing suited binding + IvyBindMsg(mytoplevel.onmsgproc , "(.*)") + + mytoplevel.mainloop() diff --git a/docs/html/.cvsignore b/docs/html/.cvsignore new file mode 100644 index 0000000..64233a9 --- /dev/null +++ b/docs/html/.cvsignore @@ -0,0 +1 @@ +index.html
\ No newline at end of file diff --git a/docs/html/index_tpl.html b/docs/html/index_tpl.html new file mode 100644 index 0000000..1c96948 --- /dev/null +++ b/docs/html/index_tpl.html @@ -0,0 +1,65 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> <head> +<title>Ivycpy - a wrapper around ivy-c to get a Python stub to Ivy</title> +</head> + +<body> +<h2><A NAME=NAME>NAME</A></h2> +ivycpy - a wrapper around ivy-c to get a Python stub to Ivy +<H2><A NAME=VERSION>VERSION</A></H2> +<p>Current version is _VERSION_. </p> +<H2><A NAME=SYNOPSIS>SYNOPSIS</A></H2> +<p>ivycpy library procures a way to connect Python/Python-Tkinter application +on an Ivy bus. +<H2><A NAME=WARNING>WARNING</A></H2> + +<p>This current source version allows to link ivycpy with locally +installed version of [tcl/tk, adapted version of +[Python/Tkinter]]. ivycpy requires still some patches on _tkinter.c +(see <a href="../dev/">dev docs</a> for further information). As a +consequence, <em>ivycpy is not presented as debian package any more</em>. The +source package allows to install the software as an OPTional package.</p> + +<p>This version is strictly compatible with ivy-c [3.2 .. 3.6] and can be +dynamically linked to a new version of ivy-c, if ivy-c api is unchanged which is +quite unlikely.</p> + +<p>So provided that, you installed compatible version of tcl/tk and +Python/Tkinter (adapted by yourself), ivy-c and ivy-c-dev, it should be easy to +rebuilt a new version of ivycpy adapted to the needs. <em>See for <a +href="../dev/how2build.html"">building instructions</a></em></p> + +<p><i>A former version ivycpy213sa has been delivered as a debian package +tightly linked with woody 3.0 set of package , ie.: +<ul> + <li>ivyc library (3.4) + <li>tcl/tk 8.3 + <li>Python 2.1.3 +</ul> +but it was clearly immatured and awkward ! +</i></p> +<H2><A NAME=DESCRIPTION>DESCRIPTION</A></H2> + +<p>ivycpy is not a native python language binding to Ivy but, a wrapper around C +level functions. ivycpy was made with <a href="http://www.swig.org">swig</a> +(Scripting Wrapper Interface Generator). For a high level view of the python +api, have a look to <a href="ivycpy_wrap.html">ivycpy_wrap.html</a>. For a hands on experience, see, next section.</p> + +<H2><A NAME=EXAMPLES>EXAMPLES</A></H2> +<p>To have a clear view of how to use this library, please, have a look at the +examples normally accessible at <a href="../examples/">examples</a>.</p> + +<H2><A NAME=SEEALSO>SEE ALSO</A></H2> +See Ivy home page at <a href="http://www.tls.cena.fr/products/ivy"> +www.tls.cena.fr/products/ivy</a> to obtain detailed information about ivy. + +<H2><A NAME=AUTHORS>AUTHORS</A></H2> +Didier Pavet <pavet@cena.fr> +<H2><A NAME=COPYRIGHT>COPYRIGHT</A></H2> +<p>This software is free software under Library GNU Public License; see <a href="copyright">./copyright</a> for detail and references.</p> +<hr> + +<!-- hhmts start --> +Last modified: Thu Sep 9 16:14:00 CEST 2004 +<!-- hhmts end --> +</body> </html> diff --git a/docs/html/ivycpy_wrap.html b/docs/html/ivycpy_wrap.html new file mode 100644 index 0000000..82052ea --- /dev/null +++ b/docs/html/ivycpy_wrap.html @@ -0,0 +1,93 @@ +<HTML> +<HEAD> +<TITLE> +ivycpy_wrap.c</TITLE> +<BODY BGCOLOR="#ffffff"> +<H1>ivycpy_wrap.c</H1> +[ Python Module : ivycpy ]<BR> + +<P><TT><B>IvyApplicationConnected = IvyApplicationConnected</B></TT> +<BLOCKQUOTE>[ Constant: int ] +<BR></BLOCKQUOTE> + +<P><TT><B>IvyApplicationDisconnected = IvyApplicationDisconnected</B></TT> +<BLOCKQUOTE>[ Constant: int ] +<BR></BLOCKQUOTE> + +<P><TT><B>IvyInit(AppName,ready,loopmode,PyFuncOnCx,PyFuncOnDie)</B></TT> +<BLOCKQUOTE>[ returns void ] +<BR> void *die_data ); user data +</BLOCKQUOTE> + +<P><TT><B>IvyBindMsg(PyFunc,msg)</B></TT> +<BLOCKQUOTE>[ returns int ] +<BR></BLOCKQUOTE> + +<P><TT><B>IvyUnBindMsg(binding_id)</B></TT> +<BLOCKQUOTE>[ returns void ] +<BR></BLOCKQUOTE> + +<P><TT><B>IvyStart(char *)</B></TT> +<BLOCKQUOTE>[ returns void ] +<BR></BLOCKQUOTE> + +<P><TT><B>IvyStop()</B></TT> +<BLOCKQUOTE>[ returns void ] +<BR></BLOCKQUOTE> + +<P><TT><B>IvySendMsg(message)</B></TT> +<BLOCKQUOTE>[ returns int ] +<BR></BLOCKQUOTE> + +<P><TT><B>IvyMainLoop()</B></TT> +<BLOCKQUOTE>[ returns void ] +<BR></BLOCKQUOTE> + +<P><TT><B>IvyGetApplicationList()</B></TT> +<BLOCKQUOTE>[ returns char * ] +<BR></BLOCKQUOTE> + +<P><TT><B>IvyGetApplication(name)</B></TT> +<BLOCKQUOTE>[ returns IvyClientPtr ] +<BR></BLOCKQUOTE> + +<P><TT><B>IvyGetApplicationName(app)</B></TT> +<BLOCKQUOTE>[ returns char * ] +<BR></BLOCKQUOTE> + +<P><TT><B>IvyGetApplicationHost(app)</B></TT> +<BLOCKQUOTE>[ returns char * ] +<BR> emission d'un message d'erreur +</BLOCKQUOTE> + +<P><TT><B>IvySendError(app,id,message)</B></TT> +<BLOCKQUOTE>[ returns void ] +<BR></BLOCKQUOTE> + +<P><TT><B>IvySendDieMsg(app)</B></TT> +<BLOCKQUOTE>[ returns void ] +<BR></BLOCKQUOTE> + +<P><TT><B>IvySendDirectMsg(app,id,msg)</B></TT> +<BLOCKQUOTE>[ returns void ] +<BR></BLOCKQUOTE> + +<P><TT><B>IvyBindDirectMsg(PyFunc)</B></TT> +<BLOCKQUOTE>[ returns void ] +<BR></BLOCKQUOTE> + +<P><TT><B>IvyTimerRepeatAfter(count,time,PyFunc)</B></TT> +<BLOCKQUOTE>[ returns int ] +<BR></BLOCKQUOTE> + +<P><TT><B>IvyTimerModify(timerid,time)</B></TT> +<BLOCKQUOTE>[ returns void ] +<BR></BLOCKQUOTE> + +<P><TT><B>IvyTimerRemove(timerid)</B></TT> +<BLOCKQUOTE>[ returns void ] +<BR></BLOCKQUOTE> + + +</BODY> +</HTML> |