Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-07 Thread grahamd
Shane Hathaway wrote: > robert wrote: > > I'd like to use multiple CPU cores for selected time consuming Python > > computations (incl. numpy/scipy) in a frictionless manner. > > > > Interprocess communication is tedious and out of question, so I > > thought about simply using a more Python interp

Re: is mod_python borked?

2006-11-02 Thread grahamd
walterbyrd wrote: > I am considering python, instead of php, for web-application > development. I often see mod_python.criticisized as being borked, > broken, or just plain sucking. > > Any truth to any of that? I replied to you over on the mod_python mailing list when you reposted the question t

Re: PROBLEM with MOD_PYTHON

2006-10-28 Thread grahamd
dan84 wrote: > I don't understand this error , in the (Apache) errorlog I read this > message : > > [Sat Oct 28 14:04:03 2006] [error] make_obcallback: could not import > mod_python.apache.\n > [Sat Oct 28 14:04:03 2006] [error] make_obcallback: Python path being > used "['C:Python24python2

Re: HTML Templates (Sitemesh/Tiles concept) in Python

2006-10-23 Thread grahamd
Suren wrote: > > Python with ? CGI ? FastCGI ? mod_python ? Other ? > > We are using mod_python and SSI. We are inheriting some legacy code > that we do not want to mess with at all. If you are already using SSI for basic page composition using 'include virtual', it may be of interest for you to k

Re: silent processing with python+modpython+cheetah

2006-10-21 Thread grahamd
Sai Krishna M wrote: > Hi, > > I have been working for some time developing web pages using python, > modpython, cheetah. > I find that this method has come inherent difficulties in it like if > we want to generate a single page we have to write two separate files > ( py & tmpl). > Is there any ot

Re: CGI -> mod_python

2006-10-03 Thread grahamd
[EMAIL PROTECTED] wrote: > Hi, > > it is a kind of nooby question. Is there a way to transfer a CGI python > script to mod_python without rewriting the code? Did you look in the mod_python documentation? http://www.modpython.org/live/current/doc-html/hand-cgi.html It certainly isn't the prefe

Re: What's the best way to communicate between processes?

2006-09-27 Thread grahamd
[EMAIL PROTECTED] wrote: > I'm thinking about coding some sort of 'local notify server' in twisted > (basically just listening to a socket and then passing the information > to the IM bot), then connecting to it via a python socket in django and > passing some serialized/pickled data. Use the XML-

Re: os.path.normpath

2006-08-09 Thread grahamd
[EMAIL PROTECTED] wrote: > I am using a windows box and passing a string like "../foo/../foo2" to > normpath which then returns "..\\foo2". But if this string is going > into a webpage link it should really be "../foo". > > Is there any way to tell os.path.normpath to act like we are an a unix > s

Re: Event notification system - where to start ?

2006-06-29 Thread grahamd
[EMAIL PROTECTED] wrote: > We have been asked to develop and application for a client that is a > 'notification" system. We would like to use python, but are struggling > to find the right starting point. Any suggestions, tips or sample code > would be appreciated. > > Application outline; > > M

Re: [newbie]apache authentication questions

2006-06-12 Thread grahamd
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > Since HTTP authentication is managed by the browser it's difficult to > integrate it with web application authentication: basically you have to > choose between the two. There's no way for the server to tell the > browser to start presenting the requ

Re: [mod_python] using nested blocks in psp

2006-06-12 Thread grahamd
cloc3 wrote: > I'm a newbie in python, and I'm fighting against nested blocks in psp. > Thats a little example with a funny behaviour: > [code] > > > > > > <% > for i in range(50, 350, 50): > if 'List' in form and int(form['List'])==i: > sel="selected" > else: > sel="pippo" > %> ><%=i%>

Re: mod_python web-dav management system

2006-04-19 Thread grahamd
Kyler Laird wrote: > Damjan <[EMAIL PROTECTED]> writes: > > >Now I've been thinking that it might be pretty easy to implement a > >authorization layer with mod_python (but living handling of the web-dav > >protocol to apache)... So, has anyone already done something similar? > > Yup. I'm in the p

Re: minidom + wxPython woes

