Re: [Webware-discuss] webware on Linux VServer

2006-11-14 Thread Randall Smith
Randall Smith wrote:
> I'm trying to get webware going on VServer, but I'm getting the error below.
> 
> Listening on ('127.0.0.1', 8086)
> Ready  (0.36 seconds after launch)
> 
> Listening on ('127.0.0.1', 8080)
> ('192.168.1.203', 8080)
> Traceback (most recent call last):
>File 
> "/usr/local/lib/python2.4/site-packages/webware/WebKit/NewThreadedAppServer.py",
>  
> line 530, in run
>  server.mainloop()
>File 
> "/usr/local/lib/python2.4/site-packages/webware/WebKit/NewThreadedAppServer.py",
>  
> line 140, in mainloop
>  handler = self._handlerCache[serverAddress].pop()
> KeyError: ('192.168.1.203', 8080)
> 
> I'm accessing it from 192.168.1.102.  I'm sure it's a VServer routing 
> thing, but I haven't had trouble with Apache, Postgres, SSH, etc. 
> Looking at the code, socket.getsockname() is returning 192.168.1.203. 
> If I put this in:
> 
>  except KeyError:
>  handler = self._handlerCache[(127.0.0.1, serverAddress[1])].pop()
> 
> It then says that I'm trying to pop from an empty list.  Ideas?
> 
> Randall
>   

NewThreadedAppServer.py:140

This works, but obviously isn't proper:

 if serverAddress not in self._handlerCache:
 serverAddress = ('127.0.0.1', serverAddress[1])

Randall


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] webware on Linux VServer

2006-11-14 Thread Randall Smith
Randall Smith wrote:
> I'm trying to get webware going on VServer, but I'm getting the error below.
> 
> Listening on ('127.0.0.1', 8086)
> Ready  (0.36 seconds after launch)
> 
> Listening on ('127.0.0.1', 8080)
> ('192.168.1.203', 8080)
> Traceback (most recent call last):
>File 
> "/usr/local/lib/python2.4/site-packages/webware/WebKit/NewThreadedAppServer.py",
>  
> line 530, in run
>  server.mainloop()
>File 
> "/usr/local/lib/python2.4/site-packages/webware/WebKit/NewThreadedAppServer.py",
>  
> line 140, in mainloop
>  handler = self._handlerCache[serverAddress].pop()
> KeyError: ('192.168.1.203', 8080)
> 
> I'm accessing it from 192.168.1.102.  I'm sure it's a VServer routing 
> thing, but I haven't had trouble with Apache, Postgres, SSH, etc. 
> Looking at the code, socket.getsockname() is returning 192.168.1.203. 
> If I put this in:
> 
>  except KeyError:
>  handler = self._handlerCache[(127.0.0.1, serverAddress[1])].pop()
> 
> It then says that I'm trying to pop from an empty list.  Ideas?
> 
> Randall
>   

self._handlerCache looks like this:

{('127.0.0.1', 8080): [], ('127.0.0.1', 8086): []}


Randall


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] webware on Linux VServer

2006-11-14 Thread Randall Smith
I'm trying to get webware going on VServer, but I'm getting the error below.

Listening on ('127.0.0.1', 8086)
Ready  (0.36 seconds after launch)

Listening on ('127.0.0.1', 8080)
('192.168.1.203', 8080)
Traceback (most recent call last):
   File 
"/usr/local/lib/python2.4/site-packages/webware/WebKit/NewThreadedAppServer.py",
 
line 530, in run
 server.mainloop()
   File 
"/usr/local/lib/python2.4/site-packages/webware/WebKit/NewThreadedAppServer.py",
 
line 140, in mainloop
 handler = self._handlerCache[serverAddress].pop()
KeyError: ('192.168.1.203', 8080)

I'm accessing it from 192.168.1.102.  I'm sure it's a VServer routing 
thing, but I haven't had trouble with Apache, Postgres, SSH, etc. 
Looking at the code, socket.getsockname() is returning 192.168.1.203. 
If I put this in:

 except KeyError:
 handler = self._handlerCache[(127.0.0.1, serverAddress[1])].pop()

It then says that I'm trying to pop from an empty list.  Ideas?

Randall



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] Starting as user webware with environment variables

2004-08-18 Thread Randall Smith
My webkit setup requires certain environment variables to be set up in 
order to use Oracle.  I'm starting webkit (using the included script) as 
user webware, but environment variables are not set, so the webkit 
instance cannot access the Oracle libraries.  I can put the environment 
variables inline with the startup script and Oracle access works, but 
then /etc/init.d/webkit stop doesn't stop webkit.  It kills the right 
PID (so it seems), but there are still several threads running.  In this 
case I manually kill the first listed thread and they all die.  I saw 
this question in the Wiki, but haven't seen a solution.  Anybody got one?

