Re: templates

2006-01-31 Thread thakadu
I haven't got around to trying HTMLTemplate yet but it is on my list of things to do. It would be great to see how it compares in perfomance and simplicity to PyMeld and other DOM approaches. -- http://mail.python.org/mailman/listinfo/python-list

Re: templates

2006-01-31 Thread thakadu
Yes I looked at that but I did not benchmark it. Basically it seems to convert the Meld or part of a Meld into a %s template in any case and I already knew that %s performace was very good. So if I had used PyMeld combined with %s then sure it would be much faster but I wanted to benchmark a pure P

Re: templates

2006-01-31 Thread thakadu
I would like to give a few more specifics about my "benchmarking". The web page had about 10 simple fields and a table of roughly 30 table rows. The method of generation the table rows was exactly the same as the example in the PyMeld documentation ie you create the Meld, you make a copy of a prot

Re: templates

2006-01-30 Thread thakadu
I have used PyMeld (http://www.entrian.com/PyMeld/) which is one of very few that gives a 100% separation of code and presentation, in fact PyMeld is not strictly speaking a template system at all. I have also used Cheetah. (http://www.cheetahtemplate.org/) However for a recent project (http://muti

Re: Indentation/whitespace

2006-01-16 Thread thakadu
Yes, thats what you have to do. And that was my original point, you cannot just paste and go, you have to first reformat. -- http://mail.python.org/mailman/listinfo/python-list

Re: Indentation/whitespace

2006-01-16 Thread thakadu
>It just has to be consistent within a *single* block. Correct, and therein lies the problem I am describing. If someone has used two spaces and you paste into the SAME block where you are using four spaces you will break your code. -- http://mail.python.org/mailman/listinfo/python-list

Re: Indentation/whitespace

2005-12-24 Thread thakadu
>That's hardly Python's fault. That's a problem with lousy browsers, >editors etc. which add word-wrapping or remove whitespace. >Complain to the >browser developers. While I have no doubt that there are lousy browsers out there, the problem is not only with browsers, but also I agree with you its

Re: Indentation/whitespace

2005-12-23 Thread thakadu
I consider myself a fairly experienced Python coder and although I am not "uncomfortable" with significant whitespace there are a few places where I do find it annoying and I wouldnt mind an alternate block delimitation syntax. I would prefer something like the ruby "end" though rather than '{' an

Re: Indentation/whitespace

2005-12-23 Thread thakadu
It is not really unique to Python as I have pointed out on this or other forums before. The Occam (OCCAM?) language also uses significant whitespace in much the same way as Python and there may also be others. -- http://mail.python.org/mailman/listinfo/python-list

Re: bsddb185 question

2005-11-23 Thread thakadu
Martin you are great! If I had just opened the file with f=bsddb185.hashopen('filename',''w') it would have worked the first time. So now I will create wrapper classes around the file classes of bsddb185 and create the methods that I need to keep it consistent with bsddb. Another small difference

Re: bsddb185 question

2005-11-22 Thread thakadu
Thanks Martin However the line: del db[key] results in an error: (1, 'Operation not permitted') (only tested on Python 2.3.5) Could this be because the .del() method of the dictionary has not been implemented either? In fact in my tests any attempt at altering the db by use of normal dictionary me

Re: bsddb185 question

2005-11-22 Thread thakadu
Ok but if you read my original post I already said that! The issue is that I have an application that needs to share data with an existing Berekeley db 1.85 database and applications in perl. Sure if I was creating the database myself I would use the newer bsddbmodule but I can't require the perl c

Re: bsddb185 question

2005-11-22 Thread thakadu
It seems it doesnt implement ALL of the dictionary interface though. dir({}) yields many more methods than dir(bsddb185.open(f)). So bsddb185 is missing many of the methods that I am used to in bsddb. I mentioned some above that are missing, pop() in particular would be useful in my situation but t

bsddb185 question

2005-11-21 Thread thakadu
I have an application that needs to create and delete records in a Berkeley DB version 1.85 database. If I use the bsdddb185 module I dont see any of the record manipulation methods in there that are available in the newer bsddb module. (put(), get(), pop() etc) I know the docs say that one should

Re: HTML generation vs PSP vs Templating Engines

2005-11-16 Thread thakadu
I just do the following: I store the form data as a pickeled dictionary. Then I create my HTML form with something like this: HTMLout=""".. .. ''' where the field1, field2 etc era the fields on my form. Then finally: print HTMLout % dict where dict has all the values that I previous

Re: fcntl.flock() not working when called from a function

2005-11-04 Thread thakadu
Thank you both for your replies. You are both quite correct and upon testing I get the desired results. I was mistakenly expecting the execution of the function to block at the fcntl.flock(f,fcntl.LOCK_EX) line. But I am slowly getting my head around it. Thanks -- http://mail.python.org/mailman

Re: Python and Lotus Notes

2005-11-04 Thread thakadu
I have had success with jython using the notes.jar classes, for example: import lotus.domino import java.io import java.net import java.lang import java.util lotus.notes.NotesThread.sinitThread() S = lotus.notes.Session.newInstance(); db=S.getDatabase("server/domain","domlog.nsf") agent=db.getAge

fcntl.flock() not working when called from a function

2005-11-04 Thread thakadu
The following code works as expected when run in the main body of a python script (ver 2.3.5) on OpenBSD v3.8. but when it is in the body of a function definition it does not work. It does not raise any errors but it simply does not block as expected. I have repeated this in both a cgi envirnoment

Re: Simple prototype text editor in python

2005-10-07 Thread thakadu
Thanks for everyones advice. I finally went for a very basic BSD style template that I found somewhere. Its really short and easy to understand, at least to me! -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple prototype text editor in python

2005-10-06 Thread thakadu
Thanks Robert I have packaged it up with distutils and included the license in the README.txt file. I think I am missing something as I have only seen a place (under submissions) on http://python.org/pypi?%3Aaction=submit_form to submit the PKG_INFO file, or to submit a url manually but nowhere to

Re: Simple prototype text editor in python

2005-10-06 Thread thakadu
Hi Viktor At the moment I dont have any web site where I can upload it. Do you or anyone have any suggestions or know of any web sites where one can post python code? If not please email me and I will send you the code by email. Regarding the license I have not yet decided what type of license (i