2006-04-11 Thread grahamd
Paul Boddie wrote: > Frank Millman wrote: > > Fredrik Lundh wrote: > > > > > > no, it's not a bug in the pyexpat module -- the problem is that > > > wxPython uses it's own incompatible version of the expat library, > > > and loads it in a way that causes problems for any library that's > > > tries

Re: Apache and Python and Ubuntu

2006-03-29 Thread grahamd
[EMAIL PROTECTED] wrote: > I've create an Ubuntu Linux box, which comes pre-installed with Python > (I've added the libapache2-mod-python throught the app manager). I've > created .cgi and .py simple programs in the www root of apache. > > The problem is the programs just dump the contents to th

Re: mod_python bytecompiling

2006-03-29 Thread grahamd
Fredrik Lundh wrote: > "mneagul" wrote: > > >I am writing a small program using mod_python publisher extension. I > > have created several python files and imported them in a `main' file. > >How can I stop mod_python to byte compile the files? I want to make > > changes to the files and se

Re: Caching in memory for Apache

2006-03-24 Thread grahamd
Simon Johnson wrote: > Dear All, > > I have decided to take the big plunge and drop the Microsoft platform > and use Mod_Python and Apache in it's place. > > I've never used Linux before this project so it's a really big learning > curve, but so far it's going well. I've managed to create some si

Re: combining mod_python handlers publisher and psp problem

2006-03-20 Thread grahamd
You could also have done: def index(req, name='John'): s = 'Hello, there!' if name: names = ['a', 'b', 'c'] s = 'Hello, %s!' % name.capitalize() tmpl = psp.PSP(req, filename='index.psp') req.content_type = 'text/html' tmpl.run(vars = { 'g

Re: mod_python + publisher + psp + session problems

2006-03-20 Thread grahamd
exhuma.twn wrote: > Hi again, > > as soon as I try to make use of the "session" object inside a > psp-template file, I get the following error: > > Mod_python error: "PythonHandler mod_python.publisher" > > Traceback (most recent call last): > > File "/usr/lib/python2.4/site-packages/mod_python/

Re: mod_python and open HTTP connection

2006-02-17 Thread grahamd
Charles wrote: > Hello, I'm think about using mod_python for a project but I need to make > sure: Does mod_python time out after a minute ? (I hope not). Mod_python itself doesn't time out. If such a thing happened it would be because of how Apache, some intermediate proxy or the client is config

Re: apache mod_python problem

2006-02-15 Thread grahamd
Ido Yehieli wrote: > Thank you for your response, > but I think it's not it - that didn't make any difference. Suggest you read: http://www.dscpl.com.au/articles/modpython-001.html It contains helpful hints for getting a basic handler working in mod_python. If you can get that working, then t

Re: Python as a Server vs Running Under Apache

2006-01-04 Thread grahamd
fuzzylollipop wrote: > there are lots of things you can't do or can't do easily or can't do at > efficiently in Apache using python as cgi or as anyone would more > likely assume mod_python. anything that requires any shared state or > shared resources in Apache is next to impossible. Doing similar

Re: Python as a Server vs Running Under Apache

2005-12-30 Thread grahamd
> as great as mod_python is, there are lots of restrictions and > limitations to what youc an do with it because of limitations of apache > itself, and I am refereing to apache 2.x as well as 1.x, like others > are saying if you don't need apache specific things it will just be one > more thing to

Re: mod_python and threads

2005-12-19 Thread grahamd
Depends on what you mean exactly. If one is on Win32 or using worker mode for Apache, the threads are actually initially created down at the Apache level as part of a common pool and are not bound to a specific Python interpreter. That is, two distinct requests in time could make use of the same t

Re: understanding mod_python

2005-12-19 Thread grahamd
PyPK wrote: > Hi I'm trying to learn mod python and need some one to explain how to > do http redirection(302) with an example code Have you read the documentation? Specifically, check out the function mod_python.util.redirect(): http://www.modpython.org/live/current/doc-html/pyapi-util-f

Re: ANNOUNCE: Mod_python 3.2.5 Beta

2005-11-23 Thread grahamd
Damjan wrote: > > The Apache Software Foundation and The Apache HTTP Server Project are > > pleased to announce the 3.2.5 Beta release mod_python. > http://www.modpython.org/live/mod_python-3.2.5b/doc-html/hand-pub-alg-auth.html > > says "Since functions cannot be assigned attributes,..." > > But t

Re: Python/Apache Oddness On OSX

2005-10-24 Thread grahamd
John Abel wrote: > Hi, > > I'm running Python 2.3.5/2.4.2 on OSX 10.4.2, and am trying to run CGI > scripts using the builtin Apache. For ease, I've symlinked my custom > modules into the /Library/Python/2.3/site-packages directory, and they > import OK via command line python. However, when I pe

Re: need help with mod_python in RH 9

2005-06-21 Thread grahamd
Oh, one minor thing. Your content type should be "text/plain" and not "text/html" as you aren't returning HTML This isn't going to be causing the problem you are seeing though. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: need help with mod_python in RH 9

2005-06-21 Thread grahamd
Read: http://www.dscpl.com.au/projects/vampire/articles/modpython-001.html It addresses the more common problems and how to sort out what you may not have done right. Anyway, I don't seem to see any problems with what you have said you have done, so work through the referenced document. Especi

Re: Mod_python psp import module problem

2005-06-10 Thread grahamd
May be related to this bug: http://issues.apache.org/jira/browse/MODPYTHON-12 Where you have: import mod_python.psp change it to: psp = apache.import_module("mod_python.psp") Access the PSP object then as: psp.PSP and not: mod_python.psp.PSP It will happen where somewhere else w

Re: Embedding: many interpreters OR one interpreter with many thread states ?

2005-06-09 Thread grahamd
Greg Ewing wrote: > [EMAIL PROTECTED] wrote: > > > - creating many sub-interpreters (Py_NewInterpreter) with a thread > > state each > > > > Or > > > > - creating one interpreter with many thread states (PyThreadState_New) > > My understanding is that using multiple interpeters isn't > really supp

Re: PSP / mod_python ... how to get POST vars on .psp ?

2005-06-06 Thread grahamd
The documentation states: Additionally, the PSP code will be given global variables req, psp, session and form. In other words, in your PSP page you can access the "form" variable and it will give you access to the FieldStorage object that PSP creates for you. The members of the FieldStorage c

Re: mod_python config problem

2005-06-03 Thread grahamd
David Stanek wrote: > On Fri, Jun 03, 2005 at 01:16:17PM -0600, Manuel Pellecer wrote: > > i want to use mod_python with Apache2 and i made a .htaccess in the > > subdirectory where i have all my scripts: > > > > The .htacces goes like this: > > > > AddHandler mod_python .py > > PythonHandler mpte

Re: installing mod_python with python 2.4 on Windows xp

2005-05-15 Thread grahamd
Suggested that you ask this on the mod_python mailing list: http://mailman.modpython.org/mailman/listinfo/mod_python Detail exactly what the problems you are having are. The person who packages the dev versions is on the mod_python list as are other developers of mod_python. I don't know that t

Re: Mod_python

2005-05-03 Thread grahamd
Gensek wrote: > Python is obviously binary, but I compiled Apache and modpython. I > restarted apache before using the config. I'm inclined to believe that > I'm doing everything right, but the computer isn't. Try following through the directions/hints in: http://www.dscpl.com.au/projects/vamp

Re: mod_python and zope

2005-03-31 Thread grahamd
David Bear wrote: > I will be running zope, and I would also like to run mod_python. The problem > arised when zope wants a threaded version of python and mod_python wants > no_threads. Threads work fine with mod_python. What makes you think they don't? What versions of Apache/Python/mod_python a

Re: mod_python, user missing

2005-03-25 Thread grahamd
Okay, reason it doesn't work is that req.get_basic_auth_pw() only applies when using Apache itself to perform the user authentication. Ie., where in Apache configuration files you have something like: AuthType Basic AuthName "VIP" AuthUserFile /tmp/pwdb Require user noppa It doesn't work

Re: mod_python, user missing

2005-03-25 Thread grahamd
Good question, according to the documentation it should work, I'll push this onto the mod_python mailing list for discussion and get a bug report posted if necessary. In the meantime, you could use the following work around: def __auth__(req, user, passwd): req.user = user if user == 'n

Re: mod_python & "please recompile it with -DEAPI" apache warning

2005-03-07 Thread grahamd
[EMAIL PROTECTED] wrote: > 2) added to MakeFile after config: > EXTRA_CFLAGS=-DEAPI You can do this, but it should be to "src/Makefile" and added to "CFLAGS" and not "EXTRA_CFLAGS" as the latter doesn't exist. -- http://mail.python.org/mailman/listinfo/python-list

Re: python/linux guru needed.. now!!!!

2005-03-05 Thread grahamd
bruce wrote: > hi... > > i have a situation with a linux rh8 server. i can't seem to get > python/mod_python/apache working as one... > > i can't seem to import mod_python from the python interpreter to work, and > i'm not sure as to why. i'm fairly convinced that it's a conflict issue of > some t

Re: Moving to Python from PHP - 3 questions

2005-02-21 Thread grahamd
> If you do manage to get mod_python working, I suggest taking a look at > Vampire as well: http://www.dscpl.com.au/projects/vampire/ > I have had good experience with it. Once you start using mod_python > you'll realize you can really go anywhere you want; and that's not > necessarily a good thing

Re: Moving to Python from PHP - 3 questions

2005-02-21 Thread grahamd
Michal Migurski wrote: > 3) Structured request variables. PHP has a really handy feature where > request variables with name like "foo[]", "foo[bar]", or > "foo[bar][baz]" are automatically structured into nested associative > arrays. I can see that the python cgi module will make a list of > Min

Re: Who should security issues be reported to?

2005-01-28 Thread grahamd
> OP: Did you discover this supposed security hole from black-box observation > of behavior or by being one of the 'lots of people being able to look at > source code', thereby giving evidence to the point? The technique used which is the source of the problem was actually first discovered in a se

Re: Who should security issues be reported to?

2005-01-28 Thread grahamd
Aahz wrote: > In article <[EMAIL PROTECTED]>, > <[EMAIL PROTECTED]> wrote: > > > >Who are the appropriate people to report security problems to in > >respect of a module included with the Python distribution? I don't > >feel it appropriate to be reporting it on general mailing lists. > > There i

Who should security issues be reported to?

2005-01-27 Thread grahamd
Who are the appropriate people to report security problems to in respect of a module included with the Python distribution? I don't feel it appropriate to be reporting it on general mailing lists. -- http://mail.python.org/mailman/listinfo/python-list

Re: a ConfigParser wtf moment

2005-01-13 Thread grahamd
True, wasn't thinking. This will affect get() as well. My problem was a slightly different problem. In your case you would have got what you wanted if get()/items() instead of being implemented as: .try: .value = d[option] .except KeyError: .raise NoOptionE

Re: a ConfigParser wtf moment

2005-01-13 Thread grahamd
Sort of hard to explain, but if you put another: list = configuration.items("core") print list at the end of the script, you will find that the original config hasn't been changed. It is a quirk of how the items() method is implemented using 'yield' that means that you see what you do. In partic

Re: Contributor's List

2005-01-06 Thread grahamd
Anand wrote: > A list of contributors to Python Cookbook (Second Edition) is available > at the following links. Original list courtesy Alex Martelli. > > Since the book is not yet in print, the lists are still tentative > because of potential last minute editing changes. > > List of first authors

Re: Contributor's List

2005-01-06 Thread grahamd
Anand wrote: > A list of contributors to Python Cookbook (Second Edition) is available > at the following links. Original list courtesy Alex Martelli. > > Since the book is not yet in print, the lists are still tentative > because of potential last minute editing changes. > > List of first authors

Re: modpython, apache and windows

2005-01-05 Thread grahamd
Bob Van Zant wrote: > Fortunately most of the Python-for-the-web implementations do not follow > closely to the PHP paradigm of web-based programming. There are some, > like PSP, that more closely model what PHP does. > > It is not uncommon to have something like index.py which does hardly > anythi