Randall
---
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] Using session storage without the cookies

2004-06-21 Thread Randall Smith
This came out of a previous thread I started.  I'm using XMLRPC and I 
want to take advantage of Webware's session storage without using 
cookies.  What I have in mind is to generate a unique id, store and 
retrieve variables using that unique id.  Basically everything about 
sessions but the cookie.  I'll handle sending and receiving the unique 
id with the XMLRPC client.  Any idea how to do this with Webware's sessions?

Randall
---
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] threading, objects, initialization, xmlrpcservlet, my ignorance

2004-06-21 Thread Randall Smith

Michael Palmer wrote:
Randall Smith wrote:

Michael Palmer wrote:
Randall Smith wrote:
It parses text files that contain lab results, manipulates the data, 
then uploads it to a database.

Interesting. I have to keep track of lab data, too. It would be great if 
you could make this available when you are done.

Sure, if it would help you.  Here is an overview to see if you are 
interested.  Machines in the lab generate electronic reports for their 
results.  These reports are different for each machine.  I built a text 
parser for each report.  The LabRat accepts the report through PHP 
Website -> XMLRPC -> Python LabRat, determines which parser is needed, 
parses the results, manipulates the data for uploading, uploads the data 
to a database.

This is the scope thus far.  There is also a reporting end that uses 
Reportlab.


I have flexibility in the design of LabRat.  Some requests may depend 
on the result of a previous request, so I will need some form of 
persistence.  I do not know how to implement sessions using XMLRPC.

I like Webware's session storage because it lasts between process 
restarts.  Could I use Webware's session storage and couple it with a 
simple client id system?  Client requests id -> server sends id -> 
client sends data to store and id -> server stores data in session 
using id as key.

Is there any strong reason to use XMLRPCServlet and not Page as a base 
class for your servlets? If you could use Page, you would get the 
session storage for free. You can still import all kinds of XML modules 
and libraries to parse or output XML.


I looked at Page and saw that session is called from the transaction.  I 
don't see any advantage to using Page as I could just call session from 
the transaction.  The problem lies with cookies.  My XMLRPC client 
doesn't know what to do with a cookie.  That's why I'd like to just get 
at the WebKit session storage.  I could develop my own method for giving 
session ids to the XMLRPC client.

Randall
---
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] threading, objects, initialization, xmlrpcservlet, my ignorance

2004-06-20 Thread Randall Smith

Michael Palmer wrote:
Randall Smith wrote:
I'm writing an app that uses the XMLRPCServlet class.  I'm writing my 
app so that the 'business' logic is completely unaware of Webware or 
XMLRPC.  A class called LabRat contains all of the business logic.

does this name mean that the app is somehow related to experimental lab 
work? If so, could you explain a bit more?

It parses text files that contain lab results, manipulates the data, 
then uploads it to a database.
Because Webware is multi-threaded, does the LabRat() need to know this 
and act accordingly?  The LabRat() accesses files and changes 
variables, which I imagine might require a lock.aquire(), lock.release().

Yes
What is they best way to include the LabRat() in XMLRPCServlet?  From 
the example, it is not clear how to add object methods.  Some 
attributes of LabRat() should not be persistent and others should be 
persistent across all instances such that all instances see the change 
made by one.

Does a LabRat instance itself persist between requests, e.g. in a 
session, or is it instantiated anew with each request?
For things that should be available to all instances, it's easiest use a 
module global:

_president = 'G.W.Bush'
class LabRat(object):
   def elect(self):
  while _president  == 'G.W.Bush':
   self.recount()
I have flexibility in the design of LabRat.  Some requests may depend on 
the result of a previous request, so I will need some form of 
persistence.  I do not know how to implement sessions using XMLRPC.

I like Webware's session storage because it lasts between process 
restarts.  Could I use Webware's session storage and couple it with a 
simple client id system?  Client requests id -> server sends id -> 
client sends data to store and id -> server stores data in session using 
id as key.
I'm confused about a servlet's initialization.  I thought all classes 
should have an __init__ method. An "__init__(self): pass" in a servlet 
throws an Exception.

This is because your __init__ hides the __init__ of the base class. If 
you don't define __init__, that of the base class will be called 
automatically. If you do have to do some work in __init__ (which you 
likely do, since you say that LabRat contains 'all the business logic'), 
call XMLRPCServlet.__init__(self) from your own __init__ .

Sorry, that was a stupid question.  I knew that.

I'm also confused in general about the state of variables as a servlet 
'sleeps' and 'wakes'.  What happens to instance variables that get 
set?  Do they persist?  Are they present only in the instance they 
were set in, or all instances?  Is the object re-initialized when it 
'wakes'?

