Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'escape': 0.04; 'whatever.': 0.07; 'wxpython': 0.07; 'python': 0.08; '>>>>': 0.09; 'oh,': 0.09; 'solution,': 0.09; 'tags,': 0.09; 'interfaces': 0.12; 'gui': 0.13; '"windows': 0.16; 'anyone?': 0.16; 'cares': 0.16; 'checkbox': 0.16; 'clear.': 0.16; 'cygwin,': 0.16; 'input.': 0.16; 'osx': 0.16; 'received:mindspring.com': 0.16; 'see.': 0.16; 'semanchuk': 0.16; 'subject:GUI': 0.16; 'templating': 0.16; 'tkinter,': 0.16; 'x-mailer:apple mail (2.1084)': 0.16; 'this:': 0.16; 'wrote:': 0.16; 'solution.': 0.17; 'linux': 0.17; '>>>': 0.18; 'appropriate.': 0.18; 'template': 0.19; 'seems': 0.20; 'bonus': 0.21; 'maybe': 0.21; "doesn't": 0.22; 'stuff': 0.22; 'header:In-Reply-To:1': 0.22; 'cheers': 0.23; 'interface': 0.23; '(or': 0.23; 'builds': 0.23; "user's": 0.23; 'pm,': 0.24; 'aug': 0.24; 'code': 0.25; 'xml': 0.25; 'code.': 0.26; 'windows': 0.26; "i'm": 0.27; 'skip:_ 20': 0.28; 'separate': 0.28; 'described': 0.28; 'problem': 0.28; 'looks': 0.29; 'definition': 0.30; 'environment.': 0.30; 'times.': 0.30; 'solved': 0.30; 'toolkit': 0.30; 'installation': 0.30; 'equivalent': 0.31; 'subject:?': 0.31; "didn't": 0.31; 'seem': 0.31; 'adds': 0.32; 'words,': 0.32; 'received:24': 0.32; 'this.': 0.32; 'does': 0.32; 'agree': 0.33; "what's": 0.33; 'actually': 0.33; 'there': 0.33; 'to:addr:python- list': 0.33; "i've": 0.34; 'points': 0.34; 'someone': 0.34; 'describe': 0.34; 'realize': 0.34; 'idea': 0.34; 'engine,': 0.34; 'like:': 0.34; 'options:': 0.34; 'pretty': 0.35; 'similar': 0.35; 'record': 0.35; 'charset:us-ascii': 0.36; 'problem.': 0.36; 'connection': 0.36; 'file': 0.36; 'page.': 0.36; 'model': 0.37; 'run': 0.37; 'but': 0.37; 'page': 0.37; 'something': 0.37; 'presentation': 0.38; 'could': 0.38; 'some': 0.38; 'should': 0.38; 'subject:: ': 0.39; 'window': 0.39; 'option': 0.39; 'header:Mime- Version:1': 0.39; 'else': 0.39; 'basic': 0.39; 'missing': 0.39; 'selection': 0.39; 'to:addr:python.org': 0.39; 'might': 0.40; "it's": 0.40; 'where': 0.40; 'more': 0.60; 'your': 0.61; 'hope': 0.61; 'basis': 0.61; 'kind': 0.61; 'header:Message-Id:1': 0.61; 'services': 0.62; 'further': 0.64; 'act': 0.65; '"what': 0.67; 'selected': 0.68; 'care': 0.71; 'me;': 0.84; 'received:69.73': 0.84; 'something.': 0.84; 'thereafter,': 0.84 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1084) Subject: Re: Table Driven GUI Definition? From: Philip Semanchuk In-Reply-To: <4E3C6CA0.2000706@tundraware.com> Date: Fri, 5 Aug 2011 18:51:36 -0400 Content-Transfer-Encoding: quoted-printable References: <4e3c3eee$0$23931$e4fe514c@news2.news.xs4all.nl> <4E3C6CA0.2000706@tundraware.com> To: Lista-Comp-Lang-Python list X-Mailer: Apple Mail (2.1084) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - deimos.nocdirect.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - semanchuk.com X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 84 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1312584701 news.xs4all.nl 23852 [2001:888:2000:d::a6]:60107 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:10942 On Aug 5, 2011, at 6:20 PM, Tim Daneliuk wrote: > On 8/5/2011 3:42 PM, Philip Semanchuk wrote: >>=20 >> On Aug 5, 2011, at 4:10 PM, Tim Daneliuk wrote: >>=20 >>> On 8/5/2011 2:05 PM, Irmen de Jong said this: >>>> On 05-08-11 19:53, Tim Daneliuk wrote: >>>>> I have a task where I want to create pretty simple one page visual >>>>> interfaces (Graphical or Text, but it needs to run across Windows, >>>>> Cygwin, Linux,*BSD, OSX ...). These interfaces are nothing more >>>>> than option checklists and text fields. Conceptually something = like: >>>>>=20 >>>>> Please Select Your Installation Options: >>>>>=20 >>>>> Windows Compatibility Services _ >>>>> Linux Compatibility Services _ >>>>> TRS-DOS Compatibility Services _ >>>>>=20 >>>>> What Is Your email Address: _______________________ >>>>>=20 >>>>> What I'm looking for is a way to describe such forms in a text >>>>> file that can then be fed into a tool to generate the necessary >>>>> pyGUI, Tkinter, (or whatever) code. The idea is that it should >>>>> be simple to generate a basic interface like this and have it >>>>> only record the user's input. Thereafter, the python code >>>>> would act on the basis of those selection without any further >>>>> connection to the GUI. >>>>>=20 >>>>> An added bonus would be a similar kind of thing for generating >>>>> web interfaces to do this. This might actually be a better model >>>>> because then I only have to worry about a single presentation >>>>> environment. >>>>>=20 >>>>> Ideas anyone? >>=20 >> Hi Tim >> This looks pretty straightforward to me; maybe I'm missing something. = It doesn't look trivial, but the steps seem pretty clear. Is there some = part in particular that's giving you trouble? >>=20 >> Cheers >> Philip >>=20 >=20 > I want to take a text definition file that looks something this: >=20 > Title "Please Select Your Installation Options:" >=20 >=20 > Checkbox "Windows Compatibility Services" > Checkbox "Linux Compatibility Services" > Checkbox "TRS-DOS Compatibility Services" >=20 > Inputbox "What Is Your email Address:" >=20 >=20 > And have that aut-generate the GUI interface described above for the > selected GUI toolkit and/or an equivalent HTML page. >=20 > I know I can write a program to do this, but it seems that someone = else > may have already solved this problem. Oh, I see. I didn't realize you were looking for a most canned solution. = I agree that it's a problem that's been solved many times. I've used Mako before as an HTML templating engine, but ISTR that it = points out that it's agnostic to what it's templating. In other words, = it only cares about what's between the Mako escape tags, it doesn't care = if the surrounding text is HTML or XML or Python or whatever.=20 So you could have a Mako template that consists mostly of Python code = that builds a wxPython window (if wxPython is your cup of tea) and then = some Mako commands in the middle that reads your text definition file = and adds checkboxes, textboxes, etc. as appropriate. It's not a canned = solution, but it does allow you to separate the boilerplate stuff from = the variants. Hope this helps Philip