What is and what is not re-initialized depends on what you have in your 
YourServlet.awake method; what persists depends on your 
YourServlet.sleep method.
I use awake and sleep to automatically clean out everything that has 
been stored on self during the request:

   def awake(self, transaction):
   Page.awake(self, transaction) # Call base class, which is Page in 
my case but would be XMLRPCServlet in your's I guess
   # save the keys in the __dict__ as a template for cleaning up later
   self._dictKeysStart = self.__dict__.keys()

   def sleep(self, transaction):
   Page.sleep(self, transaction)
   # clean out everything that has been left behind
   dictKeysEnd = self.__dict__.keys()
   dictKeysStart = self._dictKeysStart[:] # Use a copy to avoid suicide
   for key in dictKeysEnd:
   if key not in dictKeysStart: del self.__dict__[key]

I'm certainly not complaining.  Please don't take it that way.  I like 
Webware most because it is simple/powerful just like Python.  I guess 
that's saying it is Pythonic.

These are all things I think are important to understand to write 
solid apps.

Randall Smith
---
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


---
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] threading, objects, initialization, xmlrpcservlet, my ignorance

2004-06-18 Thread Randall Smith
I'm writing an app that uses the XMLRPCServlet class.  I'm writing my 
app so that the 'business' logic is completely unaware of Webware or 
XMLRPC.  A class called LabRat contains all of the business logic.

Because Webware is multi-threaded, does the LabRat() need to know this 
and act accordingly?  The LabRat() accesses files and changes variables, 
which I imagine might require a lock.aquire(), lock.release().

What is they best way to include the LabRat() in XMLRPCServlet?  From 
the example, it is not clear how to add object methods.  Some attributes 
of LabRat() should not be persistent and others should be persistent 
across all instances such that all instances see the change made by one.

I'm confused about a servlet's initialization.  I thought all classes 
should have an __init__ method. An "__init__(self): pass" in a servlet 
throws an Exception.

I'm also confused in general about the state of variables as a servlet 
'sleeps' and 'wakes'.  What happens to instance variables that get set? 
 Do they persist?  Are they present only in the instance they were set 
in, or all instances?  Is the object re-initialized when it 'wakes'?

I'm certainly not complaining.  Please don't take it that way.  I like 
Webware most because it is simple/powerful just like Python.  I guess 
that's saying it is Pythonic.

These are all things I think are important to understand to write solid 
apps.

Randall Smith
---
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] webware as general app server for web/xmlrpc/soap ?

2004-03-24 Thread Randall Smith
I am working on a project in which I have chosen to use xmlrpc.  As I 
set out to look for an app server, I wanted one that would allow code 
changes without restarting the process(es) and one that is 
non-blocking.  I considered building my own from the Python standard 
library, and I considered twisted.  I'm not comfortable with twisted's 
deffered solution for writing non-blocking code, and neither solution 
would let me easily manage the server and reload modules, etc.  I had 
used Webware before for building a website and thought it sure would be 
nice if Webware did XMLRPC.  And lo and behold, to my delight, it does!  
Multi-threaded, easily managed, dynamically realoading modules.  And 
written in pure Python.  So I'm happy.

So I ponder.  Why isn't Webware more aggressive as a general webservices 
app server.  Is there a SOAP implementation?  Would it be difficult to 
create one?  Probably not much more difficult to impement than xmprpc.  
It seems like such a natural fit.   Here are its advantages as I see them:

1. Decoupled from the webserver.  Apache does a great job of managing 
connections.  Why try to beat it?  Webware focuses on the application side.

2. Multi-threaded.  Although the global interpreter lock may prevent 
scaling on SMP machines (hence twisteds async), I've found the 
performance to be superb in my experience.  It is very responsive while 
handling simultaneous requests.

3. Manageable.  The web interface for managing the service is nice.  
Being able to reload modules with the server running means more uptime.  
Webware can also watch mtimes on the files to reload them when they are 
changed.

So what else do you want in an app server?  Is there a better app server 
that 'all the other' Pythoneers are using and I'm just missing?  If not, 
ring the bell!  Webware is such a simple and powerful framework for 
building web apps.  It lets me program in Python (unlike Zope) and 
doesn't force me to use a specialized abstracted framework, but provides 
easy access to the things I need (http request info).

So back to my question.  Is Webware intended to be a webservices 
(web/xmlrpc/soap) app server?  If not why?  I understand it is not like 
twisted, supporting every protocol under the sun.  It should not be.  I 
think it should stay with http based protocols.  But why not support 
them all?  If the glove fits.

Randall

---
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] file fubared and I don't know what happened.

2003-12-27 Thread Randall Smith
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
I'm running the current version of webkit on Debian.  I noticed that a
certain view on my website was unavailable and I investigated.  This is
what I found.  The permissions on a file have changed to the following:
cr-srwS-wt  29797 1919903063 591228022 110, 105 Nov  1  2014 Index.py

What is this?  Have I been hacked?  I can't delete the file.  I get an
error saying that the file can't be unlinked.  Help would be appreciated.
Thanks,

Randall
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQE/7kiQF4LF4iX94PARAuZnAJ4teP2sgvpjyGcvnJDFgJ/wKOrgxACfTETl
HDnxeyRZpPpWF0idPwZ5yew=
=wxoQ
-END PGP SIGNATURE-


---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] Apache2Root

2003-09-05 Thread Randall Smith
I'm trying to access my Webware app from the Apache2 root directory.  
I've looked at the Wiki instructions.  Here they are below.

**

1. Add your apache Document root as the default Webkit context

2. Add your webkit location:

   
   WKServer localhost 8086
   SetHandler webkit-handler
   

3. Now make Apache associate py files with the /wk location

Action py-serverpages /WK/
AddType py-serverpages .py

**

Here is my Apache config.

LoadModule webkit_module modules/mod_webkit.so

WKServer localhost 8086
SetHandler webkit-handler


Action py-serverpages /servlet/
AddType py-serverpages .psp
AddType py-serverpages .py
***

I've done all of these things, but I'm confused.  When I make a request, 
say Main.py, I get this error FROM WEBKIT.

The page you requested, */Main.py*, was not found on this server.

Webkit is processing the request, but it is appending it with '/'.  Any 
ideas why?

Also, what is the point of adding Apache's root to my WebKit config?  Is 
it to serve up static content from Apache?

Randall



signature.asc
Description: This is a digitally signed message part


[Webware-discuss] Apache2Root

2003-09-03 Thread Randall Smith
I'm trying to access my Webware app from the Apache2 root directory.  
I've looked at the Wiki instructions.  Here they are below.

**

1. Add your apache Document root as the default Webkit context

2. Add your webkit location:

  
  WKServer localhost 8086
  SetHandler webkit-handler
  
3. Now make Apache associate py files with the /wk location

Action py-serverpages /WK/
AddType py-serverpages .py
**

Here is my Apache config.

LoadModule webkit_module modules/mod_webkit.so

   WKServer localhost 8086
   SetHandler webkit-handler

   
Action py-serverpages /servlet/
AddType py-serverpages .psp
AddType py-serverpages .py
***

I've done all of these things, but I'm confused.  When I make a request, 
say Main.py, I get this error FROM WEBKIT.

The page you requested, */Main.py*, was not found on this server.

Webkit is processing the request, but it is appending it with '/'.  Any 
ideas why?

Also, what is the point of adding Apache's root to my WebKit config?  Is 
it to serve up static content from Apache?

Randall



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] Session Question

2003-08-14 Thread Randall Smith
Vitaliy Fuks wrote:

I believe your problem may be that if you set a cookie and redirect in
same request the cookie is ignored.
You are not inherintly doing that, but because session is expired new
session is created when user requests that page.  At this time, a cookie
with new session id is sent.  At the same time you are doing a redirect
so that cookie is ignored.  When person arrives on redirected page yet
another session is created (because there is no cookie) and this session
does not have the value you are looking for.
If you turn on cookie warnings in your browser you can see if this is
indeed what is happening.
You should check if session is not timed out before setting the value. 
If it is, then you could try to avoid the redirect, either by doing
"your session is expired, please click here to continue", or javascript
 trick.

--Vitaliy

On Mon, 2003-08-11 at 00:32, Randall Smith wrote:
 

I've been having a session problem.  It happens when a session times 
out.  Here is the scenario:

1. User surfs happily with no problems then waits a while.
2. Session times out (I believe).
3. User request handled by displatch servlet (Index.py).
4. Dispatch servlet (Index.py) sets value in session - 
self.session.setValue(name,value)
5. Dispatch servlet (Index.py) forwards request to view servlet (View.py)
6. View servlet (View.py) checks self.session.hasValue(name) and RETURNS 
FALSE!!!

It should have just been set by Index.py, but View.py says that it is 
not set.

Note that this problem only arises after a session times out.  I've set 
the session timeout to 1 minute so that I can find the bug.  This has 
haunted me for a while.  I would appreciate any insight.

Randall



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss
   

Thank you for  your feedback.  The solution is still not evident, but 
I'm getting closer.

''I believe your problem may be that if you set a cookie and redirect in same request the cookie is ignored.''

So why does it work on the first request when the cookie is first set?

I'm not quite sure what you mean by redirect.  I'm not 'redirecting' the 
user.  The forward() happens on the application server side and is 
invisible to the browser.  Note that the process works the first time 
the cookie is set.  So why would it not work when a new cookie is set?

Index.py (Dispatcher) - Receives request, sets session value, forwards 
request to View.py
View.py - Reads session value.

On a new visit:
1. User requests Index.py.
2. Index.py sets session variable.
3. Index.py forwards request to View.py (Not a redirect in browser 
terms. User has not yet received a response.)
4. View.py reads session variable and produces output to browser.

These steps work on a NEW SESSION and continue to work until the session 
times out.  After a failed request, a browser REFRESH will cause it to work.



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] Session Question

2003-08-11 Thread Randall Smith
I've been having a session problem.  It happens when a session times 
out.  Here is the scenario:

1. User surfs happily with no problems then waits a while.
2. Session times out (I believe).
3. User request handled by displatch servlet (Index.py).
4. Dispatch servlet (Index.py) sets value in session - 
self.session.setValue(name,value)
5. Dispatch servlet (Index.py) forwards request to view servlet (View.py)
6. View servlet (View.py) checks self.session.hasValue(name) and RETURNS 
FALSE!!!

It should have just been set by Index.py, but View.py says that it is 
not set.

Note that this problem only arises after a session times out.  I've set 
the session timeout to 1 minute so that I can find the bug.  This has 
haunted me for a while.  I would appreciate any insight.

Randall



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] Performance Concern

2003-07-26 Thread Randall Smith
I'm having some performance problems.  It seems that when a servlet 
takes a long time to service a request, no other requests are completed 
until it finishes.

The case in which I observed this behavior:

I have a servlet that takes input and sends an email using smtplib.  
Today I had network trouble so it could not connect to the mail server.  
The servlet would try for about 30 or so seconds to connect before it 
failed.  While it was attempting to connect, !!!no other servlets would 
respond!!!  As soon as it finished, they responded.  My app is not in 
production yet, but this looks like a potential hangup.  Does this 
behavior sound reasonable for webkit?

My understanding is that servlets fill requests in serial and that two 
or more different servlets should be able to fill requests at the same 
time.   Is this correct?  If so, then I may need to reconfigure my 
application because it seems that only one servlet can respond at one time.

The serial thing raises another issue.  I have been building my 
application with a controller(Index.py) that receives all requests and 
directs them (self.forward()) to the appropriate servlet.  It makes my 
program feel more like an application than a pile of scripts.  Anyway, 
I'm beginning to think that my application will only be able to serve 
one request at a time becuase every requests goes to Index.py before it 
is forwarded.

It really want to use webware (I love Python), so please tell me how I 
can make it perform well.

Randall



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] Newbie Help

2003-07-19 Thread Randall Smith
Hi,

I'm having trouble understanding a certain aspect of webware/python.  
Here is what I'm trying to do.

Three files are involved: SitePage.py, View.py, View.psp (These aren't 
the real names.)

SitePage.py --> View.py --> View.psp
View.py inherits from SitePage and View.psp inherits from View.py. This 
allows me to put most of the logic in View.py and mostly html in 
View.psp.  Below is what they look like.

SitePage.py -- nothing special -- works fine

View.py ***
from lib.SitePage import SitePage
class View(SitePage):
   def __init__(self):
  SitePage.__init__(self)
  self.__stuff = self.request().field('sutff')
   def stuff(self):
  return self.__stuff
View.psp **
<[EMAIL PROTECTED] extents="testlet"%>
<[EMAIL PROTECTED] method="writeContent"%>
<%=self.test()%>
 lots of good html 
The error I get looks like this:

AttributeError: _home_randall_pyrocks_MyContext_real_estate_psp_ba instance has no attribute '_request'

Why can't I access the request object this way?  Is (def writeContent: ) 
the only way to access request, etc. ?

I'm still trying to understand how webware works.  Answers or references 
to docs are appreciated.

Thanks.

Randall



---
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] file placement

2003-06-15 Thread Randall Smith
Below is my directory structure for my webware application.

+ webware_dir
|- 404Text.txt
|- AppServer
|- Launch.py
|- WebKit.cgi
|- address.txt
|- appserverpid.txt
|-+ Cache/
|-+ Configs/
|-+ ErrorMsgs/
|-+ Logs/
|-+ Sessions/
|-+ lib/
|  |- SitePage.py
|  |- db.py
|  |- quickSearch.py
|-+ MyContext/
|  |- Index.py
|  |-+ views/
|  |  |- main.psp
|  |  |- quickSearch.psp
|  |  |- quickSearch.py
The files in the 'views' folder are not accessed directly.  The servlet 
Index.py decides which view should be shown and forwards 
[self.forward('views/quickSearch.psp')] the transaction object to the 
view(main.psp or quickSearch.psp).  What I don't like about this is that 
the files under the views folder could be accessed directly.  If a user 
typed http://site.domain/servlet/views/quickSearch.psp , s/he would be 
accessing the view directly, which I don't want.  Where can I put my 
views so that they can't be accessed directly?  Should I do this in 
apache, making the views/ directory inaccessible?  They need to be in a 
directory where I can update the psp and then refresh the page in a 
browser and see the results without having to restart the app server, 
which brings me to another subject.

The files in the lib/ directory are used by my servlets.  When I make a 
change to a file in the lib directory, or any imported module for that 
matter, I have to restart the appserver to see the changes.  Is there a 
way around this (besides oneshot)?

Also, any comments on my directory structure are welcome.  I'm trying to 
separate core logic and view logic, leaving my psp's editable by someone 
who is python clueless and making my corelogic usable by other 
front-ends (possibly a webservice or widget app).

Randall



---
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] file placement

2003-06-15 Thread Randall Smith
Below is my directory structure for my webware application.

+ webware_dir
|- 404Text.txt
|- AppServer
|- Launch.py
|- WebKit.cgi
|- address.txt
|- appserverpid.txt
|-+ Cache/
|-+ Configs/
|-+ ErrorMsgs/
|-+ Logs/
|-+ Sessions/
|-+ lib/
|  |- SitePage.py
|  |- db.py
|  |- quickSearch.py
|-+ MyContext/
|  |- Index.py
|  |-+ views/
|  |  |- main.psp
|  |  |- quickSearch.psp
|  |  |- quickSearch.py
The files in the 'views' folder are not accessed directly.  The servlet 
Index.py decides which view should be shown and forwards 
[self.forward('views/quickSearch.psp')] the transaction object to the 
view(main.psp or quickSearch.psp).  What I don't like about this is that 
the files under the views folder could be accessed directly.  If a user 
typed http://site.domain/servlet/views/quickSearch.psp , s/he would be 
accessing the view directly, which I don't want.  Where can I put my 
views so that they can't be accessed directly?  Should I do this in 
apache, making the views/ directory inaccessible?  They need to be in a 
directory where I can update the psp and then refresh the page in a 
browser and see the results without having to restart the app server, 
which brings me to another subject.

The files in the lib/ directory are used by my servlets.  When I make a 
change to a file in the lib directory, or any imported module for that 
matter, I have to restart the appserver to see the changes.  Is there a 
way around this (besides oneshot)?

Also, any comments on my directory structure are welcome.  I'm trying to 
separate core logic and view logic, leaving my psp's editable by someone 
who is python clueless and making my corelogic usable by other 
front-ends (possibly a webservice or widget app).

Randall



---
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] file placement

2003-06-15 Thread Randall Smith
Below is my directory structure for my webware application.

+ webware_dir
|- 404Text.txt
|- AppServer
|- Launch.py
|- WebKit.cgi
|- address.txt
|- appserverpid.txt
|-+ Cache/
|-+ Configs/
|-+ ErrorMsgs/
|-+ Logs/
|-+ Sessions/
|-+ lib/
|  |- SitePage.py
|  |- db.py
|  |- quickSearch.py
|-+ MyContext/
|  |- Index.py
|  |-+ views/
|  |  |- main.psp
|  |  |- quickSearch.psp
|  |  |- quickSearch.py
The files in the 'views' folder are not accessed directly.  The servlet 
Index.py decides which view should be shown and forwards 
[self.forward('views/quickSearch.psp')] the transaction object to the 
view(main.psp or quickSearch.psp).  What I don't like about this is that 
the files under the views folder could be accessed directly.  If a user 
typed http://site.domain/servlet/views/quickSearch.psp , s/he would be 
accessing the view directly, which I don't want.  Where can I put my 
views so that they can't be accessed directly?  Should I do this in 
apache, making the views/ directory inaccessible?  They need to be in a 
directory where I can update the psp and then refresh the page in a 
browser and see the results without having to restart the app server, 
which brings me to another subject.

The files in the lib/ directory are used by my servlets.  When I make a 
change to a file in the lib directory, or any imported module for that 
matter, I have to restart the appserver to see the changes.  Is there a 
way around this (besides oneshot)?

Also, any comments on my directory structure are welcome.  I'm trying to 
separate core logic and view logic, leaving my psp's editable by someone 
who is python clueless and making my corelogic usable by other 
front-ends (possibly a webservice or widget app).

Randall



---
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] file placement

2003-06-15 Thread Randall Smith
Below is my directory structure for my webware application.

+ webware_dir
|- 404Text.txt
|- AppServer
|- Launch.py
|- WebKit.cgi
|- address.txt
|- appserverpid.txt
|-+ Cache/
|-+ Configs/
|-+ ErrorMsgs/
|-+ Logs/
|-+ Sessions/
|-+ lib/
|  |- SitePage.py
|  |- db.py
|  |- quickSearch.py
|-+ MyContext/
|  |- Index.py
|  |-+ views/
|  |  |- main.psp
|  |  |- quickSearch.psp
|  |  |- quickSearch.py
The files in the 'views' folder are not accessed directly.  The servlet 
Index.py decides which view should be shown and forwards 
[self.forward('views/quickSearch.psp')] the transaction object to the 
view(main.psp or quickSearch.psp).  What I don't like about this is that 
the files under the views folder could be accessed directly.  If a user 
typed http://site.domain/servlet/views/quickSearch.psp , s/he would be 
accessing the view directly, which I don't want.  Where can I put my 
views so that they can't be accessed directly?  Should I do this in 
apache, making the views/ directory inaccessible?  They need to be in a 
directory where I can update the psp and then refresh the page in a 
browser and see the results without having to restart the app server, 
which brings me to another subject.

The files in the lib/ directory are used by my servlets.  When I make a 
change to a file in the lib directory, or any imported module for that 
matter, I have to restart the appserver to see the changes.  Is there a 
way around this (besides oneshot)?

Also, any comments on my directory structure are welcome.  I'm trying to 
separate core logic and view logic, leaving my psp's editable by someone 
who is python clueless and making my corelogic usable by other 
front-ends (possibly a webservice or widget app).

Randall



---
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] file placement

2003-06-15 Thread Randall Smith
Below is my directory structure for my webware application.

+ webware_dir
|- 404Text.txt
|- AppServer
|- Launch.py
|- WebKit.cgi
|- address.txt
|- appserverpid.txt
|-+ Cache/
|-+ Configs/
|-+ ErrorMsgs/
|-+ Logs/
|-+ Sessions/
|-+ lib/
|  |- SitePage.py
|  |- db.py
|  |- quickSearch.py
|-+ MyContext/
|  |- Index.py
|  |-+ views/
|  |  |- main.psp
|  |  |- quickSearch.psp
|  |  |- quickSearch.py
The files in the 'views' folder are not accessed directly.  The servlet 
Index.py decides which view should be shown and forwards 
[self.forward('views/quickSearch.psp')] the transaction object to the 
view(main.psp or quickSearch.psp).  What I don't like about this is that 
the files under the views folder could be accessed directly.  If a user 
typed http://site.domain/servlet/views/quickSearch.psp , s/he would be 
accessing the view directly, which I don't want.  Where can I put my 
views so that they can't be accessed directly?  Should I do this in 
apache, making the views/ directory inaccessible?  They need to be in a 
directory where I can update the psp and then refresh the page in a 
browser and see the results without having to restart the app server, 
which brings me to another subject.

The files in the lib/ directory are used by my servlets.  When I make a 
change to a file in the lib directory, or any imported module for that 
matter, I have to restart the appserver to see the changes.  Is there a 
way around this (besides oneshot)?

Also, any comments on my directory structure are welcome.  I'm trying to 
separate core logic and view logic, leaving my psp's editable by someone 
who is python clueless and making my corelogic usable by other 
front-ends (possibly a webservice or widget app).

Randall



---
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] file placement

2003-06-15 Thread Randall Smith
Below is my directory structure for my webware application.

+ webware_dir
|- 404Text.txt
|- AppServer
|- Launch.py
|- WebKit.cgi
|- address.txt
|- appserverpid.txt
|-+ Cache/
|-+ Configs/
|-+ ErrorMsgs/
|-+ Logs/
|-+ Sessions/
|-+ lib/
|  |- SitePage.py
|  |- db.py
|  |- quickSearch.py
|-+ MyContext/
|  |- Index.py
|  |-+ views/
|  |  |- main.psp
|  |  |- quickSearch.psp
|  |  |- quickSearch.py
The files in the 'views' folder are not accessed directly.  The servlet 
Index.py decides which view should be shown and forwards 
[self.forward('views/quickSearch.psp')] the transaction object to the 
view(main.psp or quickSearch.psp).  What I don't like about this is that 
the files under the views folder could be accessed directly.  If a user 
typed http://site.domain/servlet/views/quickSearch.psp , s/he would be 
accessing the view directly, which I don't want.  Where can I put my 
views so that they can't be accessed directly?  Should I do this in 
apache, making the views/ directory inaccessible?  They need to be in a 
directory where I can update the psp and then refresh the page in a 
browser and see the results without having to restart the app server, 
which brings me to another subject.

The files in the lib/ directory are used by my servlets.  When I make a 
change to a file in the lib directory, or any imported module for that 
matter, I have to restart the appserver to see the changes.  Is there a 
way around this (besides oneshot)?

Also, any comments on my directory structure are welcome.  I'm trying to 
separate core logic and view logic, leaving my psp's editable by someone 
who is python clueless and making my corelogic usable by other 
front-ends (possibly a webservice or widget app).

Randall



---
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] automatic html validation help

2003-06-04 Thread Randall Smith
I'm trying to configure webware to use the html validation.  I've 
installed the wdg validation software and now I'm stuck on the SitePage 
configuration.  I'm new to Python and Webware and probably just showing 
my ignorance, but here is an explanation of my problem.

When I override the writeBodyParts method like this:

def writeBodyParts(self):
   Page.writeBodyParts()
   self.validateHTML()
I get this error when viewing a page that uses SitePage:

TypeError: unbound method writeBodyParts() must be called with Page 
instance as first argument (got nothing instead)

The error makes sense.  The method expects and instance.  But if I feed 
it an instance (self), it will loop forever.  ???

Here is my SitePage (actually called StarkPage):

from WebKit.Page import Page

class StarkPage(Page):
   def writeDocType(self):
   self.writeln('''http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>''')
   def writeBodyParts(self):
   Page.writeBodyParts()
   self.validateHTML('')

And here is the psp using it:

<[EMAIL PROTECTED] extends="StarkPage"%>
<[EMAIL PROTECTED] method="writeContent"%>
return "StarkVegas.Com"
StarkVegas.Com


that?
I would appreciate any help.

Thanks

Randall



---
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] new confused user

2003-03-02 Thread Randall Smith
I've been looking for a better way to write web applications.  I've used
asp/vbscript and then moved to php on apache/linux.

I used the webkit adapter and setup a seperate application directory and
it works fine.  I added a psp handler in the apache configuration and it
works OK too.

What I'm confused about right now is the Page/SitePage stuff.  From what I
understand, psp files use the Page ?servlet? and by default override the
writeHTML method.  How does writeHTML become the default method?  I would
like writeContent or writeBody to be the default method because I don't
want to have to write <%@ Page method="writeContent"%> in every psp file. 
Note that the psp files are not in the application directory.  The app
directory is /var/www/appdir and psp directory is /var/www/html/pspdir.

I looked at the examples and this is what I am seeing:
<%@ page imports ="sys,os,time,PSP.Examples.PSPExamplePage:PSPExamplePage"%>
<%@ page method="writeContent" %>
<%@ page extends="PSPExamplePage"%>

Do I I have to do all of this with every psp file?

Can I define some SitePage with a default method of writeContent so that I
can just write content and the rest of the document will be automatically
generated?

Thanks

Randall




---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] php convert - need guidance

2003-02-22 Thread Randall Smith
I've used php for 1 year and I think it's great, but I'm trying to 
improve my programming methods and find php is not sufficient for my 
needs.  I've played around with python and I really like its syntax, 
ease of use, oo design, among other things.  I've found myself doing oo 
in php, trying to separate core logic from presentation logic and create 
reusable code.  PHP will work, but is not designed for this.  Java looks 
like a good solution.  It is a very well structured language that has 
mature solutions and a huge user-base.  High quality open source 
solutions such as JBOSS are inviting!  Although, over the years, I've 
shyed away from Java for a few reasons.  1.  Slower development due to 
typing variables and compiling code.  2.  Not open source.  I prefer to 
use open source when it is available.

My opinions (and/or feelings) right now:

Python is my language of choice because of its fast development, oo 
design, portability, maturity, and good user base.  Now I'm looking for 
a good application server.  I don't like a servlet only solution.  I 
prefer to create xhtml documents with coded inserted in it (psp style) 
so that it still looks like an xhtml document.  But I only want display 
logic in the psp file.  What I despise is:

method 1
\r\n";
echo "\r\n";
echo "".$title."\r\n";
echo ...
I prefer:

method 2
require('datalogic.php');

   
   
...
I use php examples because that's what I'm familiar with.

I've used method 1 for a while and this is what I see in the servlet 
only approach.  method 2 makes for much cleaner presentation xhtml files.

Templates.  Don't like them.  Why use templates when method 2 works fine 
and is clean.

I'm new to servlet jargon, so please excuse me if I show my ignorance. 
It looks like with webware, I can create a psp file that, when 
requested, can call on a servlet, which using various classes does the 
dirty work and returns the results to the psp file for display.  Is this 
correct?  Is webware the best open source application server available 
to work in this manner?  I would appreciate any advice on which 
direction I should take.  Thanks.

Randall



---
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss