[web2py] Re: Rocket with urllib2 behavior [BUG?]

2011-02-06 Thread Timbo
If you've only got one thread running, then yes, this will deadlock on
any threaded server.

Rocket was certainly not made to not allow lookups back to itself.

Where are you putting this code?  If by assigning to response are
you masking web2py's response object?

I...
1) downloaded a fresh copy of web2py
2) created a fresh application
3) set the index(): to:
def index():
import urllib2
url = 'http://127.0.0.1:8000/welcome/default/index'
resp = urllib2.urlopen(url).read()
return resp + blah

I got the expected result.

I need a little more information to debug this.

-tim

On Feb 6, 12:23 am, vihang vihan...@gmail.com wrote:
 Hi,

 Code:

 import urllib2
     url = 'http://127.0.0.1/server/default/index'
     response = urllib2.urlopen(url)

 Here 127.0.0.1 is the same web2py from which this code is being
 called. On doing so, the web2py hangs. I debugged the issue to Rocket,
 where it does not allocate a new thread to request (active_queue.get()
 does not return a new thread required to complete the response), as
 the current session is already using one. This is not a problem with
 other web servers.

 Is this a bug or just the way Rocket server was made to behave?

 Vihang


[web2py] Re: Rocket with urllib2 behavior [BUG?]

2011-02-06 Thread Timbo
I had one more thought, does '/server/default/index' point to this
code?  If this is the case, then you have an infinite loop that
consumes all available threads and deadlocks.  Again, this is not a
rocket-specific behavior.

On Feb 6, 10:08 am, Timbo tfarr...@owassobible.org wrote:
 If you've only got one thread running, then yes, this will deadlock on
 any threaded server.

 Rocket was certainly not made to not allow lookups back to itself.

 Where are you putting this code?  If by assigning to response are
 you masking web2py's response object?

 I...
 1) downloaded a fresh copy of web2py
 2) created a fresh application
 3) set the index(): to:
 def index():
     import urllib2
     url = 'http://127.0.0.1:8000/welcome/default/index'
     resp = urllib2.urlopen(url).read()
     return resp + blah

 I got the expected result.

 I need a little more information to debug this.

 -tim

 On Feb 6, 12:23 am, vihang vihan...@gmail.com wrote:







  Hi,

  Code:

  import urllib2
      url = 'http://127.0.0.1/server/default/index'
      response = urllib2.urlopen(url)

  Here 127.0.0.1 is the same web2py from which this code is being
  called. On doing so, the web2py hangs. I debugged the issue to Rocket,
  where it does not allocate a new thread to request (active_queue.get()
  does not return a new thread required to complete the response), as
  the current session is already using one. This is not a problem with
  other web servers.

  Is this a bug or just the way Rocket server was made to behave?

  Vihang


[web2py] Re: Rocket with urllib2 behavior [BUG?]

2011-02-06 Thread Timbo
It only creates infinite loops if it's in the welcome
application...which it isn't (as I specified in step 2).

In either case, we still need more information.

On Feb 6, 12:04 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 wait...

 def index():
     import urllib2
     url = 'http://127.0.0.1:8000/welcome/default/index'
     resp = urllib2.urlopen(url).read()
     return resp + blah

 This creates an infinite loops that spans more and more threads.

 I assumed from the original post, the urllopen code was outside a
 controller or at least in a function not calling itself.

 On Feb 6, 10:08 am, Timbo tfarr...@owassobible.org wrote:







  If you've only got one thread running, then yes, this will deadlock on
  any threaded server.

  Rocket was certainly not made to not allow lookups back to itself.

  Where are you putting this code?  If by assigning to response are
  you masking web2py's response object?

  I...
  1) downloaded a fresh copy of web2py
  2) created a fresh application
  3) set the index(): to:
  def index():
      import urllib2
      url = 'http://127.0.0.1:8000/welcome/default/index'
      resp = urllib2.urlopen(url).read()
      return resp + blah

  I got the expected result.

  I need a little more information to debug this.

  -tim

  On Feb 6, 12:23 am, vihang vihan...@gmail.com wrote:

   Hi,

   Code:

   import urllib2
       url = 'http://127.0.0.1/server/default/index'
       response = urllib2.urlopen(url)

   Here 127.0.0.1 is the same web2py from which this code is being
   called. On doing so, the web2py hangs. I debugged the issue to Rocket,
   where it does not allocate a new thread to request (active_queue.get()
   does not return a new thread required to complete the response), as
   the current session is already using one. This is not a problem with
   other web servers.

   Is this a bug or just the way Rocket server was made to behave?

   Vihang


[web2py] Re: memory leak - model remains in memory after requests

2010-12-25 Thread Timbo
So you do use caching?  Is it RAM caching or disk caching?  If RAM
caching, it could be that running under Cherokee and uWSGI is deleting
the environment that web2py is run in after a certain number of
requests.  This would reduce the usefulness of a RAM cache but would
also produce the results you're seeing. Whereas a Python-based server
(Rocket or Cherrypy) would not do this and a RAM cache would persist
as long as the server process (or until otherwise deleted).

Please let us know when you look into the possibilities of caching
being the issue.

@ron_m: Awesome.  Great suggestions!

-tim

On Dec 25, 3:20 pm, David Zejda d...@atlas.cz wrote:
 Thanks for the all replies!

 I do not directly cache DAL objects, but yes, caching may be behind
 the leak
 through some references between objects. Maybe I'll examine it with
 objgraph,
 and I agree, it would be nice to have the function at hand in the
 admin interface.

 Cherrypy  anyserver brings no significant change.

 With Cherokee  uWSGI the problem has gone. Moreover the new setup is
 subjectively
 faster to the previous one (Rocket behind Apache proxy). :)

 David


[web2py] Re: memory leak - model remains in memory after requests

2010-12-24 Thread Timbo
Thadeus,

You seem to have more knowledge about this problem.  Can you file a
bug report?  Did you know that Rocket was recently updated fixing
several bugs (and creating one that has already be addressed).  I'm
not denying the possibility, but let's be a good open source
community.

David,

If your environment allows it, please replace rocket.py line 1071
break with return.  Note that this will put a hard limit on the
number of requests/second rocket can serve to the number of
min_threads set.  If the problem remains after that, then rocket is
not the issue.

I'm tending to side with Massimo.  Caching issue?

-tim

On Dec 24, 6:20 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 This is due to the built in rocket server (it is not ment for production).
 If you use Apache with mod_wsgi this will not happen.

 --
 Thadeus

 2010/12/24 David Zejda d...@atlas.cz







  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1

  My web2py instance gradually eats memory, during day the consumption
  grows up to several gigs, so I have to restart often. According to guppy
  most of memory is occupied by gluon.dal.Field and other classes of dal:

  Partition of a set of 3231760 objects. Total size = 443724152 bytes.
   Index  Count   %     Size   % Cumulative  % Kind
      0 113419   4 189636568  43 189636568  43 dict of gluon.dal.Field
      1 1324208  41 80561096  18 270197664  61 str
      2 328642  10 15982732   4 286180396  64 tuple
      3  26637   1 13851240   3 300031636  68 dict of
  gluon.validators.IS_IN_DB
      4  98796   3 13436256   3 313467892  71 dict of gluon.dal.Set
      5  20042   1 13344464   3 326812356  74 dict (no owner)
      6   8199   0 11860464   3 338672820  76 gluon.dal.Row
      7  16615   1 11482224   3 350155044  79 gluon.dal.Table
      8  63682   2  8660752   2 358815796  81 dict of gluon.dal.Query
      9 137779   4  7363776   2 366179572  83 list
  2282 more rows. Type e.g. '_.more' to view.

  The proportion is relatively stable. It seems that model definition
  remains in memory after each request. It is probably caused by a weird
  reference, but I'm not sure how to track it. Please do you have any ideas?

  Thanks :)
  David
  -BEGIN PGP SIGNATURE-
  Version: GnuPG v1.4.9 (GNU/Linux)
  Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org

  iEYEARECAAYFAk0VN9gACgkQ3oCkkciamVFHHwCfWiIkmrH9buBYA/7HvgIbz+mR
  ei0AniZ0UYwZtj9zagp2sx/IawmBE2iA
  =9cqX
  -END PGP SIGNATURE-


[web2py] Re: Rocket 1.2

2010-12-03 Thread Timbo
Thanks Jonathan!

Yes, that's all correct.  I forgot about uploading new documentation
but there are no significant changes in the documentation.  The thread
count advice for Jython still holds.

-tim

On Dec 3, 12:17 am, Jonathan Lundell jlund...@pobox.com wrote:
 Rocket 1.2.0 (web2py's embedded web server) is now in the trunk.

 It have various improvements, which perhaps Tim will describe. There is one 
 user-visible interface change that might affect some of you. In the previous 
 version, Rocket's min_threads and max_threads were 10 and 1024 respectively. 
 The cli (and winservice options) --numthreads option allowed the user to 
 override min_threads.

 In the new version, the Rocket defaults are 10 and 0 (meaning no upper 
 limit), and the cli options are --minthreads and --maxthreads (--numthreads 
 is provided for compatibility, meaning the same as --minthreads, but is 
 deprecated).

 If you're running CPython, my impression is that you need to do nothing, and 
 if you've been ignoring thread-count options, also do nothing. If you've been 
 patching maxthreads, the new default of 0 may work fine for you, and if not 
 you now have command-line access to it. Tim suggests increasing minthreads to 
 64 for a production server.

 If you're running JPython, Tim has some thread-count advice for you 
 here:http://packages.python.org/rocket/usage.html(it's for 1.1.x, not 1.2, 
 but I assume that it still applies).

 If you're running winservice, numthreads is now ignored; you must use 
 minthreads and maxthreads (assuming that you want something other than the 
 defaults).

 Again, this is in the trunk, and unless the wheels fall off will be in the 
 next release *after* 1.89.5, which is current-stable.


[web2py] Re: very long wait for http://127.0.0.1:8000/ on IE and Firefox browsers

2010-12-01 Thread Timbo
Rocket 1.2.0 is out.  It addresses the issue above and has some speed
improvements (though that might not be noticeable to the user).  If
you look at the code, it's much cleaner than it was and reflects my
maturing skill as a developer.  I've tested it on cPython 2.4 (the
legacy branch support Py2.4), 2.5, 2.6, 3.1, Jython 2.5.1 and Pypy 1.4
on Windows 7 and cPython 2.6 on Ubuntu.

While building a patch for web2py is not that complicated, I'm time-
restricted until the weekend.  If you can't wait that long, bug
Jonathan Lundell.  He's familiar enough to do it.  ;-)

Cheers,
-tim

On Nov 24, 10:37 am, Timbo tfarr...@owassobible.org wrote:
 I didn't mean to imply that the enhancements I'm planning for 1.2
 (window speed) address this issue...just to be clear.

 @Jonathan: Yes we need to make numthreads map to max-threads and
 default it to 0 (unlimited) or a very high number.  The only time
 reasonable to change this is when running web2py (rocket) on Jython.
 See:

 http://packages.python.org/rocket/usage.html#architecture-considerations

 @Phyo: Thanks.  I'm not fully recovered, but enough to get back in the
 game.

 -tim

 On Nov 24, 9:56 am, Jonathan Lundell jlund...@pobox.com wrote:







  On Nov 24, 2010, at 5:59 AM, Phyo Arkar wrote:

   I haven't tried DEFAULT_MAX_THREADS it yet but to report that it is not 
   just windows problem it happens in Linux too.
   WHen i test my Homepage which dont do anything dynamic much , just login 
   box , with static js and css. That caused long load delays too.

  By all means give max-threads a try. If the problem is thread starvation, 
  it's not likely to be Windows-specific. The default limit is 10, which 
  isn't a lot for pages with a lot of resources.

   Tim , sorry to know that u got injury. Had you recovered well now?

   On Wed, Nov 24, 2010 at 12:01 PM, Jonathan Lundell jlund...@pobox.com 
   wrote:
   On Nov 23, 2010, at 8:48 PM, Anthony wrote:

On Nov 23, 9:26 pm, Jonathan Lundell jlund...@pobox.com wrote:
On Nov 23, 8:10 pm, Timbo tfarr...@owassobible.org wrote:
Set numthreads=0 in your options.py.  See if you still see this
behavior.

options.py is just for running web2py as a Windows service, no? I'm
not running web2py as a Windows service when I observe the problem.

If you're running from the command line, use --options 0.

Do you mean use the -n command line option to set numthreads to 0,
e.g.:

  python web2py.py -a password -i 127.0.0.1 -p 8000 -n 0

I tried this, but in that case, I can't get 127.0.0.1:8000 to load at
all (it just hangs indefinitely).

   Right, now that I look at it, there's no way to override max_threads. 
   Maybe there should be


[web2py] Re: very long wait for http://127.0.0.1:8000/ on IE and Firefox browsers

2010-11-24 Thread Timbo
I didn't mean to imply that the enhancements I'm planning for 1.2
(window speed) address this issue...just to be clear.

@Jonathan: Yes we need to make numthreads map to max-threads and
default it to 0 (unlimited) or a very high number.  The only time
reasonable to change this is when running web2py (rocket) on Jython.
See:

http://packages.python.org/rocket/usage.html#architecture-considerations

@Phyo: Thanks.  I'm not fully recovered, but enough to get back in the
game.

-tim

On Nov 24, 9:56 am, Jonathan Lundell jlund...@pobox.com wrote:
 On Nov 24, 2010, at 5:59 AM, Phyo Arkar wrote:

  I haven't tried DEFAULT_MAX_THREADS it yet but to report that it is not 
  just windows problem it happens in Linux too.
  WHen i test my Homepage which dont do anything dynamic much , just login 
  box , with static js and css. That caused long load delays too.

 By all means give max-threads a try. If the problem is thread starvation, 
 it's not likely to be Windows-specific. The default limit is 10, which isn't 
 a lot for pages with a lot of resources.









  Tim , sorry to know that u got injury. Had you recovered well now?

  On Wed, Nov 24, 2010 at 12:01 PM, Jonathan Lundell jlund...@pobox.com 
  wrote:
  On Nov 23, 2010, at 8:48 PM, Anthony wrote:

   On Nov 23, 9:26 pm, Jonathan Lundell jlund...@pobox.com wrote:
   On Nov 23, 8:10 pm, Timbo tfarr...@owassobible.org wrote:
   Set numthreads=0 in your options.py.  See if you still see this
   behavior.

   options.py is just for running web2py as a Windows service, no? I'm
   not running web2py as a Windows service when I observe the problem.

   If you're running from the command line, use --options 0.

   Do you mean use the -n command line option to set numthreads to 0,
   e.g.:

     python web2py.py -a password -i 127.0.0.1 -p 8000 -n 0

   I tried this, but in that case, I can't get 127.0.0.1:8000 to load at
   all (it just hangs indefinitely).

  Right, now that I look at it, there's no way to override max_threads. Maybe 
  there should be


[web2py] Re: very long wait for http://127.0.0.1:8000/ on IE and Firefox browsers

2010-11-23 Thread Timbo
Rocket is not dead but I did take several months off due to injury and
a job change.  I'm actually working on 1.2 which should see some
performance improvements on Windows.

I'll go download a copy of web2py and report back.

-tim

On Nov 22, 5:25 pm, Phyo Arkar phyo.arkarl...@gmail.com wrote:
 Hmm rocket server issue again..?

 also what i see is Rocket server is not updated for very long , Massimo , is
 Rocket still in development or dead ? , i dont see any development updates
 there..

 On Tue, Nov 23, 2010 at 5:04 AM, Kuba Kucharski 
 kuba.kuchar...@gmail.comwrote:







  Just a hyphotesis, I've seen the issue you are describing many times.
  It always disapears when I move from Rocket to Apache/WSGI. It seems
  to me that it got smth to do with handling static files.

  --
  Kuba


[web2py] Re: very long wait for http://127.0.0.1:8000/ on IE and Firefox browsers

2010-11-23 Thread Timbo
Set numthreads=0 in your options.py.  See if you still see this
behavior.

-tim

On Nov 23, 7:03 pm, Timbo tfarr...@owassobible.org wrote:
 Rocket is not dead but I did take several months off due to injury and
 a job change.  I'm actually working on 1.2 which should see some
 performance improvements on Windows.

 I'll go download a copy of web2py and report back.

 -tim

 On Nov 22, 5:25 pm, Phyo Arkar phyo.arkarl...@gmail.com wrote:







  Hmm rocket server issue again..?

  also what i see is Rocket server is not updated for very long , Massimo , is
  Rocket still in development or dead ? , i dont see any development updates
  there..

  On Tue, Nov 23, 2010 at 5:04 AM, Kuba Kucharski 
  kuba.kuchar...@gmail.comwrote:

   Just a hyphotesis, I've seen the issue you are describing many times.
   It always disapears when I move from Rocket to Apache/WSGI. It seems
   to me that it got smth to do with handling static files.

   --
   Kuba


[web2py] Re: very long wait for http://127.0.0.1:8000/ on IE and Firefox browsers

2010-11-23 Thread Timbo
That's essentially the effect I was going for.  No need to change
DEFAULT_MIN_THREADS, changing DEFAULT_MAX_THREADS should have the
desired effect.

On Nov 23, 10:59 pm, Anthony abasta...@gmail.com wrote:
 I went into rocket.py and set both DEFAULT_MIN_THREADS and
 DEFAULT_MAX_THREADS to 0, and the problem I described (i.e., long load
 times when trying to load apps into separate IE browser tabs) seems to
 go away (apps now load instantly in new IE tabs).

 Anthony

 On Nov 23, 11:48 pm, Anthony abasta...@gmail.com wrote:







  On Nov 23, 9:26 pm, Jonathan Lundell jlund...@pobox.com wrote:

On Nov 23, 8:10 pm, Timbo tfarr...@owassobible.org wrote:
Set numthreads=0 in your options.py.  See if you still see this
behavior.

options.py is just for running web2py as a Windows service, no? I'm
not running web2py as a Windows service when I observe the problem.

   If you're running from the command line, use --options 0.

  Do you mean use the -n command line option to set numthreads to 0,
  e.g.:

     python web2py.py -a password -i 127.0.0.1 -p 8000 -n 0

  I tried this, but in that case, I can't get 127.0.0.1:8000 to load at
  all (it just hangs indefinitely).

  Anthony


[web2py] Re: ssl and http web2py command line issues

2010-11-22 Thread Timbo
Dave,

Sorry it's taken me so long to get back to you on this.  I've taken a
quick look at this and need a little more information.

First of all, you're using one file as your key and your cert file.
But the file you've supplied only contains a cert.  Naturally it can't
used as a key unless it contains a key.

http://docs.python.org/dev/library/ssl.html#combined-key-and-certificate

At this point, I'm only addressing the potential issues with Rocket.
So I'm not going to address the admin-disablement thing.

Currently neither Rocket nor web2py verifies that the key and cert
file you supply actually match each other; Rocket just trusts that you
know what you're doing.  Hence why zeroing out a line does not prevent
it from serving what you give it.

I don't see an easy way in Python to match the two right now.  I've
only done a cursory look, but if you know a better way...I'm all ears.

Cheers,
tim


On Nov 9, 11:45 pm, Dave Johnson davejjohn...@gmail.com wrote:
 If you start up web2py with key/cert for SSL, web2py runs in SSL mode.

 In the startup message it says you can connect via http, but if you attempt
 to connect via plain http, you will get a

 Bad Request

 in your browser.

 [d...@thinkbox web2py]$ python web2py.py -c mycert.pem -k mycert.pem -i
 192.168.1.119 -a hi
 web2py Enterprise Web Framework
 Created by Massimo Di Pierro, Copyright 2007-2010
 Version 1.88.2 (2010-10-29 23:04:43)
 Database drivers available: SQLite3
 Starting hardcron...
 please visit:
        http://192.168.1.119:8000
 use kill -SIGTERM 30522 to shutdown the web2py server
 =

 Here are some thoughts:

 * If not running SSL and you specified a non-loopback interface for web2py
 to run on, the command line should warn about possible disablement of
 admin site?

 * Check that if you specify a cert on command line, you need to specify a
 key (and vice-versa?)
   -- The command line silently fails (although there is checking in
 main.py:)
         if not ssl_certificate or not ssl_private_key:
               logger.info('SSL is off')

 * Do a check that private key and cert match.

 And now for the more interesting item, for some reason SSL connection still
 works with the following cert private key (note:I zeroed out a line in my
 private key!)
 Am I missing something here...?

 [d...@thinkbox web2py]$ cat mycert.pem
 -BEGIN CERTIFICATE-
 MIIDVzCCAj+gAwIBAgIJAKXRQfLWAi/BMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNV
 BAYTAlhYMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg
 Q29tcGFueSBMdGQwHhcNMTAxMDE2MjEyNTA1WhcNMTExMDE2MjEyNTA1WjBCMQsw
 CQYDVQQGEwJYWDEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MRwwGgYDVQQKDBNEZWZh
 dWx0IENvbXBhbnkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
 5TBJypoZfgg630Sx7olCd0PDNhx6dghffVecgW+1BkD7uAGbCaSXg7AgiwTNZJmw
 VO6oiivRgaZi39XG7gy//2uxXcu7d116GkYTRxUSx845O8cCeQm0Kj/ucQ6IfheR
 RTtVAUThBTKNEAtM6Mx6wGk3uHVktvh/MqTKhIvbuJmwj8BLB7w+d99tD4981Fhc
 mvAYIGnf/0jOwG79LiG6DNIuQyPXnVUtf5S6pU2XaJwmUMy2kkhgowvIM33pNKLi
 T0D7LjbvxlrcvfgwoH6GfCT38UX1oGyWJT45cFRiTSXBgxAHajlyM6r5YhTnFCmZ
 hVjjGpXtQcQk9obCX6wI0wIDAQABo1AwTjAdBgNVHQ4EFgQULPMBvZYIXHsebZ+W
 PpSjvxH2gjswHwYDVR0jBBgwFoAULPMBvZYIXHsebZ+WPpSjvxH2gjswDAYDVR0T
 BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEARDXQp8o7aeoiYIsYbqHxpjRyDwDc
 D0klMH86ToLY13ZSRJzk3WzXIqKnPAeae1IyZ66SH9PQU/u8vQLvvReapF1kiOnD
 n6+knUad22olxLVXZ9thyB6NZco9Mh8q3jz27GtSXEQNaVwVQJ2IwsC5XUz1yKgz
 ZJbeW8AdqP9PlacgowYPFMiWvOD1VzRKW5NY5TUKV3cE4JJCiWH0rx7t5GV8vuXM
 xffdZpfUODI0YOxIGVJNwKf8SpMiahyvb4otFnzT3lBqPuyT2EEcqAt2MRsGI2R3
 l/lUlt4IDxsN31BEKAySfUeDPqOKo0MyA2yZ0z85Lgsm5nVJm4NBt2B7tw==
 -END CERTIFICATE-

 [d...@thinkbox web2py]$ cat mybad.pem
 -BEGIN RSA PRIVATE KEY-
 MIIEowIBAAKCAQEA5TBJypoZfgg630Sx7olCd0PDNhx6dghffVecgW+1BkD7uAGb
 CaSXg7AgiwTNZJmwVO6oiivRgaZi39XG7gy//2uxXcu7d116GkYTRxUSx845O8cC
 eQm0Kj/ucQ6IfheRRTtVAUThBTKNEAtM6Mx6wGk3uHVktvh/MqTKhIvbuJmwj8BL
 B7w+d99tD4981FhcmvAYIGnf/0jOwG79LiG6DNIuQyPXnVUtf5S6pU2XaJwmUMy2
 kkhgowvIM33pNKLiT0D7LjbvxlrcvfgwoH6GfCT38UX1oGyWJT45cFRiTSXBgxAH
 ajlyM6r5YhTnFCmZhVjjGpXtQcQk9obCX6wI0wIDAQABAoIBAASpX8bcLYqPtkrW
 Rdw5NH3ihfTyzVbbQr306z0Cvabb6YLLnZCrpV1LVs4dEeRq79g6Znkw/PjrHnW5
 DmvHHJygXyIuQ6jg4Nvp8vhuKEyiGC3sFVPK67w0QrBQAFy4M/85frgg44bMiWv7
 HtxZVGHXggehc6P5F/U6vtfFVHnDtKX93g+NPOYpXQTcO30QftSvYqjgx/2wMhOk
 ItIPOOrKWEwr6Ogjum+g/2u06JgD/vPBpR5Nurs0LUL6H1K50DDOPjlKAQ1LtIJe
 qRw6PB4qMJWP9qTgkiDq98jKJ0zzDDvWjGhz5DqepK8+dyZqF6/1PPJxdE5l6K3I
 AqeVQdkCgYEA9LboYrJpdBScz26I5Q5nL5+iwSvYNIlRLDocjfzrkeXicfTiCzim
 TCHWgVzRL0E78TASELIvioeJ7unpk7a7KiacO2Cat/CwhfUE/aKkiSJbvw/BrmRU
 PY8N65fVRc2UQK51FlulCjNG4TgbMJIQxmVS3zXPhdmr7GAWbyUWNhUCgYEA78IV
 KSo/TqHRRdHzIQfRUNwmGH049/9wGBbkr67NfsNnv6nS+L81NBH+Ko1eMpZELLmt
 OofIvuHpFMryMBJVAr8gOv7sPJQIGIwJxMcNMz1NyJSXoq4hXwXAA2Crpi1ODyj0
 xdiOg47qRwuaYaVjILPqL73ne/vuJdOR2YxqJUcCgYEAxTjMXQ7Q8l7SalL5PTG4
 c6dCclC1tNGee/hxnvVhnXoaYCEuNED5tY3n5OY7KMx4VM+bH52btxe5ULVwLD4u
 5a+sZiZbSzdN7Qgld4ym8magboFyZOwzAFHUtDTwC4u9mcuATf6aKnhc/ZJMR37Q
 yjRK793cXFGrv5tJOVY4amkCgYB61FyQ7VLnjuEuuuOrDV0/5rkhnK2d5+BehwP7
 

[web2py] Re: rocket performance issues

2010-07-22 Thread Timbo
Try one quick change for me please...rocket is constructed around line
655 in main.py

Add a parameter to the constructor call(s):  max_threads=0

Please let me know if that affects the problem.

-tim

On Jul 22, 10:34 am, mdipierro mdipie...@cs.depaul.edu wrote:
 I can reproduce the problem. I did on localhost with two different
 browsers.
 Using firebug I can see it takes 25seconds to download base.css (the
 problem is not always with the same file).
 While I did the test, I also monitored httpserver.log and I find that
 it NEVER takes more than 1.2ms serve base.css.
 This is what the log shows:

 
 127.0.0.1, 2010-07-22 10:16:38, GET, /michealellistest/static/images/
 header.png, HTTP/1.1, 304, 0.000563
 127.0.0.1, 2010-07-22 10:16:38, GET, /favicon.ico, HTTP/1.1, 400,
 0.000631
 127.0.0.1, 2010-07-22 10:16:55, GET, /michealellistest/static/
 base.css, HTTP/1.1, 304, 0.000791    locks firefox for 25secs
 
 127.0.0.1, 2010-07-22 10:22:42, GET, /michealellistest/static/
 jquery.timers-1.2.js, HTTP/1.1, 304, 0.000552
 127.0.0.1, 2010-07-22 10:22:42, GET, /favicon.ico, HTTP/1.1, 400,
 0.000497
 127.0.0.1, 2010-07-22 10:23:02, GET, /michealellistest/static/
 superfish.js, HTTP/1.1, 304, 0.000914    locks chrome for 25secs

 Do you see the time gaps?

 There is a clear pattern. Under heavy load a request that results in a
 HTTP 400 error locks Rocket.

 Notice that the logging is done by a wsgi application that calls
 web2py wsgibase, i.e it time how long it takes web2py to receive the
 request and send the response. The extra time must be spent inside the
 web server.

 It is also important that the times showed in the logs are the actual
 time when the data is being written in the logs. You can see firefox
 waiting for base.css, the server waiting to log base.css and nothing
 else is being printed during the wait, signifying that web2py is not
 running any request.

 We need Tim! This is a problem.

 Massimo

 On Jul 22, 9:22 am, Michael Ellis michael.f.el...@gmail.com wrote:



  I've isolated the problem but absolutely do not understand it.  I can
  reproduce it with a two-line change to web2py_ajax.html.   Will someone with
  the time and equipment please attempt to replicate  this as a sanity check?

  Here's how:

  In the welcome app's web2py_ajax.html, insert the following after line 3.
  response.files.insert(3,URL(r=request,c='static',f='jquery.sparkline.js'))
  response.files.insert(4,URL(r=request,c='static',f='jquery.timers-1.2.js'))

  Copy the attached js files into welcome/static.  They should be the same as
  the versions available online.

  To reproduce the problem, serve web2py on your LAN.  Open the welcome home
  page on two different machines.  One of them can be on the server.  Briskly
  reload the page 10 or more times on either machine then try to reload on the
  other.  In my setup, the delay is reliably 25 seconds from the time I make
  the last click on the first machine.

  I'm able to reproduce this in FF, Chrome, and Safari using the latest web2py
  from trunk.  Haven't tried any other browsers yet.  As noted previously both
  machines are MacBooks running Snow Leopard.

  Mike

   jquery.timers-1.2.js
  4KViewDownload

   jquery.sparkline.js
  62KViewDownload


[web2py] Re: rocket performance issues

2010-07-22 Thread Timbo
OK, so it's a thread-starvation issue.  Let this be the interim fix
for web2py.  I've got several busy days ahead of me so I'll put out a
real fix for Rocket in the coming days.

-tim

On Jul 22, 11:39 am, Michael Ellis michael.f.el...@gmail.com wrote:
 Much improved with suggested change.  Latencies for .js/.css files reduced
 to 100-150 msec.  Thanks Tim!

 Cheers,
 Mike



 On Thu, Jul 22, 2010 at 12:27 PM, Timbo tfarr...@owassobible.org wrote:
  Try one quick change for me please...rocket is constructed around line
  655 in main.py

  Add a parameter to the constructor call(s):  max_threads=0

  Please let me know if that affects the problem.

  -tim

  On Jul 22, 10:34 am, mdipierro mdipie...@cs.depaul.edu wrote:
   I can reproduce the problem. I did on localhost with two different
   browsers.
   Using firebug I can see it takes 25seconds to download base.css (the
   problem is not always with the same file).
   While I did the test, I also monitored httpserver.log and I find that
   it NEVER takes more than 1.2ms serve base.css.
   This is what the log shows:

   
   127.0.0.1, 2010-07-22 10:16:38, GET, /michealellistest/static/images/
   header.png, HTTP/1.1, 304, 0.000563
   127.0.0.1, 2010-07-22 10:16:38, GET, /favicon.ico, HTTP/1.1, 400,
   0.000631
   127.0.0.1, 2010-07-22 10:16:55, GET, /michealellistest/static/
   base.css, HTTP/1.1, 304, 0.000791    locks firefox for 25secs
   
   127.0.0.1, 2010-07-22 10:22:42, GET, /michealellistest/static/
   jquery.timers-1.2.js, HTTP/1.1, 304, 0.000552
   127.0.0.1, 2010-07-22 10:22:42, GET, /favicon.ico, HTTP/1.1, 400,
   0.000497
   127.0.0.1, 2010-07-22 10:23:02, GET, /michealellistest/static/
   superfish.js, HTTP/1.1, 304, 0.000914    locks chrome for 25secs

   Do you see the time gaps?

   There is a clear pattern. Under heavy load a request that results in a
   HTTP 400 error locks Rocket.

   Notice that the logging is done by a wsgi application that calls
   web2py wsgibase, i.e it time how long it takes web2py to receive the
   request and send the response. The extra time must be spent inside the
   web server.

   It is also important that the times showed in the logs are the actual
   time when the data is being written in the logs. You can see firefox
   waiting for base.css, the server waiting to log base.css and nothing
   else is being printed during the wait, signifying that web2py is not
   running any request.

   We need Tim! This is a problem.

   Massimo

   On Jul 22, 9:22 am, Michael Ellis michael.f.el...@gmail.com wrote:

I've isolated the problem but absolutely do not understand it.  I can
reproduce it with a two-line change to web2py_ajax.html.   Will someone
  with
the time and equipment please attempt to replicate  this as a sanity
  check?

Here's how:

In the welcome app's web2py_ajax.html, insert the following after line
  3.

  response.files.insert(3,URL(r=request,c='static',f='jquery.sparkline.js'))

  response.files.insert(4,URL(r=request,c='static',f='jquery.timers-1.2.js'))

Copy the attached js files into welcome/static.  They should be the
  same as
the versions available online.

To reproduce the problem, serve web2py on your LAN.  Open the welcome
  home
page on two different machines.  One of them can be on the server.
   Briskly
reload the page 10 or more times on either machine then try to reload
  on the
other.  In my setup, the delay is reliably 25 seconds from the time I
  make
the last click on the first machine.

I'm able to reproduce this in FF, Chrome, and Safari using the latest
  web2py
from trunk.  Haven't tried any other browsers yet.  As noted previously
  both
machines are MacBooks running Snow Leopard.

Mike

 jquery.timers-1.2.js
4KViewDownload

 jquery.sparkline.js
62KViewDownload


[web2py] Re: web2py performance issue or rather my fault?

2010-07-21 Thread Timbo
Can you get me a debug log of the problem as I described earlier?

On Jul 21, 8:49 am, Kuba Kucharski kuba.kuchar...@gmail.com wrote:
  therefore your problem is not the same that some other
  problems experienced with apache/WSGI.
 exactly,
  look at Iceberg, Rahul, MikeEllis in this thread

 I was just pointing out that I am not the only one seeing
 rocket-specific-problem


[web2py] Re: Rocket cache response

2010-07-20 Thread Timbo
@Jon,

Notice that HTTP(304) call, that doesn't read response.headers, it
only takes in what headers you give it.  In this case it's none.  Flip
over to http.py line 77...there's your answer.

@Iceberg,

As I've noted above, this is a web2py issue.  I'm not going to have
rocket remove headers that the application supplies.  This goes back
to the nanny web-server thing we discussed in another thread.

@Everyone,

So anyone wanna plugin that logging code I posted earlier and send me
a log?  Please.

-tim

On Jul 19, 10:34 pm, Iceberg iceb...@21cn.com wrote:
 On Jul 20, 1:11am, Jonathan Lundell jlund...@pobox.com wrote:





  On Jul 19, 2010, at 10:05 AM, Timbo wrote:

   It's defaulting to text/html since it's not actually sending a file.
   This is a section of the HTTP spec that I missed.
  http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.htmlsaysthat no
   entity headers (Content-* should be sent in a 304 instance)

   I think I can have a patch by this evening.

   However, I've never seen this behavior before so I'll need for someone
   to be able to test this to see if this is actually the cause of the
   problem.  Have we confirmed that the delay behavior happens in
   different browsers? I only see chrome above.

  I'm doubtful that the content-type is related to the delay; it seems more 
  like a cosmetic issue. Still, since Chrome complains about it

 Tim,

 I think Chrome is more sensitive than others to complain incorrect
 content-types. It is easy to see it in a Chrome (mine is 5.0.379.99 on
 WinXP). Just start your local web2py server, then 
 visithttp://127.0.0.1:8000/welcome
 and right-click at the background and choose the last item to pop-up a
 Developer Tools window, then refresh the welcome page, now you can
 see those Warnings such as Resource interpreted as image but
 transferred with MIME type text/html.

 It should not be harmful to satisfy chrome by Tim's coming patch. Even
 it might not be relevant to the delay behavior.

 With respect to the delay behavior, I think it is cross browser,
 albeit I don't have direct evidence. Most of my app's end users use
 IE6/7/8, sometimes they complain some page take long time to load, but
 usually a manually refresh (retry) can bypass the problem. :-/

 Regards,
 Iceberg


[web2py] Re: Rocket cache response

2010-07-19 Thread Timbo
Whoa back up.  Rocket doesn't set the content-type at all, web2py
takes care of that (streamer.py, line 63).  Actually, Rocket will send
on whatever headers it gets,  I think Cherrypy was a little more
selective, which may be one reason the Rocket switch would let this
show up.

W.R.T. the slow requests, Rocket has some pretty verbose logging built-
in that web2py doesn't expose (http://packages.python.org/rocket/
usage.html#logging)  Can one of you who is experiencing this problem
run web2py from this script:

---
import os
import sys
import logging
import logging.handlers
log = logging.getLogger('Rocket')
log.setLevel(logging.DEBUG)
log.addHandler(logging.handlers.FileHandler('rocket.log'))

try:
path = os.path.dirname(os.path.abspath(__file__))
except NameError:
path=os.getcwd() # Seems necessary for py2exe

if not path in sys.path:
sys.path.append(path)
os.chdir(path)

import gluon.import_all
import gluon.widget

# Start Web2py and Web2py cron service!
gluon.widget.start(cron=True)

-

Please use this to create a debug log of a delayed request (the more
the merrier) and email it to me.  As a side-note, some of you have
requested some features for Rocket.  I'm limiting development to
essentials right now because of a case of dual-arm tendinitis.

Thanks.

On Jul 19, 12:11 pm, Jonathan Lundell jlund...@pobox.com wrote:
 On Jul 19, 2010, at 10:05 AM, Timbo wrote:

  It's defaulting to text/html since it's not actually sending a file.
  This is a section of the HTTP spec that I missed.
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.htmlsays that no
  entity headers (Content-* should be sent in a 304 instance)

  I think I can have a patch by this evening.

  However, I've never seen this behavior before so I'll need for someone
  to be able to test this to see if this is actually the cause of the
  problem.  Have we confirmed that the delay behavior happens in
  different browsers? I only see chrome above.

 I'm doubtful that the content-type is related to the delay; it seems more 
 like a cosmetic issue. Still, since Chrome complains about it





  -tim

  On Jul 19, 9:54 am, Jonathan Lundell jlund...@pobox.com wrote:
  On Jul 18, 2010, at 4:10 PM, MikeEllis wrote:

  Here's the Header info from the long fetch on base.css:

  Request URL:http://192.168.253.105:8000/init/static/base.css
  Request Method:GET
  Status Code:304 Not Modified

  Request Headers
  Accept:text/css,*/*;q=0.1
  Cache-Control:max-age=0
  If-Modified-Since:Mon, 14 Jun 2010 23:30:00 GMT
  Referer:http://192.168.253.105:8000/init/editproblem/index
  User-Agent:Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-US)
  AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4

  Response Headers
  Connection:keep-alive
  Content-Type:text/html; charset=UTF-8
  Date:Sun, 18 Jul 2010 22:32:09 GMT
  Server:Rocket 1.0.5 Python/2.6.1

  Notice that this is Rocket's cached response. I think you'll see the 
  original file being served as text/css.

  By comparison, I don't see a Content-Type in Apache's response (this is 
  from Safari's debugger). Apache does include a couple of headers that 
  Rocket does not.

          • Request URL:http://web2py.com/examples/static/styles.css
          • Request Method:GET
          • Status Code:

   warningOrangeDot.png
   1KViewDownload

  304 Not Modified
          • Request Headers
                  • Accept:text/css,*/*;q=0.1
                  • Cache-Control:max-age=0
                  • If-Modified-Since:Sat, 17 Jul 2010 15:14:16 GMT
                  • If-None-Match:42f90-d44-48b96c9edc200
                  • Referer:http://web2py.com/
                  • User-Agent:Mozilla/5.0 (Macintosh; U; Intel Mac OS X 
  10_6_4; en-us) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 
  Safari/533.16
          • Response Headers
                  • Cache-Control:max-age=86400
                  • Connection:Keep-Alive
                  • Date:Mon, 19 Jul 2010 14:47:39 GMT
                  • Etag:42f90-d44-48b96c9edc200
                  • Expires:Tue, 20 Jul 2010 14:47:39 GMT
                  • Keep-Alive:timeout=2, max=15
                  • Server:Apache/2.2.8 (Ubuntu) mod_wsgi/3.2-BRANCH 
  Python/2.5.2 mod_ssl/2.2.8 OpenSSL/0.9.8g


[web2py] Re: Will rocket close connections if it takes long time?

2010-07-07 Thread Timbo
Candid and I discussed this off list.  The sum-up is this:

Iceberg, you hit the nail on the head with my position.

However, it's clear that not everyone uses this feature and it may be
more useful to others if it had a configurable thread-timeout.  I told
Candid that I'd investigate the effort it would take to add this
feature.  Stay tuned.

Whether or not Massimo thinks this feature would be good for web2py is
up to him, but even if added, it would not be the Rocket default.

-tim


On Jul 7, 9:13 am, Iceberg iceb...@21cn.com wrote:
 I have different opinion, Candid.

 As Timbo and I have discussed in this thread, rocket differentiates long 
 running requests, seeing it is caused by client side or server side. Rocket 
 only terminates long request comes from the client side, say, a very slow 
 http request from a client (possibly a DoS attack). On the contrary, on the 
 server side, it is the app (a.k.a. its developer) 's responsibility to ensure 
 most requests can be served quickly, and it is also developer's right to 
 occasionally do long time calculation whenever needed. Rocket gives developer 
 the flexibility to choose what they want. That is better than killing a 
 (long) running thread unconditionally.

 I love rocket. :-)

 Best regards,
                             Iceberg, 2010-Jul-07, 21:47(PM), Wed



 --- Original Message ---
 From:    Candid roman.bat...@gmail.com Sender: web2py@googlegroups.com
 To:      web2py-users web2py@googlegroups.com
 Date:    Wed, 7 Jul 2010 05:21:16 -0700 (PDT)
 Subject: [web2py] Re: Will rocket close connections if it takes long time?

 ---

  Thank you for clarification, Timbo.

  Is not #3 a problem though? If Rocket doesn't terminate the request if
  it's running for too long, is not Rocket's thread pool going to be
  exhausted if it runs too many long running requests? The problem here
  is that one application could potentially exhaust all working thread,
  preventing rocket from serving request for other applications. It
  looks like this is what's happening to one of my server - see this
  discussion:http://groups.google.com/group/web2py/browse_thread/thread/34f5411692...

  Am I missing something or is this how it's supposed to be?

  On Jul 5, 12:33 am, Timbo tfarr...@owassobible.org wrote:
   1) True
   2) Basically true.  You seem to indicate that 1  2 should not co-
   exist or are somehow at odds with each other.  If that's what you're
   indicating, I'm not following your logic as to why they should be
   mutually exclusive.  Can you explain a little more?
   3) In Rocket's case, no.  While a client could disconnect at anytime,
   Rocket will allow the application server to run a request as long as
   it likes.  If the client connection is still open when it's ready to
   send it's response, it will send successfully.  Rocket does not kill
   threads that run for too long.
   4) Rocket always applies the socket timeout (rocket.py line 854), this
   should override Py2.5's default (whatever it may be).  Rocket enables
   Python's socket timeout protection on every Python platform that
   supports it.

   Does this clear things up?

   On Jul 4, 4:30 am, Iceberg iceb...@21cn.com wrote:

Thanks for all these info, Tim. You said:
    The timeout ... is a timeout based on inactivity between http
requests.  So the long requests that Iceberg is seeing are perfectly
normal and acceptable.

According to my reading of the rocket-science code (and I could be
wrong), here is my understanding and questions:

    1. The timeout is a timeout based on inactivity since one request
socket's latest select-and-readable event. The time gap could be
caused by two http requests which somehow reuse the socket (because
keep-alive?), or caused by one very slow http request from a client
(possibly a DoS attack).

    2. BUT the timeout check is only performed after the request's
socket encountered socket.timeout exception. According to line 800 of
rocket.py:
        if typ == SocketTimeout:
            self.err_log.debug('Socket timed out')
            self.wait_queue.put(self.conn)
And then the request's control is transferred to the Monitor, the
timeout check is at line 449 of rocket.py:
        if now - c.start_time = self.timeout:
                        stale.add(c)

    3. What if, a normal request is read from client side within
seconds, then being calculated for quite some time on the server side,
will this situation trigger the timeout protection? I guess not,
because no socket.timeout will be raised during the calculation,
although the final calculated result will probably not be sent due to
the socket is already timeout or even closed from the client side. If
this is true (is it?), then my maintenance scenario is still doable
because no result is expected, I only need the maintenance job can

[web2py] Re: Will rocket close connections if it takes long time?

2010-07-04 Thread Timbo
1) True
2) Basically true.  You seem to indicate that 1  2 should not co-
exist or are somehow at odds with each other.  If that's what you're
indicating, I'm not following your logic as to why they should be
mutually exclusive.  Can you explain a little more?
3) In Rocket's case, no.  While a client could disconnect at anytime,
Rocket will allow the application server to run a request as long as
it likes.  If the client connection is still open when it's ready to
send it's response, it will send successfully.  Rocket does not kill
threads that run for too long.
4) Rocket always applies the socket timeout (rocket.py line 854), this
should override Py2.5's default (whatever it may be).  Rocket enables
Python's socket timeout protection on every Python platform that
supports it.

Does this clear things up?

On Jul 4, 4:30 am, Iceberg iceb...@21cn.com wrote:
 Thanks for all these info, Tim. You said:
     The timeout ... is a timeout based on inactivity between http
 requests.  So the long requests that Iceberg is seeing are perfectly
 normal and acceptable.

 According to my reading of the rocket-science code (and I could be
 wrong), here is my understanding and questions:

     1. The timeout is a timeout based on inactivity since one request
 socket's latest select-and-readable event. The time gap could be
 caused by two http requests which somehow reuse the socket (because
 keep-alive?), or caused by one very slow http request from a client
 (possibly a DoS attack).

     2. BUT the timeout check is only performed after the request's
 socket encountered socket.timeout exception. According to line 800 of
 rocket.py:
         if typ == SocketTimeout:
             self.err_log.debug('Socket timed out')
             self.wait_queue.put(self.conn)
 And then the request's control is transferred to the Monitor, the
 timeout check is at line 449 of rocket.py:
         if now - c.start_time = self.timeout:
                         stale.add(c)

     3. What if, a normal request is read from client side within
 seconds, then being calculated for quite some time on the server side,
 will this situation trigger the timeout protection? I guess not,
 because no socket.timeout will be raised during the calculation,
 although the final calculated result will probably not be sent due to
 the socket is already timeout or even closed from the client side. If
 this is true (is it?), then my maintenance scenario is still doable
 because no result is expected, I only need the maintenance job can be
 triggered and can run as long as it takes.

     4. On the other hand, at least on Windows XP, python 2.5.4, by
 default, socket has no socket.timeout, so the above check is not
 performed at all, is it? So the rocket timeout protection is not
 activated anyway.

 --
 Iceberg

 On Jul4, 9:26am, Timbo tfarr...@owassobible.org wrote:



  Rocket has a longer default wait time before it closes connections in
  comparison to CherryPy.  You might check web2py code, it is not likely
  using the same default timeout as Rocket proper.  
  See:http://packages.python.org/rocket/usage.html#timeout

  This is a DoS vulnerability on CherryPy but not Rocket because Rocket
  pushes waiting threads to a monitor queue so that they don't occupy
  worker threads.  The monitor queue can easily handle the socket limit
  of connections.  In this manner, Rocket can handle many thousands of
  connections without causing new connections to have to wait as
  CherryPy does.  There is a limit on number of active connections, but
  that limit is the number of worker threads which is 
  configurable:http://packages.python.org/rocket/usage.html#max-threads

  The timeout mentioned in the link above is a timeout based on
  inactivity between http requests.  So the long requests that Iceberg
  is seeing are perfectly normal and acceptable.

  Browsers such as Chrome and FF will leave a connection open for quite
  some time or until the tab is closed (even if the user has browsed
  away from the Rocket-running server domain).  Rocket basically wants
  to keep those connections open since they don't cost significantly to
  wait in the monitor queue.

  -tim

  On Jul 3, 9:35 am, mdipierro mdipie...@cs.depaul.edu wrote:

   Let's wait for Tim to respond. The timeout should be enforced.

   On 3 Lug, 09:07, Iceberg iceb...@21cn.com wrote:

Thanks for clarifying. And I take a glance into gluon/widget.py,
main.py and rocket.py to confirm there is some timeout=10. So from the
design aspect, I'd better avoid expecting a long-run request to finish
my app's time-consuming maintenance job.

On the other hand, I confirmed that, with latest trunk, running
Windows XP, my maintenance request did last for more than 10 seconds,
magically. Does it indicate the DoS-resistant timeout fuse somehow
fail? Do you think it is ok or unacceptable?

My maintenance job's log:
  WARNING:root:job.id=33, elapsed=18.812638 s

Another evidence

[web2py] Re: Will rocket close connections if it takes long time?

2010-07-03 Thread Timbo
Rocket has a longer default wait time before it closes connections in
comparison to CherryPy.  You might check web2py code, it is not likely
using the same default timeout as Rocket proper.  See:
http://packages.python.org/rocket/usage.html#timeout

This is a DoS vulnerability on CherryPy but not Rocket because Rocket
pushes waiting threads to a monitor queue so that they don't occupy
worker threads.  The monitor queue can easily handle the socket limit
of connections.  In this manner, Rocket can handle many thousands of
connections without causing new connections to have to wait as
CherryPy does.  There is a limit on number of active connections, but
that limit is the number of worker threads which is configurable:
http://packages.python.org/rocket/usage.html#max-threads

The timeout mentioned in the link above is a timeout based on
inactivity between http requests.  So the long requests that Iceberg
is seeing are perfectly normal and acceptable.

Browsers such as Chrome and FF will leave a connection open for quite
some time or until the tab is closed (even if the user has browsed
away from the Rocket-running server domain).  Rocket basically wants
to keep those connections open since they don't cost significantly to
wait in the monitor queue.

-tim

On Jul 3, 9:35 am, mdipierro mdipie...@cs.depaul.edu wrote:
 Let's wait for Tim to respond. The timeout should be enforced.

 On 3 Lug, 09:07, Iceberg iceb...@21cn.com wrote:



  Thanks for clarifying. And I take a glance into gluon/widget.py,
  main.py and rocket.py to confirm there is some timeout=10. So from the
  design aspect, I'd better avoid expecting a long-run request to finish
  my app's time-consuming maintenance job.

  On the other hand, I confirmed that, with latest trunk, running
  Windows XP, my maintenance request did last for more than 10 seconds,
  magically. Does it indicate the DoS-resistant timeout fuse somehow
  fail? Do you think it is ok or unacceptable?

  My maintenance job's log:
    WARNING:root:job.id=33, elapsed=18.812638 s

  Another evidence in web2py/httpserver.log
    127.0.0.1, 2010-07-03 21:49:20, GET, /myapp/default/longrun, HTTP/
  1.1, 200, 21.75

  Regard,
  Iceberg

  On Jul3, 8:31pm, mdipierro mdipie...@cs.depaul.edu wrote:

   The web server threads MUST have a timeout (the shorter the better)
   else they are vulnerable to denial of service attacks.

   On 3 Lug, 06:23, Iceberg iceb...@21cn.com wrote:

Hi Candid and everyone,

Candid mentioned rocket should close the connections if request is
taking longer than 10 seconds (default timeout) in here [1]. Would
somebody clarify, is that true?

My concern is that, one of my old app need some periodical maintenance
job which could take dozes of seconds to finish. I knew the normal
solution is run another daemon for that, but, for simplicity reasons,
I still chose to use web2py 's builtin cron feature to 
visithttp://localhost:8000/myapp/default/maintenanceeveryhour. This 
trick
worked well on my windows XP development laptop. I don't know whether
situation is changed since then.

[1]http://groups.google.com/group/web2py/msg/0416ed025f3e33f8

Regards,
Iceberg


[web2py] Re: Built-in Webserver

2010-01-09 Thread Timbo
would ?  So you don't currently run a setup where you got to choose
how it runs?

I guess readers should take your comments with a grain of salt
considering that in another thread you admit to being a young
developer with not much experience.  That's ok.  It's good to start
out conservative and get more flexible as you learn.

I'm not picking on you, just hoping to broaden your horizons a
little.  I'm running some benchmarks on Rocket.  It comes out more
concurrent than Apache even (though it cannot serve more throughput).
Rocket will eventually include a file-server as well that will be
faster than running file requests through web2py.

-tim

On Jan 8, 4:25 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 I would never use the built in server for production.

 I will stick it on a linux server, running apache to server web2py and
 nginx to serve static files.

 I'm an extremest, and will use the fastest configuration possible for
 every situation, and don't see any situation where I would use the
 built-in server for anything more than testing.

 -Thadeus

 On Fri, Jan 8, 2010 at 1:36 PM, cjrh caleb.hatti...@gmail.com wrote:
  On Jan 8, 8:46 pm, Timothy Farrell tfarr...@swgen.com wrote:
  I am still interested to know if anyone uses web2py without an external
  webserver.

  I do, on an intranet app for serving automated builds.   Very low
  concurrency (theoretical maximum of 12 simultaneous connections :).

  --
  You received this message because you are subscribed to the Google Groups 
  web2py-users group.
  To post to this group, send email to web...@googlegroups.com.
  To unsubscribe from this group, send email to 
  web2py+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/web2py?hl=en.
-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:37940] Re: Editor from browser

2009-12-28 Thread Timbo
If you build it, I will come. =)

On Dec 28, 6:34 am, Joan Miller pelok...@gmail.com wrote:
 On 27 dic, 19:50, mdipierro mdipie...@cs.depaul.edu wrote: Ideally I would 
 like to have a better web based IDE fully coded in JS.

 An IDE coded in JS? That can be a thing of the past, in a short time.

 Native CLient (NaCl) lets running native code in web applications. So
 could be used i.e. Python to build something that needs more speed
 and/or less memory in the client side, instead of to use only
 JavaScript.

 *http://code.google.com/p/nativeclient/
 *http://lackingrhoticity.blogspot.com/2009/06/python-standard-library-...
 *http://plash.beasts.org/wiki/NativeClient

--

You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:37907] Re: Editor from browser

2009-12-27 Thread Timbo
A more featureful admin app would be nIce but I support Massimo in
keeping the current one. A point of clarification, Bespin is merely an
editor.  Their goal is to eventually create an IDE but it is far from
that at present.  Other problems include no IE support and it suffers
from the same highlighting inconsistancies that plague Editarea since
it uses regexp-based parser.  It also has no highlighting support for
Python.  Bespin is interesting but it has a lot of wow-factor without
much practicality.

I'm watching bespin closely and will let the list know when it is
reasonable to consider as a replacement or complement to editarea.

- tim

On Dec 27, 1:50 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 I would like to see people build alternatives to default admin app. I
 do not think it is a good idea to replace admin because I like the
 fact that it has no dependencies, but more experienced users should be
 able to use more powerful alternatives like the one you suggest.
 Ideally I would like to have a better web based IDE fully coded in JS.

 Massimo

 On Dec 27, 7:57 am, Joan Miller pelok...@gmail.com wrote:



  Since that web2py comes with an editor in HTML/Js to develop from
  browser, this could make you smile.

  Bespin is a Mozilla's project to have a full IDE from browser; it's
  free/open source and there is a server built on python so it could be
  integrated in web2py.

  *http://ajaxian.com/archives/bespin-a-new-mozilla-labs-experimental-ex...
  *https://mozillalabs.com/bespin/

--

You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:37183] Re: Python 2.6 Errata

2009-12-14 Thread Timbo
Note to those reading.  The fix for this bug was applied and release
in 1.74.1

http://groups.google.com/group/web2py/browse_thread/thread/b33cb890cdd0a5a9

-tim

On Dec 4, 9:46 am, mdipierro mdipie...@cs.depaul.edu wrote:
 Thank you!

 On Dec 4, 9:13 am, Timbo tfarr...@swgen.com wrote:

  @Alexandre: I understand that you're trying to help.  It's much better
  to actually fix the broken code than to fix the applications.

  @Massimo:  This is very doable.  I'll prepare a patch and email it to
  you.

  On Dec 3, 5:58 pm, mdipierro mdipie...@cs.depaul.edu wrote:

   I am aware of this problem.

   This is a different behavior in the cgi.FieldStorage object in Python.

   Please look in web2py.gluon.main how post_vars is filled.

   I have thought about this a lot and I do not see any way to make this
   work in web2py in the same way in 2.5 and 2.6.

   Massimo

   On Dec 3, 1:30 pm, Timbo tfarr...@swgen.com wrote:

Thinking about it, this is a bug in web2py.

Let me be a little more concrete in my description.  I have a custom
form that submits to /app/default/entry?id=12.  In the form, there is
a hidden input tag named id with a value of 12.  Upon submission,
Python 2.5 looks like this:
request.vars.id = 12
request.get_vars.id = 12
request.post_vars.id = 12

Python 2.6 looks like this:
request.vars.id = [12, 12]
request.get_vars.id = 12
request.post_vars.id = [12, 12]

And what _should_ happen is this:
request.vars.id = [12, 12]
request.get_vars.id = 12
request.post_vars.id = 12

Am I making sense?  Massimo, is that expected behavior that we want
for web2py?

-tim

On Dec 3, 1:17 pm, Timbo tfarr...@swgen.com wrote:

 I've been trying to migrate my web2py applications to Python 2.6 and I
 ran across a nasty bug in Python 2.5 that is fixed in Py2.6, but it
 amounts to a backward-incompatibility.

 The bug fixed is:http://bugs.python.org/issue3801

 Basically this happens in a POST request where a variable is both in
 the URL and in the POST body.  It causes that variable to be a list of
 two (identical) values on Python 2.6.  In Py2.5 however, it will be a
 single value (the POST body value).

 This is not an issue with web2py at all but perhaps it should be noted
 somewhere in some documentation about Python 2.6.

 Just so you guys don't spend all the time I did trying to find this.

--

You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:36449] Python 2.6 Errata

2009-12-03 Thread Timbo
I've been trying to migrate my web2py applications to Python 2.6 and I
ran across a nasty bug in Python 2.5 that is fixed in Py2.6, but it
amounts to a backward-incompatibility.

The bug fixed is: http://bugs.python.org/issue3801

Basically this happens in a POST request where a variable is both in
the URL and in the POST body.  It causes that variable to be a list of
two (identical) values on Python 2.6.  In Py2.5 however, it will be a
single value (the POST body value).

This is not an issue with web2py at all but perhaps it should be noted
somewhere in some documentation about Python 2.6.

Just so you guys don't spend all the time I did trying to find this.

--

You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:36450] Re: Python 2.6 Errata

2009-12-03 Thread Timbo
Thinking about it, this is a bug in web2py.

Let me be a little more concrete in my description.  I have a custom
form that submits to /app/default/entry?id=12.  In the form, there is
a hidden input tag named id with a value of 12.  Upon submission,
Python 2.5 looks like this:
request.vars.id = 12
request.get_vars.id = 12
request.post_vars.id = 12

Python 2.6 looks like this:
request.vars.id = [12, 12]
request.get_vars.id = 12
request.post_vars.id = [12, 12]

And what _should_ happen is this:
request.vars.id = [12, 12]
request.get_vars.id = 12
request.post_vars.id = 12

Am I making sense?  Massimo, is that expected behavior that we want
for web2py?

-tim


On Dec 3, 1:17 pm, Timbo tfarr...@swgen.com wrote:
 I've been trying to migrate my web2py applications to Python 2.6 and I
 ran across a nasty bug in Python 2.5 that is fixed in Py2.6, but it
 amounts to a backward-incompatibility.

 The bug fixed is:http://bugs.python.org/issue3801

 Basically this happens in a POST request where a variable is both in
 the URL and in the POST body.  It causes that variable to be a list of
 two (identical) values on Python 2.6.  In Py2.5 however, it will be a
 single value (the POST body value).

 This is not an issue with web2py at all but perhaps it should be noted
 somewhere in some documentation about Python 2.6.

 Just so you guys don't spend all the time I did trying to find this.

--

You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:36217] Re: ext js

2009-11-30 Thread Timbo
ExtJS is not part of Pyjamas or GWT.  It is a very advanced and
powerful toolkit but doesn't compare well with jQuery (which is just a
library).  They serve different purposes.  jQuery is for websites
while ExtJS is for web-applications.  There is some overlap, but most
people don't need or want a layout manager or datagrid on their blog.

With regard to GWT, there is a ExtGWT which is a GWT-like
implementation of ExtJS.  Basically you do all your ExtJS programming
in Java.  There is nothing like this for Python at present.  (Pyjamas
sort of fills this niche, but it doesn't use ExtJS.)

As far as money, the company behind ExtJS is shady on licensing.  The
clear cut stuff is this:
1) If your project is under an approved Open Source License, then you
may use ExtJS for free under the GPLv3 license
2) If your project is not under an approved open source license, then
they require that you purchase a developers license
3) If 2 is true and you wish to bundle ExtJS with your product such
that the users of your product will be developers using ExtJS, they
require an OEM license.

Massimo, I'm interested to hear how things go.

-tim

On Nov 30, 9:34 am, Thadeus Burgess thade...@thadeusb.com wrote:
 ext js is nice, however their more advanced features cost money? I like
 jquery because there is a plug-in for almost everything, and its so easy to
 perform plug-in development, I was able to create a couple of jquery plugins
 and I have absolutely no javascript experience :)

 Though the money factor is the only reason I have never tried using ext
 js... and the fact that google/gmail uses jquery.

 -Thadeus

 On Mon, Nov 30, 2009 at 8:23 AM, mdipierro mdipie...@cs.depaul.edu wrote:
  I am going to a talk on Django and extjs next week. I will report
  back.

  Massimo

  On Nov 30, 6:17 am, davidjensen davidjensen...@gmail.com wrote:
   Hi everyone,

   I have seen mention many times on this group of jquery. However, ext
   js looks very powerful and there are lots of books on it. What do you
   think of ext js. Apparently, it has a connection with gwt. Is it part
   of pyjamas?

   Thanks

  --

  You received this message because you are subscribed to the Google Groups
  web2py-users group.
  To post to this group, send email to web...@googlegroups.com.
  To unsubscribe from this group, send email to
  web2py+unsubscr...@googlegroups.comweb2py%2bunsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/web2py?hl=en.

--

You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:35920] Re: Crashing on Updating to 1.72.3

2009-11-24 Thread Timbo

Did you use your options.py file from the old installation?  There
were some new options added somewhere along the line where if they are
not present in the options file, it will crash.

Unrelated to this issue, I noticed that the default value of
response.flash changed in revision 1234.  I'm sure this is fine for
those that use the default template, but it broke my templates.  I've
fixed my templates to adapt, but I thought that such default values
would fall under the heading of backward compatible.

-tim

On Nov 24, 7:30 am, yamandu yamandu.co...@gmail.com wrote:
 Before I updated to 1.72.3 it does not run.
 It goes to the ticket page and does not even open the ticket link.

 Any issue with this version?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:35921] Re: Using web2py with jython

2009-11-24 Thread Timbo

hvcst,

This is an issue that we addressed recently but I don't think there
has been a new release since this patch.

Go here and hit the Download File linke:

http://bazaar.launchpad.net/~mdipierro/web2py/devel/annotate/head%3A/gluon/template.py

Copy that file to /web2py/gluon/template.py (overwrite the old one).
See if that fixes your problem.

-tim

On Nov 24, 4:28 am, hcvst hcv...@googlemail.com wrote:
 Hi Massimo,

 I ran web2py 16.7.2 on jython2.5.1/Sun java 1.6.0_11/Win XP without a
 problem after changing nodelay to False. Now suddenly I get this
 recursion error. I haven't changed anything but then again one never
 knows what changes the admins push to one's machine in a corporate
 environment. Any idea why it should suddenly stop working? Are there
 any files generated perhaps, that could cause the problem and that I
 could delete? This comes at a bad time of course as I need to demo our
 web2py app on Friday and we use some Java for SOAP/WSDL stuff as
 SOAPpy is not up for it. Stress :-)

 Thanks,
 HC

 On 9 Nov., 21:15, mdipierro mdipie...@cs.depaul.edu wrote:

  This is clearly a Java bug. A major one. I love the won't fix

  On Nov 9, 12:33 pm, Timbo tfarr...@swgen.com wrote:

   No difference.

   I think this is the bug we're dealing with:

  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5050507

   Since it's a wont-fix, our only option is to work around it by relying
   less on regexps.  Is that an acceptable solution?

   On Nov 9, 11:58 am, mdipierro mdipie...@cs.depaul.edu wrote:

another test. in gluon/templates.py

can you replace

re_strings = re.compile(r'(?Pname'
                         + r[uU]?[rR]?'''([^']+|'{1,2}(?!'))*'''|
                         + r'([^'\\]|\\.)*'|
                         + r'([^]|{1,2}(?!))*|'
                         + r'([^\\]|\\.)*)', re.DOTALL)

with

re_strings = re.compile(r'(?Pname'
                         + r[uU]?[rR]?'''([^']|'{1,2}(?!'))*'''|
                         + r'([^'\\]|\\.)*'|
                         + r'([^]|{1,2}(?!))*|'
                         + r'([^\\]|\\.)*)', re.DOTALL)

Does it make things better?

Massimo
On Nov 9, 11:21 am, mdipierro mdipie...@cs.depaul.edu wrote:

 The first problem is because you did not upgraded admin in a while ;-)

 cd applications/admin
 tar zxvf ../../admin.w2p

 The second error. Can you help me fix it?

 Try each one of these models?

 htmlbody{{='hello world'}/body/html

 htmlbody{{='''hello world'''}/body/html

 htmlbody{{=hello world}/body/html

 htmlbody{{=hello world}/body/html

 which ones break? Any, none? Please email me privately.

 Massimo

 On Nov 9, 11:07 am, Timbo tfarr...@swgen.com wrote:

  OK so I downloaded fresh versions of both.  If put in the above
  workaroudn for the TCP_NODELAY issue.  And upon running I get:

  C:\jython2.5.1jython.bat \web2py2\web2py.py
  WARNING:root:no file locking
  WARNING:root:unable to import dbhash
  WARNING:root:GUI not available because Tk library is not installed
  unpacking apps; this may take a few seconds...
  Traceback (most recent call last):
    File \web2py2\web2py.py, line 20, in module
      gluon.widget.start(cron=True)
    File C:\web2py2\gluon\widget.py, line 726, in start
      (options, args) = console()
    File C:\web2py2\gluon\widget.py, line 699, in console
      w2p_unpack('admin.w2p', 'applications/admin/')
    File C:\web2py2\gluon\fileutils.py, line 189, in w2p_unpack
      os.unlink(tarname)
    File C:\jython2.5.1\Lib\os.py, line 342, in remove
      raise OSError(0, couldn't delete file, path)
  OSError: [Errno 0] couldn't delete file: 'admin.tar'

  So I wrapped that in a try-block. The next issue to deal with is a
  lack of sqlite (Welcome app).  That's not difficult but annoying.
  Just delete the db.py model (for now).  And that gets us to the root
  issue I can't get past with any template.  Here's the traceback for
  the Welcome app main page:

  Traceback (most recent call last):
    File C:\web2py2\gluon\main.py, line 459, in wsgibase
      serve_controller(request, response, session)
    File C:\web2py2\gluon\main.py, line 459, in wsgibase
      serve_controller(request, response, session)
    File C:\web2py2\gluon\main.py, line 206, in serve_controller
      run_view_in(response._view_environment)
    File C:\web2py2\gluon\compileapp.py, line 492, in run_view_in
      ccode = parse_template(response.view,
    File C:\web2py2\gluon\template.py, line 149, in parse_template
      return parse(text)
    File C:\web2py2\gluon\template.py, line 65, in parse
      text = replace(re_strings, text, lambda x: x.replace('\n', 
  '\\n'))
    File C:\web2py2\gluon\template.py, line 77, in replace
      for item in regex.finditer(text, i

[web2py:35082] Re: Python + C++ = Go

2009-11-11 Thread Timbo

Another language?

I don't like the syntax much.  It's Python + C# + C++.  While I
sometimes miss curly braces in python (it makes scope more clear in my
mind), I do not miss the:
- pointers
- references
- boilerplate code

On the plus side, I agree with Massimo, this makes IPC and shared
memory access (and therefore concurrency) almost mindless.  That is a
valuable thing for Google.  I just wish they would have done it in a
library for Python rather than creating another type of wheel.

-tim

On Nov 10, 9:08 pm, ionel ionelanton...@gmail.com wrote:
 Somebody interested ?http://golang.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:35016] Re: Using web2py with jython

2009-11-10 Thread Timbo

As it turns out, Java has a fair number of nasty WONT-FIX bugs.

In my above documented attempt where it couldn't delete the
file...there's a WONT-FIX bug for that:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4715154

No wonder ppl hate Java.

Massimo, are you going to re-work template.py to work around the bug?
I know that template.py is kinda touchy when it comes to backward
compatibility.  I've looked into this a little more and I'm
considering creating a Jython branch as I could really use it.
However the two bugs above might cause problems with my application
code.  I'll have to look into that.

-tim

On Nov 9, 1:15 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 This is clearly a Java bug. A major one. I love the won't fix

 On Nov 9, 12:33 pm, Timbo tfarr...@swgen.com wrote:

  No difference.

  I think this is the bug we're dealing with:

 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5050507

  Since it's a wont-fix, our only option is to work around it by relying
  less on regexps.  Is that an acceptable solution?

  On Nov 9, 11:58 am, mdipierro mdipie...@cs.depaul.edu wrote:

   another test. in gluon/templates.py

   can you replace

   re_strings = re.compile(r'(?Pname'
                            + r[uU]?[rR]?'''([^']+|'{1,2}(?!'))*'''|
                            + r'([^'\\]|\\.)*'|
                            + r'([^]|{1,2}(?!))*|'
                            + r'([^\\]|\\.)*)', re.DOTALL)

   with

   re_strings = re.compile(r'(?Pname'
                            + r[uU]?[rR]?'''([^']|'{1,2}(?!'))*'''|
                            + r'([^'\\]|\\.)*'|
                            + r'([^]|{1,2}(?!))*|'
                            + r'([^\\]|\\.)*)', re.DOTALL)

   Does it make things better?

   Massimo
   On Nov 9, 11:21 am, mdipierro mdipie...@cs.depaul.edu wrote:

The first problem is because you did not upgraded admin in a while ;-)

cd applications/admin
tar zxvf ../../admin.w2p

The second error. Can you help me fix it?

Try each one of these models?

htmlbody{{='hello world'}/body/html

htmlbody{{='''hello world'''}/body/html

htmlbody{{=hello world}/body/html

htmlbody{{=hello world}/body/html

which ones break? Any, none? Please email me privately.

Massimo

On Nov 9, 11:07 am, Timbo tfarr...@swgen.com wrote:

 OK so I downloaded fresh versions of both.  If put in the above
 workaroudn for the TCP_NODELAY issue.  And upon running I get:

 C:\jython2.5.1jython.bat \web2py2\web2py.py
 WARNING:root:no file locking
 WARNING:root:unable to import dbhash
 WARNING:root:GUI not available because Tk library is not installed
 unpacking apps; this may take a few seconds...
 Traceback (most recent call last):
   File \web2py2\web2py.py, line 20, in module
     gluon.widget.start(cron=True)
   File C:\web2py2\gluon\widget.py, line 726, in start
     (options, args) = console()
   File C:\web2py2\gluon\widget.py, line 699, in console
     w2p_unpack('admin.w2p', 'applications/admin/')
   File C:\web2py2\gluon\fileutils.py, line 189, in w2p_unpack
     os.unlink(tarname)
   File C:\jython2.5.1\Lib\os.py, line 342, in remove
     raise OSError(0, couldn't delete file, path)
 OSError: [Errno 0] couldn't delete file: 'admin.tar'

 So I wrapped that in a try-block. The next issue to deal with is a
 lack of sqlite (Welcome app).  That's not difficult but annoying.
 Just delete the db.py model (for now).  And that gets us to the root
 issue I can't get past with any template.  Here's the traceback for
 the Welcome app main page:

 Traceback (most recent call last):
   File C:\web2py2\gluon\main.py, line 459, in wsgibase
     serve_controller(request, response, session)
   File C:\web2py2\gluon\main.py, line 459, in wsgibase
     serve_controller(request, response, session)
   File C:\web2py2\gluon\main.py, line 206, in serve_controller
     run_view_in(response._view_environment)
   File C:\web2py2\gluon\compileapp.py, line 492, in run_view_in
     ccode = parse_template(response.view,
   File C:\web2py2\gluon\template.py, line 149, in parse_template
     return parse(text)
   File C:\web2py2\gluon\template.py, line 65, in parse
     text = replace(re_strings, text, lambda x: x.replace('\n', '\\n'))
   File C:\web2py2\gluon\template.py, line 77, in replace
     for item in regex.finditer(text, i):
 RuntimeError: maximum recursion depth exceeded

 This is Jython 2.5.1 fresh install, 1.71.2 fresh install with only the
 changes I've mentioned in this post.  There are no bugs for this in
 Jython as the answer has always been just increase the recursion
 depth. I've tried setting the recursion depth to something
 ridiculously high and that made no difference.

 Can anyone else confirm/deny this?  I'm testing on Windows, can we get
 a Linux user to test

[web2py:35033] Re: Accessing Web2Py services via ExtJS

2009-11-10 Thread Timbo

I've thought about it but that's it.  If you're willing to do it
yourself, here are some helpful links of some django options that
could be ported over:

http://github.com/gsancho/extdirect.django
http://code.google.com/p/django-rest-interface/

On Nov 10, 8:58 am, Don sam...@gmail.com wrote:
 Has anyone used web2py services with extjs, such as json-rpc?  If so,
 do you have example code that you can share?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:35051] Re: installing web2py on Ubuntu

2009-11-10 Thread Timbo

That's so cool...but why so many unnecessary packages?

mc, g++, emacs, ssh, build_essential, zip, unzip, openssh-server,
postfix ???

Many of these are great packages and necessary for a well-run server
(except emacs, build_essential, g++), but do they belong in a web2py
install script?

My take is don't include:
 - emacs because it furthers a religious debate
 - g++ and build_essential because the script doesn't build anything
and you don't need built tools to run web2py and build tools can be
considered bad on a production box

-tim

On Nov 9, 4:52 pm, Massimo Di Pierro mdipie...@cs.depaul.edu wrote:
 If you have sudo access to a fresh ubuntu install just run this script

 sudo setup-web2py.sh

 and it will:
 1) install a bunch of packages you need including ssh, emacs, apache2,  
 python2.5, postgresql
 2) download and start web2py on port 8123 as user www-data
 3) configure apache to prosy web2py and restarts apache
 4) go to

 http://hostname/welcome

  setup-web2py.sh
 2KViewDownload
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:35052] Re: Using web2py with jython

2009-11-10 Thread Timbo

Massimo,

I'm trying to rewrite template.py for Jython and I can't seem to
figure out what the re_strings regex is doing.  I wrote a routine for
what I thought it was doing and that puts \n all over my pages.  So
I took it out entirely and things seem OK.

What is re_strings for?

On Nov 10, 8:15 am, Timbo tfarr...@swgen.com wrote:
 As it turns out, Java has a fair number of nasty WONT-FIX bugs.

 In my above documented attempt where it couldn't delete the
 file...there's a WONT-FIX bug for that:

 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4715154

 No wonder ppl hate Java.

 Massimo, are you going to re-work template.py to work around the bug?
 I know that template.py is kinda touchy when it comes to backward
 compatibility.  I've looked into this a little more and I'm
 considering creating a Jython branch as I could really use it.
 However the two bugs above might cause problems with my application
 code.  I'll have to look into that.

 -tim

 On Nov 9, 1:15 pm, mdipierro mdipie...@cs.depaul.edu wrote:

  This is clearly a Java bug. A major one. I love the won't fix

  On Nov 9, 12:33 pm, Timbo tfarr...@swgen.com wrote:

   No difference.

   I think this is the bug we're dealing with:

  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5050507

   Since it's a wont-fix, our only option is to work around it by relying
   less on regexps.  Is that an acceptable solution?

   On Nov 9, 11:58 am, mdipierro mdipie...@cs.depaul.edu wrote:

another test. in gluon/templates.py

can you replace

re_strings = re.compile(r'(?Pname'
                         + r[uU]?[rR]?'''([^']+|'{1,2}(?!'))*'''|
                         + r'([^'\\]|\\.)*'|
                         + r'([^]|{1,2}(?!))*|'
                         + r'([^\\]|\\.)*)', re.DOTALL)

with

re_strings = re.compile(r'(?Pname'
                         + r[uU]?[rR]?'''([^']|'{1,2}(?!'))*'''|
                         + r'([^'\\]|\\.)*'|
                         + r'([^]|{1,2}(?!))*|'
                         + r'([^\\]|\\.)*)', re.DOTALL)

Does it make things better?

Massimo
On Nov 9, 11:21 am, mdipierro mdipie...@cs.depaul.edu wrote:

 The first problem is because you did not upgraded admin in a while ;-)

 cd applications/admin
 tar zxvf ../../admin.w2p

 The second error. Can you help me fix it?

 Try each one of these models?

 htmlbody{{='hello world'}/body/html

 htmlbody{{='''hello world'''}/body/html

 htmlbody{{=hello world}/body/html

 htmlbody{{=hello world}/body/html

 which ones break? Any, none? Please email me privately.

 Massimo

 On Nov 9, 11:07 am, Timbo tfarr...@swgen.com wrote:

  OK so I downloaded fresh versions of both.  If put in the above
  workaroudn for the TCP_NODELAY issue.  And upon running I get:

  C:\jython2.5.1jython.bat \web2py2\web2py.py
  WARNING:root:no file locking
  WARNING:root:unable to import dbhash
  WARNING:root:GUI not available because Tk library is not installed
  unpacking apps; this may take a few seconds...
  Traceback (most recent call last):
    File \web2py2\web2py.py, line 20, in module
      gluon.widget.start(cron=True)
    File C:\web2py2\gluon\widget.py, line 726, in start
      (options, args) = console()
    File C:\web2py2\gluon\widget.py, line 699, in console
      w2p_unpack('admin.w2p', 'applications/admin/')
    File C:\web2py2\gluon\fileutils.py, line 189, in w2p_unpack
      os.unlink(tarname)
    File C:\jython2.5.1\Lib\os.py, line 342, in remove
      raise OSError(0, couldn't delete file, path)
  OSError: [Errno 0] couldn't delete file: 'admin.tar'

  So I wrapped that in a try-block. The next issue to deal with is a
  lack of sqlite (Welcome app).  That's not difficult but annoying.
  Just delete the db.py model (for now).  And that gets us to the root
  issue I can't get past with any template.  Here's the traceback for
  the Welcome app main page:

  Traceback (most recent call last):
    File C:\web2py2\gluon\main.py, line 459, in wsgibase
      serve_controller(request, response, session)
    File C:\web2py2\gluon\main.py, line 459, in wsgibase
      serve_controller(request, response, session)
    File C:\web2py2\gluon\main.py, line 206, in serve_controller
      run_view_in(response._view_environment)
    File C:\web2py2\gluon\compileapp.py, line 492, in run_view_in
      ccode = parse_template(response.view,
    File C:\web2py2\gluon\template.py, line 149, in parse_template
      return parse(text)
    File C:\web2py2\gluon\template.py, line 65, in parse
      text = replace(re_strings, text, lambda x: x.replace('\n', 
  '\\n'))
    File C:\web2py2\gluon\template.py, line 77, in replace
      for item in regex.finditer(text, i):
  RuntimeError: maximum recursion depth exceeded

[web2py:34934] Re: Using web2py with jython

2009-11-09 Thread Timbo

Jython does support TCP_NODELAY, but it does so in the Java
fashion...that is to say only on a client socket.  The short story is
this: most platforms allow you to set socket options to server
(accepting) sockets and the accepted (client) sockets that come from
them inherit the options from the server socket.  This varies based on
platform.  Some platforms inherit all options, some just TCP_NODELAY.
Java is a little different in that it inherits none and consequently
it does not allow setting TCP_NODELAY to a server socket.

The good news is that it does support it on the client socket it just
that you have to socket.setsockopt() on the client connection after
you accept it.  This behavior is currently up for debate right now
with Jython.  See http://bugs.jython.org/issue1309

Now the blocker that I ran into with Jython + web2py is the template
module.  web2py templates rely heavily on regexps.  This is great
because it makes them fast...but Jython does something different with
cPython such that everytime I try to render a template, I get a
Recursion limit exceeded error.  Maybe Regexps are not the same in
Java as in Python (Perl).  This is one I haven't been able to track
down.

Java (and hence Jython) is great from a concurrency perspective since
it is fully multi-threaded whereas cPython has the GIL to deal with.
It would be awesome if we could find a happy marriage between web2py
templates and Jython.

-tim

On Nov 9, 3:04 am, Vasile Ermicioi elff...@gmail.com wrote:
 I have to convince someone that python is better than Java (and even can
 work with Java) -
 Jython+Web2py is my best argument :)

 On Mon, Nov 9, 2009 at 8:38 AM, mdipierro mdipie...@cs.depaul.edu wrote:

  I changed it in trunk so that it is automatic and now (again) web2py
  works with Jython out of the box. I have email the author of
  wsgiserver hoping this is fixed in the official distribution.

  On Nov 8, 1:56 pm, mdipierro mdipie...@cs.depaul.edu wrote:
   jython does not seem to support socket option no_delay. In gluon/
   wsgiserver.py replace

    nodelay = True

   with

    nodelay = False

   Massimo

   On Nov 8, 1:48 pm, Nik nitral...@googlemail.com wrote:

Hi folks,

For testing web2py with jython I have started it
by executing  jython web2py.py and got the following
error message:

==
saturn:web2py_1.71.2 nik$ jython web2py.py
WARNING:root:no file locking
WARNING:root:unable to import dbhash
WARNING:root:GUI not available because Tk library is not installed
default applications appear to be installed already
web2py Enterprise Web Framework
Created by Massimo Di Pierro, Copyright 2007-2009
Version 1.71.2 (2009-11-04 15:48:54)
Database drivers available:
Starting cron...
choose a password:
please visit:
       http://127.0.0.1:8000
use kill -SIGTERM 949 to shutdown the web2py server
Traceback (most recent call last):
  File web2py.py, line 20, in module
    gluon.widget.start(cron=True)
  File /Users/nik/work/web/web2py_1.71.2/gluon/widget.py, line 852,
in start
    server.start()
  File /Users/nik/work/web/web2py_1.71.2/gluon/widget.py, line 852,
in start
    server.start()
  File /Users/nik/work/web/web2py_1.71.2/gluon/main.py, line 710, in
start
    self.server.start()
  File /Users/nik/work/web/web2py_1.71.2/gluon/wsgiserver.py, line
1884, in start
    self.socket.listen(self.request_queue_size)
  File string, line 1, in listen
  File /Users/nik/Applications/jython2.5.1/Lib/socket.py, line 824,
in listen
    self._config()
  File /Users/nik/Applications/jython2.5.1/Lib/socket.py, line 824,
in listen
    self._config()
  File /Users/nik/Applications/jython2.5.1/Lib/socket.py, line 763,
in _config
    self.sock_impl.setsockopt(level, optname, self.pending_options
[ (level, optname) ])
  File /Users/nik/Applications/jython2.5.1/Lib/socket.py, line 282,
in setsockopt
    raise error(errno.ENOPROTOOPT, Socket option '%s' (level '%s')
not supported on socket(%s) % (_constant_to_name(option),
_constant_to_name(level), str(self.jsocket)))
socket.error: (42, Socket option 'TCP_NODELAY' (level 'IPPROTO_TCP')
not supported on socket(ServerSocket[addr=/
127.0.0.1,localport=8000]))
==

Am I missing something here?

Regards
Nik
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34956] Re: Using web2py with jython

2009-11-09 Thread Timbo

No need, it blows up for me on the admin interface.  I have no special
customizations.  I'm trying this on Sun JRE6/Jython2.5.1 on WinXP.

On Nov 9, 8:34 am, mdipierro mdipie...@cs.depaul.edu wrote:
 Can you send me the view that creates the regex problem in Jython. I
 have seen it before and I thought it was fixed.

 On Nov 9, 7:53 am, Timbo tfarr...@swgen.com wrote:

  Jython does support TCP_NODELAY, but it does so in the Java
  fashion...that is to say only on a client socket.  The short story is
  this: most platforms allow you to set socket options to server
  (accepting) sockets and the accepted (client) sockets that come from
  them inherit the options from the server socket.  This varies based on
  platform.  Some platforms inherit all options, some just TCP_NODELAY.
  Java is a little different in that it inherits none and consequently
  it does not allow setting TCP_NODELAY to a server socket.

  The good news is that it does support it on the client socket it just
  that you have to socket.setsockopt() on the client connection after
  you accept it.  This behavior is currently up for debate right now
  with Jython.  Seehttp://bugs.jython.org/issue1309

  Now the blocker that I ran into with Jython + web2py is the template
  module.  web2py templates rely heavily on regexps.  This is great
  because it makes them fast...but Jython does something different with
  cPython such that everytime I try to render a template, I get a
  Recursion limit exceeded error.  Maybe Regexps are not the same in
  Java as in Python (Perl).  This is one I haven't been able to track
  down.

  Java (and hence Jython) is great from a concurrency perspective since
  it is fully multi-threaded whereas cPython has the GIL to deal with.
  It would be awesome if we could find a happy marriage between web2py
  templates and Jython.

  -tim

  On Nov 9, 3:04 am, Vasile Ermicioi elff...@gmail.com wrote:

   I have to convince someone that python is better than Java (and even can
   work with Java) -
   Jython+Web2py is my best argument :)

   On Mon, Nov 9, 2009 at 8:38 AM, mdipierro mdipie...@cs.depaul.edu wrote:

I changed it in trunk so that it is automatic and now (again) web2py
works with Jython out of the box. I have email the author of
wsgiserver hoping this is fixed in the official distribution.

On Nov 8, 1:56 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 jython does not seem to support socket option no_delay. In gluon/
 wsgiserver.py replace

  nodelay = True

 with

  nodelay = False

 Massimo

 On Nov 8, 1:48 pm, Nik nitral...@googlemail.com wrote:

  Hi folks,

  For testing web2py with jython I have started it
  by executing  jython web2py.py and got the following
  error message:

  ==
  saturn:web2py_1.71.2 nik$ jython web2py.py
  WARNING:root:no file locking
  WARNING:root:unable to import dbhash
  WARNING:root:GUI not available because Tk library is not installed
  default applications appear to be installed already
  web2py Enterprise Web Framework
  Created by Massimo Di Pierro, Copyright 2007-2009
  Version 1.71.2 (2009-11-04 15:48:54)
  Database drivers available:
  Starting cron...
  choose a password:
  please visit:
         http://127.0.0.1:8000
  use kill -SIGTERM 949 to shutdown the web2py server
  Traceback (most recent call last):
    File web2py.py, line 20, in module
      gluon.widget.start(cron=True)
    File /Users/nik/work/web/web2py_1.71.2/gluon/widget.py, line 
  852,
  in start
      server.start()
    File /Users/nik/work/web/web2py_1.71.2/gluon/widget.py, line 
  852,
  in start
      server.start()
    File /Users/nik/work/web/web2py_1.71.2/gluon/main.py, line 710, 
  in
  start
      self.server.start()
    File /Users/nik/work/web/web2py_1.71.2/gluon/wsgiserver.py, line
  1884, in start
      self.socket.listen(self.request_queue_size)
    File string, line 1, in listen
    File /Users/nik/Applications/jython2.5.1/Lib/socket.py, line 
  824,
  in listen
      self._config()
    File /Users/nik/Applications/jython2.5.1/Lib/socket.py, line 
  824,
  in listen
      self._config()
    File /Users/nik/Applications/jython2.5.1/Lib/socket.py, line 
  763,
  in _config
      self.sock_impl.setsockopt(level, optname, self.pending_options
  [ (level, optname) ])
    File /Users/nik/Applications/jython2.5.1/Lib/socket.py, line 
  282,
  in setsockopt
      raise error(errno.ENOPROTOOPT, Socket option '%s' (level '%s')
  not supported on socket(%s) % (_constant_to_name(option),
  _constant_to_name(level), str(self.jsocket)))
  socket.error: (42, Socket option 'TCP_NODELAY' (level 
  'IPPROTO_TCP')
  not supported on socket(ServerSocket[addr

[web2py:34958] Re: flexible routes

2009-11-09 Thread Timbo

Because web2py exec()s controllers rather than importing them,
packages are not currently an option.  Whats you're reason for needing
packages?  Maybe we can help you find a better solution.

On Nov 9, 4:18 am, eggy_ markflorisso...@gmail.com wrote:
 Hello,

 I want to divide my controller logic up into packages, where the
 controller part will be 'package/subpackage/module' instead of just
 'module'. Currently, I can only use a module as the controller, and
 the corresponding view will be a directory with the module's name,
 containing a bunch of views that correspond with the request functions
 in the controller. In this case I want the view files corresponding
 with the request functions in 'module' to be located in 'applications/
 myapp/views/package/subpackage/module/'.

 regards,

 Mark
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34959] Re: web2py and keyed tables

2009-11-09 Thread Timbo

You are my hero. If you ever make your way down to Oklahoma I'll take
you out for a steak dinner or something.

On Nov 8, 8:46 am, mdipierro mdipie...@cs.depaul.edu wrote:
 Denese. You did a fanstatic job. This was needed for some time.

 On Nov 8, 7:38 am, DenesL denes1...@yahoo.ca wrote:

  A) What are they?

  Keyed tables are usually legacy tables that don't follow the
  traditional hidden 'id' field construct of web2py tables.
  Instead they define one or more fields as primary key.
  Currently web2py supports keyed tables on DB2, MS SQL, Ingres (thanks
  Chris Clark) and Informix (after pending patch, thanks Hans Murx).
  To add support for other DB engines see at the bottom of this info.

  B) How do you create keyed tables?

  Using the same define_table as before but with one difference, the
  table has a 'primarykey' attribute.

  db.define_table('kperson',
      Field('name','string'),
      primarykey=['name'],
      migrate=False # for legacy tables
  )

  db.define_table('kdog',
      Field('name','string'),
      Field('owner','reference kperson.name'),
      primarykey=['name'],
      migrate=False # for legacy tables
  )

  Notes:
  1) primarykey is a list of the field names that make up the primary
  key
  2) all primarykey fields will have NOT NULL set even if not specified
  3) references are to other keyed tables only
  4) references must use tablename.fieldname format, as shown above
  5) update_record function is not available
  6) web2py rev.1354 (or higher) has appadmin support for keyed tables.

  C) How to use keyed tables?

  They behave almost the same way, the differences are explained below.

   db.kperson.insert(name='Dave')

  {'name': 'Dave'}

  note: insert returns the primary key of the inserted record or None if
  the record was not inserted

  After some more inserts:

   print db(db.kperson.name!='').select()

  kperson.name
  Anna
  Bart
  Cody
  Dave

   db.kdog.insert(name='Rex',owner='Cody')

  {'name': 'Rex'}

   db.kdog.insert(name='Fido',owner='Anna')

  {'name': 'Fido'}

   db.kdog.insert(name='Rover',owner='Cody')

  {'name': 'Rover'}

   print db(db.kdog.name!='').select()

  kdog.name,kdog.owner
  Fido,Anna
  Rex,Cody
  Rover,Cody

   print db(db.kdog.owner=='Cody').select()

  kdog.name,kdog.owner
  Rex,Cody
  Rover,Cody

   db.kdog.insert(name='Spot',owner='Bart')

  {'name': 'Spot'}

   db(db.kdog.name=='Spot').delete()

  1

   db(db.kdog.name=='Lassie').delete()

  0

  note: successful operations return 1, 0 otherwise

   db(db.kdog.name=='Rover').update(owner='Bart')

  1

   print db(db.kdog.name!='').select()

  kdog.name,kdog.owner
  Fido,Anna
  Rex,Cody
  Rover,Bart

   print 
   db((db.kdog.owner==db.kperson.name)(db.kdog.name.like('R%'))).select()

  kdog.name,kdog.owner,kperson.name
  Rex,Cody,Cody
  Rover,Bart,Bart

  D) About compound (multiple) keys.

  Compound keys can be defined and used in regular operations by passing
  a dictionary.

  db.define_table('mperson',
    Field('name1'),
    Field('name2'),
    primarykey=['name1','name2'])

   print db.mperson.insert(name1='Bart',name2='Simpson')

  {'name2': 'Simpson', 'name1': 'Bart'}

  or the equivalent k={'name1': 'Lisa', 'name2':'Simpson'}
   print db.mperson.insert(**k)

  {'name2': 'Simpson', 'name1': 'Lisa'}

   print db(db.mperson.name1!='').select()

  mperson.name1,mperson.name2
  Bart,Simpson
  Lisa,Simpson

  But references are only to single key, for now.
  Field('x','reference mperson.name2')

  For selects you have to split the key manually.
  db((db.mperson.name1=='Bart')(db.mperson.name2=='Simpson')).select()

  E) How can I add support for DB xxx?

  Glad to hear that you want to help, we can use your expertise on xxx.
  It is not that complicated.

  Step 1:
  In gluon/sql.py look for SQL_DIALECTS.
  It is a dictionary of command translations for all supported DBs.
  Now look for the key that represent the DB you want to help adding in.
  We need two new entries in there, one with key 'reference FK' for
  field level foreign key and another key 'reference TFK' for table
  level foreign key.
  Use the entries under 'mssql' as a guide.

  Step 2:
  In the same file look for the definition of the insert function for
  keyed tables (near line 2250 in the latest trunk).
  Add your DB to the list in the if statement and add an exception using
  the ones already there as a reference.

  Step 3:
  Test, test, test...

  ** NOTE **: this is a work in progress.
  Please report any problems to the group.
  Ideas for improvement are welcome too.

  Denes.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34969] Re: Using web2py with jython

2009-11-09 Thread Timbo

OK so I downloaded fresh versions of both.  If put in the above
workaroudn for the TCP_NODELAY issue.  And upon running I get:

C:\jython2.5.1jython.bat \web2py2\web2py.py
WARNING:root:no file locking
WARNING:root:unable to import dbhash
WARNING:root:GUI not available because Tk library is not installed
unpacking apps; this may take a few seconds...
Traceback (most recent call last):
  File \web2py2\web2py.py, line 20, in module
gluon.widget.start(cron=True)
  File C:\web2py2\gluon\widget.py, line 726, in start
(options, args) = console()
  File C:\web2py2\gluon\widget.py, line 699, in console
w2p_unpack('admin.w2p', 'applications/admin/')
  File C:\web2py2\gluon\fileutils.py, line 189, in w2p_unpack
os.unlink(tarname)
  File C:\jython2.5.1\Lib\os.py, line 342, in remove
raise OSError(0, couldn't delete file, path)
OSError: [Errno 0] couldn't delete file: 'admin.tar'

So I wrapped that in a try-block. The next issue to deal with is a
lack of sqlite (Welcome app).  That's not difficult but annoying.
Just delete the db.py model (for now).  And that gets us to the root
issue I can't get past with any template.  Here's the traceback for
the Welcome app main page:

Traceback (most recent call last):
  File C:\web2py2\gluon\main.py, line 459, in wsgibase
serve_controller(request, response, session)
  File C:\web2py2\gluon\main.py, line 459, in wsgibase
serve_controller(request, response, session)
  File C:\web2py2\gluon\main.py, line 206, in serve_controller
run_view_in(response._view_environment)
  File C:\web2py2\gluon\compileapp.py, line 492, in run_view_in
ccode = parse_template(response.view,
  File C:\web2py2\gluon\template.py, line 149, in parse_template
return parse(text)
  File C:\web2py2\gluon\template.py, line 65, in parse
text = replace(re_strings, text, lambda x: x.replace('\n', '\\n'))
  File C:\web2py2\gluon\template.py, line 77, in replace
for item in regex.finditer(text, i):
RuntimeError: maximum recursion depth exceeded

This is Jython 2.5.1 fresh install, 1.71.2 fresh install with only the
changes I've mentioned in this post.  There are no bugs for this in
Jython as the answer has always been just increase the recursion
depth. I've tried setting the recursion depth to something
ridiculously high and that made no difference.

Can anyone else confirm/deny this?  I'm testing on Windows, can we get
a Linux user to test this?

-tim

On Nov 9, 10:00 am, mdipierro mdipie...@cs.depaul.edu wrote:
 I cannot reproduce this with jython2.5rc3 on mac.

 On Nov 9, 9:52 am, Timbo tfarr...@swgen.com wrote:

  No need, it blows up for me on the admin interface.  I have no special
  customizations.  I'm trying this on Sun JRE6/Jython2.5.1 on WinXP.

  On Nov 9, 8:34 am, mdipierro mdipie...@cs.depaul.edu wrote:

   Can you send me the view that creates the regex problem in Jython. I
   have seen it before and I thought it was fixed.

   On Nov 9, 7:53 am, Timbo tfarr...@swgen.com wrote:

Jython does support TCP_NODELAY, but it does so in the Java
fashion...that is to say only on a client socket.  The short story is
this: most platforms allow you to set socket options to server
(accepting) sockets and the accepted (client) sockets that come from
them inherit the options from the server socket.  This varies based on
platform.  Some platforms inherit all options, some just TCP_NODELAY.
Java is a little different in that it inherits none and consequently
it does not allow setting TCP_NODELAY to a server socket.

The good news is that it does support it on the client socket it just
that you have to socket.setsockopt() on the client connection after
you accept it.  This behavior is currently up for debate right now
with Jython.  Seehttp://bugs.jython.org/issue1309

Now the blocker that I ran into with Jython + web2py is the template
module.  web2py templates rely heavily on regexps.  This is great
because it makes them fast...but Jython does something different with
cPython such that everytime I try to render a template, I get a
Recursion limit exceeded error.  Maybe Regexps are not the same in
Java as in Python (Perl).  This is one I haven't been able to track
down.

Java (and hence Jython) is great from a concurrency perspective since
it is fully multi-threaded whereas cPython has the GIL to deal with.
It would be awesome if we could find a happy marriage between web2py
templates and Jython.

-tim

On Nov 9, 3:04 am, Vasile Ermicioi elff...@gmail.com wrote:

 I have to convince someone that python is better than Java (and even 
 can
 work with Java) -
 Jython+Web2py is my best argument :)

 On Mon, Nov 9, 2009 at 8:38 AM, mdipierro mdipie...@cs.depaul.edu 
 wrote:

  I changed it in trunk so that it is automatic and now (again) web2py
  works with Jython out of the box. I have email the author of
  wsgiserver hoping this is fixed

[web2py:34980] Re: Using web2py with jython

2009-11-09 Thread Timbo

No difference.

I think this is the bug we're dealing with:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5050507

Since it's a wont-fix, our only option is to work around it by relying
less on regexps.  Is that an acceptable solution?

On Nov 9, 11:58 am, mdipierro mdipie...@cs.depaul.edu wrote:
 another test. in gluon/templates.py

 can you replace

 re_strings = re.compile(r'(?Pname'
                          + r[uU]?[rR]?'''([^']+|'{1,2}(?!'))*'''|
                          + r'([^'\\]|\\.)*'|
                          + r'([^]|{1,2}(?!))*|'
                          + r'([^\\]|\\.)*)', re.DOTALL)

 with

 re_strings = re.compile(r'(?Pname'
                          + r[uU]?[rR]?'''([^']|'{1,2}(?!'))*'''|
                          + r'([^'\\]|\\.)*'|
                          + r'([^]|{1,2}(?!))*|'
                          + r'([^\\]|\\.)*)', re.DOTALL)

 Does it make things better?

 Massimo
 On Nov 9, 11:21 am, mdipierro mdipie...@cs.depaul.edu wrote:

  The first problem is because you did not upgraded admin in a while ;-)

  cd applications/admin
  tar zxvf ../../admin.w2p

  The second error. Can you help me fix it?

  Try each one of these models?

  htmlbody{{='hello world'}/body/html

  htmlbody{{='''hello world'''}/body/html

  htmlbody{{=hello world}/body/html

  htmlbody{{=hello world}/body/html

  which ones break? Any, none? Please email me privately.

  Massimo

  On Nov 9, 11:07 am, Timbo tfarr...@swgen.com wrote:

   OK so I downloaded fresh versions of both.  If put in the above
   workaroudn for the TCP_NODELAY issue.  And upon running I get:

   C:\jython2.5.1jython.bat \web2py2\web2py.py
   WARNING:root:no file locking
   WARNING:root:unable to import dbhash
   WARNING:root:GUI not available because Tk library is not installed
   unpacking apps; this may take a few seconds...
   Traceback (most recent call last):
     File \web2py2\web2py.py, line 20, in module
       gluon.widget.start(cron=True)
     File C:\web2py2\gluon\widget.py, line 726, in start
       (options, args) = console()
     File C:\web2py2\gluon\widget.py, line 699, in console
       w2p_unpack('admin.w2p', 'applications/admin/')
     File C:\web2py2\gluon\fileutils.py, line 189, in w2p_unpack
       os.unlink(tarname)
     File C:\jython2.5.1\Lib\os.py, line 342, in remove
       raise OSError(0, couldn't delete file, path)
   OSError: [Errno 0] couldn't delete file: 'admin.tar'

   So I wrapped that in a try-block. The next issue to deal with is a
   lack of sqlite (Welcome app).  That's not difficult but annoying.
   Just delete the db.py model (for now).  And that gets us to the root
   issue I can't get past with any template.  Here's the traceback for
   the Welcome app main page:

   Traceback (most recent call last):
     File C:\web2py2\gluon\main.py, line 459, in wsgibase
       serve_controller(request, response, session)
     File C:\web2py2\gluon\main.py, line 459, in wsgibase
       serve_controller(request, response, session)
     File C:\web2py2\gluon\main.py, line 206, in serve_controller
       run_view_in(response._view_environment)
     File C:\web2py2\gluon\compileapp.py, line 492, in run_view_in
       ccode = parse_template(response.view,
     File C:\web2py2\gluon\template.py, line 149, in parse_template
       return parse(text)
     File C:\web2py2\gluon\template.py, line 65, in parse
       text = replace(re_strings, text, lambda x: x.replace('\n', '\\n'))
     File C:\web2py2\gluon\template.py, line 77, in replace
       for item in regex.finditer(text, i):
   RuntimeError: maximum recursion depth exceeded

   This is Jython 2.5.1 fresh install, 1.71.2 fresh install with only the
   changes I've mentioned in this post.  There are no bugs for this in
   Jython as the answer has always been just increase the recursion
   depth. I've tried setting the recursion depth to something
   ridiculously high and that made no difference.

   Can anyone else confirm/deny this?  I'm testing on Windows, can we get
   a Linux user to test this?

   -tim

   On Nov 9, 10:00 am, mdipierro mdipie...@cs.depaul.edu wrote:

I cannot reproduce this with jython2.5rc3 on mac.

On Nov 9, 9:52 am, Timbo tfarr...@swgen.com wrote:

 No need, it blows up for me on the admin interface.  I have no special
 customizations.  I'm trying this on Sun JRE6/Jython2.5.1 on WinXP.

 On Nov 9, 8:34 am, mdipierro mdipie...@cs.depaul.edu wrote:

  Can you send me the view that creates the regex problem in Jython. I
  have seen it before and I thought it was fixed.

  On Nov 9, 7:53 am, Timbo tfarr...@swgen.com wrote:

   Jython does support TCP_NODELAY, but it does so in the Java
   fashion...that is to say only on a client socket.  The short 
   story is
   this: most platforms allow you to set socket options to server
   (accepting) sockets and the accepted (client) sockets that come 
   from
   them inherit the options from the server socket.  This varies

[web2py:34170] Re: web2py uglyness

2009-10-30 Thread Timbo

I like the idea and I am very much against ugliness...however:

d = local_import('a.b.c')

is way uglier in my book than:

import a.b.c as d

Asthetics aside, it does not solve the original problem very well.
The problem is not being able to do:

import c as d

when d is in apps/init/modules because sys.path is global.

A much better solution is to change local_import to be just this:

d = local_import('c')

Because you are in an app the 'a.b' part is assumed.

Also, I like the , force=True part, but call it reload instead
since that better describes what it does, otherwise, what the heck
are we forcing? is a valid question.

If you need a patch for this, let me know. I don't mind.

Just my 2c,
-tim

On Oct 30, 12:55 am, mdipierro mdipie...@cs.depaul.edu wrote:
 Something always bothered be and resulted in lots of uglyness. I
 suspected there was a way to fix it but did not know. Now I found out.

 The problem:
 ==

 when we do

     import a.b.c as d

 Python (and web2py) look in sys.path.
 If the module is in web2py/applications/yourapp/modules then
 web2py/applications/yourapp/modules  should be added to sys.path.
 This would cause a major problem if there are many web2py apps that
 have a file a/b/c.py in modules. The import would find the first one,
 not necessarily the one in the current app.
 sys.path is not thread safe. There only a global sys.path not one per
 thread.
 So far the suggested solution was not do add the app modules path to
 sys.path and instead we used to do:

 exec('import applications.%s.modules.a.b.c as d' %
 request.application) # UGLY!

 This solves the conflict between app of modules but not conflicts with
 modules that are in sys.path.
 This limits which modules can go in the app modules/ folder because
 modules that user absolute imports cannot find their dependencies.
 This does not reload modules and one is forced to user conditional
 reloads when debugging modules.

 The solution
 =

 I found and implemented a better way. With the code in trunk we can
 now do:

    d = local_import('a.b.c')

 - it is not based on exec
 - it searches in applicaitons/currentapp/modules/ before searching in
 sys.path so no conflicts ever
 - each modules/ folder acts like its own site-packages and you can put
 any third party module in there whether or not is uses relative
 imports
 - you can ask it force reloading modules at every request, great for
 debugging modules:

    d = local_import('a.b.c', force=True)

 This opens the door to better plugins implemented (partially) as
 modules.

 Please check it out and report any success/failure. If ok it will be
 in 1.70.1

 Massimo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34171] Re: Google Groups is Dead

2009-10-30 Thread Timbo

Thank you.  Yes I was referring to Google Groups, not a supposed
feature of pyForum.

-tim

On Oct 28, 5:17 pm, Richard richar...@gmail.com wrote:
 I think he was meaning that search sucks in Google Groups (not
 pyforum). Correct me if wrong.

 On Oct 29, 2:29 am, Julio ju...@techfuel.net wrote:

  - Provides working search-ability (sorry Groups still sucks hard in
  this area)

  Timbo - Can you explain what you mean by groups in pyforum (and any
  suggestions you may have that might be useful to implement)?

  (if this goes a bit off-topic, feel free to reply to me directly) -
  Thanks..

  On Oct 28, 6:09 am, Timbo tfarr...@swgen.com wrote:

   The forum option has been discussed multiple times.  Let me (once
   again) throw in my support for it.

   pyForum:
   - Provides working search-ability (sorry Groups still sucks hard in
   this area)
   - Allows one to still receive emails
   - Fills a gap for those of us who want to keep up with the community
   but don't want an email every 5 minutes.  (I'm on digest of the list
   but a forum would better fit my level of interest/involvement)
   - Having web2py use it would be dog-fooding and drive the development
   of both

   With the mailinglist, there is no good search option for those not
   using their own email client for search.  Remember the Python 3
   question?  There's a reason it pops up once every 2-3 weeks.  Because
   Google Groups search will not find anything on list after a while and
   so the question is asked again.  There's GMANE but most users don't
   know to look there and the user interface is not the most friendly.

   I vote pyForum.

   -tim

   On Oct 28, 4:07 am, salingrosso salingro...@gmail.com wrote:

I think that we could use something like mailman for the mailing list 
(but I
must say that for now I hadn't problems with google groups) and we 
should
have also a forum. I don't think that we must necessarily use a forum
software realized in web2py, not immediately at least.

2009/10/28 mdipierro mdipie...@cs.depaul.edu

 Right now the web2py google group takes negligible maintenance time.
 We have about 10 managers.

 Massimo

 On Oct 27, 11:26 pm, david bain pigeonfli...@gmail.com wrote:
  I'm not against a forum, but I don't think I'd use it much. I'm
 especially
  concerned that setting up and maintaining a forum may distract the 
  core
  developers from developing, whatever minimizes the administrative
 overhead
  of running the web2py project is good as it frees minds to focus on
  improving the code.

  On Tue, Oct 27, 2009 at 10:51 PM, JorgeRpo jorgeh...@gmail.com 
  wrote:

   I rather like a forum because it doesnt require to clog my email 
   box
   with threaded msg.

   We need a forum. We've had already discussed this.

   On Oct 27, 10:20 pm, Thadeus Burgess thade...@thadeusb.com 
   wrote:
I like the mailing list because I can access it from gmail 
easily.
 Forum
   Iw
ould have to go to yet one more site to communicate. I like 
keeping
everything in gmail if at all possible.

-Thadeus

On Tue, Oct 27, 2009 at 9:58 PM, mdipierro 
mdipie...@cs.depaul.edu
   wrote:

 All together I am happy with it.

 On Oct 27, 9:53 pm, david bain pigeonfli...@gmail.com wrote:
  I understand the spam issue with Google Groups, however I
 wouldn't
   throw
  the baby out with the bathwater. I find mailing lists to 
  be very
 valuable.

  On Tue, Oct 27, 2009 at 9:50 PM, mengu whalb...@gmail.com
 wrote:

   i think a forum would be more helpful and better.

   On Oct 28, 2:56 am, mdipierro mdipie...@cs.depaul.edu 
   wrote:
We are 10x smaller so I guess we get 10x less spam. We 
get
 about
50-100 spam emails/day. We block the emails used by 
spammers.
 We
   had
only one reported case of actual user being spoofed. 
That did
   cause
some trouble for the user.

I am not sure there are much better options.

Massimo

On Oct 27, 6:45 pm, Richard richar...@gmail.com wrote:

 Interesting article from John Resig of JQuery fame:
  http://ejohn.org/blog/google-groups-is-dead/

 Is it really this bad Massimo?

  --
  SplashStart - Professional Websites. Starting Now.
http://www.splashstart.com

  --
  SplashStart - Professional Websites. Starting Now.
http://www.splashstart.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com

[web2py:34177] Re: web2py uglyness

2009-10-30 Thread Timbo

Disregard the first part of my original post.  I've looked at your
code and you've done the logical thing.  But your original email did
not state it properly.

For the record of those reading:

If you have a module that you want to use in applications/appname/
modules, with this new addition you can:

mod_name = local_import('mod_name')

and it will pull it in as import mod_name would if applications/
appname/modules were added to sys.path.

For Massimo, I still think you should switch the force param to
reload for clarity reasons.

-tim

On Oct 30, 8:01 am, Timbo tfarr...@swgen.com wrote:
 I like the idea and I am very much against ugliness...however:

 d = local_import('a.b.c')

 is way uglier in my book than:

 import a.b.c as d

 Asthetics aside, it does not solve the original problem very well.
 The problem is not being able to do:

 import c as d

 when d is in apps/init/modules because sys.path is global.

 A much better solution is to change local_import to be just this:

 d = local_import('c')

 Because you are in an app the 'a.b' part is assumed.

 Also, I like the , force=True part, but call it reload instead
 since that better describes what it does, otherwise, what the heck
 are we forcing? is a valid question.

 If you need a patch for this, let me know. I don't mind.

 Just my 2c,
 -tim

 On Oct 30, 12:55 am, mdipierro mdipie...@cs.depaul.edu wrote:

  Something always bothered be and resulted in lots of uglyness. I
  suspected there was a way to fix it but did not know. Now I found out.

  The problem:
  ==

  when we do

      import a.b.c as d

  Python (and web2py) look in sys.path.
  If the module is in web2py/applications/yourapp/modules then
  web2py/applications/yourapp/modules  should be added to sys.path.
  This would cause a major problem if there are many web2py apps that
  have a file a/b/c.py in modules. The import would find the first one,
  not necessarily the one in the current app.
  sys.path is not thread safe. There only a global sys.path not one per
  thread.
  So far the suggested solution was not do add the app modules path to
  sys.path and instead we used to do:

  exec('import applications.%s.modules.a.b.c as d' %
  request.application) # UGLY!

  This solves the conflict between app of modules but not conflicts with
  modules that are in sys.path.
  This limits which modules can go in the app modules/ folder because
  modules that user absolute imports cannot find their dependencies.
  This does not reload modules and one is forced to user conditional
  reloads when debugging modules.

  The solution
  =

  I found and implemented a better way. With the code in trunk we can
  now do:

     d = local_import('a.b.c')

  - it is not based on exec
  - it searches in applicaitons/currentapp/modules/ before searching in
  sys.path so no conflicts ever
  - each modules/ folder acts like its own site-packages and you can put
  any third party module in there whether or not is uses relative
  imports
  - you can ask it force reloading modules at every request, great for
  debugging modules:

     d = local_import('a.b.c', force=True)

  This opens the door to better plugins implemented (partially) as
  modules.

  Please check it out and report any success/failure. If ok it will be
  in 1.70.1

  Massimo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:33912] Re: Google Groups is Dead

2009-10-28 Thread Timbo

The forum option has been discussed multiple times.  Let me (once
again) throw in my support for it.

pyForum:
- Provides working search-ability (sorry Groups still sucks hard in
this area)
- Allows one to still receive emails
- Fills a gap for those of us who want to keep up with the community
but don't want an email every 5 minutes.  (I'm on digest of the list
but a forum would better fit my level of interest/involvement)
- Having web2py use it would be dog-fooding and drive the development
of both

With the mailinglist, there is no good search option for those not
using their own email client for search.  Remember the Python 3
question?  There's a reason it pops up once every 2-3 weeks.  Because
Google Groups search will not find anything on list after a while and
so the question is asked again.  There's GMANE but most users don't
know to look there and the user interface is not the most friendly.

I vote pyForum.

-tim


On Oct 28, 4:07 am, salingrosso salingro...@gmail.com wrote:
 I think that we could use something like mailman for the mailing list (but I
 must say that for now I hadn't problems with google groups) and we should
 have also a forum. I don't think that we must necessarily use a forum
 software realized in web2py, not immediately at least.

 2009/10/28 mdipierro mdipie...@cs.depaul.edu



  Right now the web2py google group takes negligible maintenance time.
  We have about 10 managers.

  Massimo

  On Oct 27, 11:26 pm, david bain pigeonfli...@gmail.com wrote:
   I'm not against a forum, but I don't think I'd use it much. I'm
  especially
   concerned that setting up and maintaining a forum may distract the core
   developers from developing, whatever minimizes the administrative
  overhead
   of running the web2py project is good as it frees minds to focus on
   improving the code.

   On Tue, Oct 27, 2009 at 10:51 PM, JorgeRpo jorgeh...@gmail.com wrote:

I rather like a forum because it doesnt require to clog my email box
with threaded msg.

We need a forum. We've had already discussed this.

On Oct 27, 10:20 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 I like the mailing list because I can access it from gmail easily.
  Forum
Iw
 ould have to go to yet one more site to communicate. I like keeping
 everything in gmail if at all possible.

 -Thadeus

 On Tue, Oct 27, 2009 at 9:58 PM, mdipierro mdipie...@cs.depaul.edu
wrote:

  All together I am happy with it.

  On Oct 27, 9:53 pm, david bain pigeonfli...@gmail.com wrote:
   I understand the spam issue with Google Groups, however I
  wouldn't
throw
   the baby out with the bathwater. I find mailing lists to be very
  valuable.

   On Tue, Oct 27, 2009 at 9:50 PM, mengu whalb...@gmail.com
  wrote:

i think a forum would be more helpful and better.

On Oct 28, 2:56 am, mdipierro mdipie...@cs.depaul.edu wrote:
 We are 10x smaller so I guess we get 10x less spam. We get
  about
 50-100 spam emails/day. We block the emails used by spammers.
  We
had
 only one reported case of actual user being spoofed. That did
cause
 some trouble for the user.

 I am not sure there are much better options.

 Massimo

 On Oct 27, 6:45 pm, Richard richar...@gmail.com wrote:

  Interesting article from John Resig of JQuery fame:
   http://ejohn.org/blog/google-groups-is-dead/

  Is it really this bad Massimo?

   --
   SplashStart - Professional Websites. Starting Now.
 http://www.splashstart.com

   --
   SplashStart - Professional Websites. Starting Now.
 http://www.splashstart.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:33913] Re: Google Groups is Dead

2009-10-28 Thread Timbo

One more note against Google Groups.  I've been flagged as a spammer
before and got kicked off the list because my email was self-hosted
for a time.  For a week, I thought the list was dead.  Then I logged
in and saw the note.  This is the point at which I switched to digest
mode.

On Oct 28, 8:09 am, Timbo tfarr...@swgen.com wrote:
 The forum option has been discussed multiple times.  Let me (once
 again) throw in my support for it.

 pyForum:
 - Provides working search-ability (sorry Groups still sucks hard in
 this area)
 - Allows one to still receive emails
 - Fills a gap for those of us who want to keep up with the community
 but don't want an email every 5 minutes.  (I'm on digest of the list
 but a forum would better fit my level of interest/involvement)
 - Having web2py use it would be dog-fooding and drive the development
 of both

 With the mailinglist, there is no good search option for those not
 using their own email client for search.  Remember the Python 3
 question?  There's a reason it pops up once every 2-3 weeks.  Because
 Google Groups search will not find anything on list after a while and
 so the question is asked again.  There's GMANE but most users don't
 know to look there and the user interface is not the most friendly.

 I vote pyForum.

 -tim

 On Oct 28, 4:07 am, salingrosso salingro...@gmail.com wrote:

  I think that we could use something like mailman for the mailing list (but I
  must say that for now I hadn't problems with google groups) and we should
  have also a forum. I don't think that we must necessarily use a forum
  software realized in web2py, not immediately at least.

  2009/10/28 mdipierro mdipie...@cs.depaul.edu

   Right now the web2py google group takes negligible maintenance time.
   We have about 10 managers.

   Massimo

   On Oct 27, 11:26 pm, david bain pigeonfli...@gmail.com wrote:
I'm not against a forum, but I don't think I'd use it much. I'm
   especially
concerned that setting up and maintaining a forum may distract the core
developers from developing, whatever minimizes the administrative
   overhead
of running the web2py project is good as it frees minds to focus on
improving the code.

On Tue, Oct 27, 2009 at 10:51 PM, JorgeRpo jorgeh...@gmail.com wrote:

 I rather like a forum because it doesnt require to clog my email box
 with threaded msg.

 We need a forum. We've had already discussed this.

 On Oct 27, 10:20 pm, Thadeus Burgess thade...@thadeusb.com wrote:
  I like the mailing list because I can access it from gmail easily.
   Forum
 Iw
  ould have to go to yet one more site to communicate. I like keeping
  everything in gmail if at all possible.

  -Thadeus

  On Tue, Oct 27, 2009 at 9:58 PM, mdipierro mdipie...@cs.depaul.edu
 wrote:

   All together I am happy with it.

   On Oct 27, 9:53 pm, david bain pigeonfli...@gmail.com wrote:
I understand the spam issue with Google Groups, however I
   wouldn't
 throw
the baby out with the bathwater. I find mailing lists to be 
very
   valuable.

On Tue, Oct 27, 2009 at 9:50 PM, mengu whalb...@gmail.com
   wrote:

 i think a forum would be more helpful and better.

 On Oct 28, 2:56 am, mdipierro mdipie...@cs.depaul.edu wrote:
  We are 10x smaller so I guess we get 10x less spam. We get
   about
  50-100 spam emails/day. We block the emails used by 
  spammers.
   We
 had
  only one reported case of actual user being spoofed. That 
  did
 cause
  some trouble for the user.

  I am not sure there are much better options.

  Massimo

  On Oct 27, 6:45 pm, Richard richar...@gmail.com wrote:

   Interesting article from John Resig of JQuery fame:
http://ejohn.org/blog/google-groups-is-dead/

   Is it really this bad Massimo?

--
SplashStart - Professional Websites. Starting Now.
  http://www.splashstart.com

--
SplashStart - Professional Websites. Starting Now.
  http://www.splashstart.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:33856] Re: Python 3.1

2009-10-27 Thread Timbo

Just so you guys know, I'm watching Python 3.x very closely and in
some places helping it along.  Here are the things that need to happen
before Python 3.x becomes a viable web-platform (for a new project):

- The email module need to be fixed (it hasn't been rebuilt to handle
the unicode conversion)
- The cgi module depends on the email module
- Flup works but it's only experimental and not currently part of the
main trunk.  Allan Saddi just ported it as a curiosity.
- Fast Database drivers

Currently there is support for SQLite, Postgres and MySQL, but the
latter two are Python-only drivers which means they run 10x slower
than their 2.x equivalent drivers.  Here's some milestones you can
expect:

The email team has a goal of having email fixed by Python 3.2.
Once that happens, fixing the cgi module will be a cakewalk (I might
even do it).  So look for that in 3.2.1.
I don't know Allan Saddi's plans for flup, but after looking at the
code, the prefork fcgi adapter is very Unix-specific.  (Uses os.fork()
and socketpair())  The multi-threaded one should still work just fine
if you don't mind the GIL.

Stay tuned.
-tim

On Oct 26, 8:48 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 I am wrong. I remember trying this and having problems but I tried
 again with 3.1.1 and worked fine. I must have done something wrong
 before.

 Massimo

 On Oct 26, 8:30 pm, Alan Harris-Reid aharrisr...@googlemail.com
 wrote:

  Hi Massimo, thanks for the insight.

  If you think moving over to unicode is such a bad thing, why do you
  think the Python developers have decided to go down this route?
  Surely there must be advantages in the long-term?

  Alan

  On Oct 26, 11:57 pm, mdipierro mdipie...@cs.depaul.edu wrote:

   In Python 2.x you can do s.find(..), s.replace(..), etc. where s is a
   byte string. This API does not exist anymore in in Python 3.x and you
   can only do string manipulation if s a unicode string. This is very
   bad because all network protocols use bytes not unicode. The solution
   bytesunicodemanipulateunicodebytes does not work because not all
   ascii data can be represented in unicode (and at least not without a
   major performance penalty).

   Python 3.x is making more difficult to program low level network
   protocols and it moves the developer away from the OS representation
   of data.

   Massimo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:33133] Re: vim for the admin editor

2009-10-19 Thread Timbo

Yes, that's me.  I'm on the list in digest mode.  So I don't catch
every conversation.

I did contribute this Python parser to Codemirror a while ago.  It is
ok for most things.  I haven't brought it up because I'm still trying
to work through some annoyances.  Maybe this is my perfectionism
speaking.  After all, Skulpt is already using it.

I don't like how it handles indentation (note the section on strict
errors).  It should not error there but I made it error to work around
an implementation difficulty.  Also it barely handles context like the
CodeMirror Javascript parser does fully.  I've began redoing the
parser properly but I always hit an infinite loop that I can't find.
So I've kinda given up on it for now.  Every few weeks I take another
look at it and get frustrated by that same stinking infinite loop.

Aside from that...I have used Codemirror Python to edit quite a few
Python files and it doesn't suffer from the ghosting and other
weirdness that EditArea has.  I do miss code folding that I have in a
native editor, but one thing at a time.  Is Amy Editor still massively
slow?  Does it lose highlighting sync like EditArea?  I haven't used
it much.

I've kinda been holding out for Bespin.  So far Bespin is supposed to
migrate to a style of syntax highlighter that codemirror uses, but I'm
not sure if that ever happened.  If they want it to be successful, it
will be a necessity in my eyes.

If you want to put it in the admin, I have no problems.  It might be
good to get some more eyes on it since I don't know how widely it is
used.

-tim

On Oct 16, 8:41 am, mdipierro mdipie...@cs.depaul.edu wrote:
 I did not know about this project and I think the author  is the same
 Tim as this list. Tim, are you?

 Unfortunately, it does not work well for me (Firefox on Mac).

 Massimo

 On Oct 16, 6:22 am, Vasile Ermicioi elff...@gmail.com wrote:

  EditArea that is used is very annoying ... Often in copy paste operations I
  am getting unexpected results in the editor.I would propose to switch to
  CodeMirrorhttp://marijn.haverbeke.nl/codemirror/contrib/python/index.html

  On Fri, Oct 16, 2009 at 1:26 PM, Benigno bca...@albendas.com wrote:

   LoL, didnt know this project, it was a good laugh to use Vi right on
   the screen...

   I love and use Vim all the time, but my personal opinion is that not
   so many people would be delighted with the idea to start with, but
   whats more important, the people that use Vim, ussually just skip
   straight away using the editor in web2py and access the files from
   their own vim, with their own vimrc and plugins setup to their liking,
   and at the least of cases use It's all text or something similar to
   edit things in their favourite editor.

   Don't get me wrong, I'd love to have it there, its just that if I have
   to choose between someone putting their effort on this or putting it
   on say T4, I am dead on T4.

   On Oct 16, 5:34 am, Richard richar...@gmail.com wrote:
Might be a nice extension for the admin editor:
  http://gpl.internetconnection.net/vi/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:33134] Re: help with new html wysiwyg

2009-10-19 Thread Timbo

Not trying to be nit-picky, but ckeditor seems to be less buggy to
me.  When I maximize OWW, it does not properly scale vertically (FF
3.5 WinXP).  I'm not sure how well it would handle the URL()
situation.

-tim

On Oct 18, 8:55 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 I have replaced the nicEdit with openwysiwyg editor which is used by
 admin/default/htmledit.
 Mostly because it supports tables.

 Both editors have the annoying feature of escaping URLs and you cannot
 insert things like {{=URL...}} in the popups. This is because they
 assume we use it to edit html but we use it to edit a view.

 Any JS expert can help me make the escaping optional?
 The file to edit is admin/static/openwysiwyg/scrips/wysiwyg.js

 Massimo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:32953] Re: FYI: Ext JS Designer Preview

2009-10-15 Thread Timbo

Negative.  jQuery-UI does not (yet) have an IDE.

There are two main types of Javascript libraries:
- Help enhance a designed page (jQuery, Prototype+Scriptaculous,
Mootools, Dojo, ExtCore) - Generally these are used to AJAX goodness
to an already pretty page
- Help build a web application (YUI, ExtJS, Dojo+Dijit) - Generally
these are used to make an attractive Desktop-like application in a web-
browser

jQuery-UI is trying to move jQuery from the first category to the
second category or allow it to be flexible enough to be in both (kinda
like how ExtCore is in the first and ExtJS is in the second).
Frankly, they've done some awesome work with the themeroller, but
until they have a solid layout system, having an IDE is impractical/
impossible.  Since ExtJS designer will not be released for free, I
would love to see a free version for any library.

-tim

On Oct 14, 7:19 pm, Richard richar...@gmail.com wrote:
 does jquery ui have an IDE for drag and drop? That's what I'm after.

 On Oct 14, 1:15 pm, Thadeus Burgess thade...@thadeusb.com wrote:

  I would say query ui would be the closest thing as of right now.

  -Thadeus

  On Tue, Oct 13, 2009 at 6:29 PM, Richard richar...@gmail.com wrote:

   very promising. Looks like it has been inspired by Qt Designer.

   Is there anything equivalent for JQuery?

   Richard

   On Oct 14, 4:31 am, mikech mp.ch...@gmail.com wrote:
Looks interesting:
  http://www.extjs.com/blog/2009/10/08/ext-js-designer-preview/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:31256] Re: help with web server

2009-09-18 Thread Timbo

IMHO, concurrency is more important than raw speed.  In the world of
AJAX, we have smaller, more-frequent requests.

Thanks for this.

On Sep 18, 7:50 am, mdipierro mdipie...@cs.depaul.edu wrote:
 This is a complete rewrite of wsgiserver. All functions are different.
 This is trivial to port to Python 3 and/or lightweight Stackless
 python threads (althought the pros/cons are not quite clear to me).

 I am also thinking about rewriting the accepting mechanism to include
 some of the features of asynchronous servers.

 Massimo

 On Sep 18, 7:44 am, Timbo tfarr...@swgen.com wrote:

  Line 215:
              self.socket=ssl_interface(self.socket)

  should be:
              self.socket=self.ssl_interface(self.socket)

  I presume.

  What version of wsgiserver are you basing this off of?  I remember
  that a previous version of wsgiserver was using deprecated socket APIs
  and could not be easily ported to Python3.  Do you know if yours is
  Python3 compatible?

  Thanks,
  -tim

  On Sep 17, 11:38 pm, Graham Dumpleton graham.dumple...@gmail.com
  wrote:

   On Sep 18, 2:04 pm, mdipierro mdipie...@cs.depaul.edu wrote:

Here are some hello world benchmarks not using web2py by the
barebone wsgi hello world:

benchmark web2pySWGIServer


massimo-di-pierros-macbook:gluon mdipierro$ ab -n 
1http://127.0.0.1:8002/
Concurrency Level:      1
Time taken for tests:   5.609 seconds
Complete requests:      1
Failed requests:        0
Write errors:           0
Total transferred:      128 bytes
HTML transferred:       13 bytes
Requests per second:    1782.88 [#/sec] (mean)
Time per request:       0.561 [ms] (mean)
Time per request:       0.561 [ms] (mean, across all concurrent
requests)
Transfer rate:          222.86 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       2
Processing:     0    0   0.1      0       2
Waiting:        0    0   0.1      0       2
Total:          0    1   0.1      0       3
Percentage of the requests served within a certain time (ms)
  50%      0
  66%      1
  75%      1
  80%      1
  90%      1
  95%      1
  98%      1
  99%      1
 100%      3 (longest request)

benchmark Cherrypy


massimo-di-pierros-macbook:gluon mdipierro$ ab -n 
1http://127.0.0.1:8002/
Concurrency Level:      1
Time taken for tests:   7.247 seconds
Complete requests:      1
Failed requests:        0
Write errors:           0
Total transferred:      135 bytes
HTML transferred:       13 bytes
Requests per second:    1379.87 [#/sec] (mean)
Time per request:       0.725 [ms] (mean)
Time per request:       0.725 [ms] (mean, across all concurrent
requests)
Transfer rate:          181.92 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       1
Processing:     0    1   0.1      1       3
Waiting:        0    0   0.1      0       3
Total:          1    1   0.1      1       3

Percentage of the requests served within a certain time (ms)
  50%      1
  66%      1
  75%      1
  80%      1
  90%      1
  95%      1
  98%      1
  99%      1
 100%      3 (longest request)

   For reference, care to provide results for static file on Apache on
   same system, as well as WSGI hello world program under Apache/
   mod_wsgi. Will be interesting to see the comparison. I have latest 13
   inch MacBook pro and am running 64 bit Apache/Python under Snow
   Leopard, so may not be comparable to your MacBook, but I get results
   below.

   BTW, in the past, don't know how things are now, I have found
   performance of CherryPy WSGI server to not be as good on MacOS X
   compared to Apache/mod_wsgi as it is on Linux systems. On Linux the
   results were quite close, but on MacOS X the CherryPy WSGI server
   lagged somewhat. That was with a much older version of CherryPy WSGI
   server and also when running Tiger/Leopard. Using MacOS X as your test
   platform may not be the best idea.

   For static file:

   Server Software:        Apache/2.2.11
   Server Hostname:        tests.example.com
   Server Port:            80

   Document Path:          /hello.txt
   Document Length:        13 bytes

   Concurrency Level:      1
   Time taken for tests:   2.373 seconds
   Complete requests:      1
   Failed requests:        0
   Write errors:           0
   Total transferred:      334 bytes
   HTML transferred:       13 bytes
   Requests per second:    4213.62 [#/sec] (mean)
   Time per request:       0.237 [ms] (mean)
   Time per request:       0.237 [ms] (mean, across all concurrent
   requests)
   Transfer rate:          1374.36 [Kbytes/sec] received

[web2py:30727] Re: Any comments on Tornado Server?

2009-09-11 Thread Timbo

According to the Performance section of their documentation, they
recommend running one instance of Tornado per processor core on your
server and then joining them together behind a nginx reverse proxy.
Looking at the graph, this makes the top bar an apples to oranges
comparison with the rest of the servers compared.  We call that
propaganda.

So basically it's ~33% faster than Apache/mod_wsgi.  That's not a big
deal.  Everyone knows that Apache is the work-horse, not the race-
horse.

Also note that the CherryPy numbers are for full CherryPy, just simply
the wsgiserver that web2py uses.

It's great that facebook has found a setup that works for them.  But
it's probably a bad setup (i.e. overly complicated) for the average
web2py user.  One of web2py's virtues is easy.

Not everything that sparkles is gold.  =)

-tim

On Sep 11, 8:28 am, mdipierro mdipie...@cs.depaul.edu wrote:
 There are two things that do not convince me.

 - For a complex web app the time of the web server is negligible over
 the time to perform SQL queries. I guess those tests were for a
 minimal hello world app.

 - If I understand this (and please correct me) Tornado is not
 multithreaded. It is a well not fact that non-multithreaded servers
 are faster but they not always the best choice for the job. In
 particular they delay all other connection when a connection take long
 time to process.

 Massimo

 On Sep 11, 7:36 am, Sebastian E. Ovide sebastianov...@gmail.com
 wrote:

  according to that benchmark CherryPy is far the slowest...

  what about web2py (apache/mod_wsgi)

  would be nice if we can place it before Django (apache/mod_wsgi)

  On Fri, Sep 11, 2009 at 12:56 PM, JorgeR jorgeh...@gmail.com wrote:

   do you mean cherrypy vs tornado?

   On Sep 11, 3:48 am, Sebastian E. Ovide sebastianov...@gmail.com
   wrote:
waw accordingly tohttp://
  www.tornadoweb.org/documentation#performanceitperformesvery
well

do we have any numbers about web2py to compare to them ?

On Fri, Sep 11, 2009 at 2:09 AM, Joe Barnhart joe.barnh...@gmail.com
wrote:

 Looks kinda like Twisted to me, but without the generality of other
 protocols.  But it supports epoll on Linux (and Mac?).  It *can*
   support
 WSGI but you lose the cool asynchronous stuff so why do it?

 In short, it sounds like an excellent solution for someone else's
   problem!

 -- Joe B.

 On Thu, Sep 10, 2009 at 5:48 PM, Anand Vaidya 
   anandvaidya...@gmail.com
 wrote:

 Facebook has released Tornado Serverhttp://www.tornadoweb.org/

 Any comments?

 Regards
 Anand

 Tornado is an open source version of the scalable, non-blocking web
 server and tools that power FriendFeed. The FriendFeed application is
 written using a web framework that looks a bit like web.py or 
 Google's
 webapp, but with additional tools and optimizations to take advantage
 of the underlying non-blocking infrastructure.

 The framework is distinct from most mainstream web server frameworks
 (and certainly most Python frameworks) because it is non-blocking and
 reasonably fast. Because it is non-blocking and uses epoll, it can
 handle thousands of simultaneous standing connections, which means it
 is ideal for real-time web services. We built the web server
 specifically to handle FriendFeed's real-time features — every active
 user of FriendFeed maintains an open connection to the FriendFeed
 servers. (For more information on scaling servers to support 
 thousands
 of clients, see The C10K problem.)

--

Sent from Dublin, Ireland

  --

  Sent from Dublin, Ireland
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:30407] Re: database is locked

2009-09-08 Thread Timbo

Windows - source build  previous version was 1.46 I think.  I use
sqlite for everything (that the DAL talks to anyway) but since these
errors run in tandem, It seems that this may be how sessions are
implemented.  It's a little weird because I'm not using database-based
sessions but rather file-based sessions.

This only happens in my production environment.  I'm not about to
checkout trunk and run it as production but as I said, I have made the
predescribed change to my production code.  I'll let you know if I
still have issues.

-tim

On Sep 8, 9:22 am, mdipierro mdipie...@cs.depaul.edu wrote:
 windows, mac, linux. Can you reproduce this error with trunk?

 On Sep 8, 9:13 am, mdipierro mdipie...@cs.depaul.edu wrote:

  The change you suggest is already in trunk.

  About the first error. Which database are you using? Which is the
  previous version you were using?

  On Sep 8, 9:08 am, Timbo tfarr...@swgen.com wrote:

   Since upgrading to the new version, I'm getting this error about once
   daily:

   Traceback (most recent call last):
     File C:\web2py\gluon\main.py, line 405, in wsgibase
       SQLDB.close_all_instances(SQLDB.commit)
     File C:\web2py\gluon\sql.py, line 594, in close_all_instances
       action(instance)
     File C:\web2py\gluon\sql.py, line 1020, in commit
       self._connection.commit()
   OperationalError: database is locked

   Getting this results in an unpleasant experience for my users I'm
   sure.  I think this is for sessions which I use to set stuff on login
   and never change until they logout.  Also this error seems to run in
   tandem with:

   Traceback (most recent call last):
     File C:\web2py\gluon\main.py, line 412, in wsgibase
       session._try_store_on_disk(request, response)
     File C:\web2py\gluon\globals.py, line 366, in _try_store_on_disk
       self._unlock(response)
     File C:\web2py\gluon\globals.py, line 374, in _unlock
       response.session_file.close()
   IOError: [Errno 13] Permission denied

   If you look at globals.unlock(), it looks like this:

       def _unlock(self, response):
           if response and response.session_file:
               try:
                   portalocker.unlock(response.session_file)
               except ValueError:
                   pass
               response.session_file.close()
               del response.session_file

   Why do we allow the lock release to fail but still try to close the
   file?  Is this related?  In the meantime, I'm just going to move the
   last two lines into the try block.

   Thanks,
     -tim
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:30398] database is locked

2009-09-08 Thread Timbo

Since upgrading to the new version, I'm getting this error about once
daily:

Traceback (most recent call last):
  File C:\web2py\gluon\main.py, line 405, in wsgibase
SQLDB.close_all_instances(SQLDB.commit)
  File C:\web2py\gluon\sql.py, line 594, in close_all_instances
action(instance)
  File C:\web2py\gluon\sql.py, line 1020, in commit
self._connection.commit()
OperationalError: database is locked

Getting this results in an unpleasant experience for my users I'm
sure.  I think this is for sessions which I use to set stuff on login
and never change until they logout.  Also this error seems to run in
tandem with:

Traceback (most recent call last):
  File C:\web2py\gluon\main.py, line 412, in wsgibase
session._try_store_on_disk(request, response)
  File C:\web2py\gluon\globals.py, line 366, in _try_store_on_disk
self._unlock(response)
  File C:\web2py\gluon\globals.py, line 374, in _unlock
response.session_file.close()
IOError: [Errno 13] Permission denied

If you look at globals.unlock(), it looks like this:

def _unlock(self, response):
if response and response.session_file:
try:
portalocker.unlock(response.session_file)
except ValueError:
pass
response.session_file.close()
del response.session_file

Why do we allow the lock release to fail but still try to close the
file?  Is this related?  In the meantime, I'm just going to move the
last two lines into the try block.

Thanks,
  -tim
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29866] Re: YAL - yet another logo

2009-09-02 Thread Timbo

+1

Let's stick with what we got.  It's simple, elegant, modern and
recognizable.

On Sep 2, 6:54 am, desfrenes desfre...@gmail.com wrote:
 I don't like. Idea is good, realisation is bad.

 On 2 sep, 13:46, weheh richard_gor...@verizon.net wrote:

  Ahhh ... the mythic board presentation to the hard-nosed businessmen.
  No women in the board, of course. And everyone has ophidiophobia,
  too.

  Well, think about cute animals in logos. Think about Twitter's logo.
  Or about the famous pets.com handpuppet spokesanimal of the dot.com
  bubble. Think about Geiko's lizard logo. or GNU. Or Linux. Or Bacardi
  or Batman bats. Or Camel cigarettes (no, don't think about them). Or
  how about Ferrari (yes, think about them)! Lacoste. Lamborghini.
  Playboy. Qantas. Red Bull. Saab ... animal logos all. All accepted by
  the mythic hard-nosed businessmen.

  Anyway, this is about capturing the python community first. It's about
  winning apps, first. Right now, web2py is a bottom-up grass-roots
  movement. That can work very well if you really speak to the grass
  roots. A corporate web2py logo would try to speak to the late majority
  IT professional who doesn't want to make a mistake and lose his job,
  and who's unlikely to change frameworks unless he gets a bunch of
  python bigots to beat him about the head and shoulders.

  pythonistas -- Go for the snake. The snake is your friend. ;^)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29814] Missing sorttable.js

2009-09-01 Thread Timbo

I just updated web2py from an (several months-) older version.  My
error-handling page broke but that's no big deal because I was using
unpublished APIs.  I also noticed that the admin interface references
sorttable.js, but it does not include this file.  I get 404 messages.

Is this missing or did someone forget to remove the link to it?  This
file in question is: admin\views\default\errors.html

Thanks,
-tim
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28901] Re: test on IBM AS/400 iSeries System i

2009-08-18 Thread Timbo

Thanks for the brief how-to.  Seems like everything is complicated on
OS400. I didn't have as much success.  My first run stopped at:

$ /QOpenSys/download/INSTALLDIR/bin/python
web2py.py
Traceback (most recent call
last):
  File web2py.py, line 17, in
module
import
gluon.widget
  File /QOpenSys/web2py/gluon/widget.py, line 50, in
module
logging.warn('GUI not available because Tk library is not
installed')
  File /QOpenSys/download/INSTALLDIR/lib/python2.6/logging/
__init__.py, line 1441, in warning
root.warning(*((msg,)+args),
**kwargs)
  File /QOpenSys/download/INSTALLDIR/lib/python2.6/logging/
__init__.py, line 1042, in warning
self._log(WARNING, msg, args,
**kwargs)
  File /QOpenSys/download/INSTALLDIR/lib/python2.6/logging/
__init__.py, line 1142, in _log
record = self.makeRecord(self.name, level, fn, lno, msg, args,
exc_info, func, extra)
  File /QOpenSys/download/INSTALLDIR/lib/python2.6/logging/
__init__.py, line 1117, in makeRecord
rv = LogRecord(name, level, fn, lno, msg, args, exc_info,
func)
  File /QOpenSys/download/INSTALLDIR/lib/python2.6/logging/
__init__.py, line 272, in __init__
from multiprocessing import
current_process
  File /QOpenSys/download/INSTALLDIR/lib/python2.6/multiprocessing/
__init__.py, line 63, in module
from multiprocessing.process import Process, current_process,
active_children
  File /QOpenSys/download/INSTALLDIR/lib/python2.6/multiprocessing/
process.py, line 285, in module
_current_process = _MainProcess
()
  File /QOpenSys/download/INSTALLDIR/lib/python2.6/multiprocessing/
process.py, line 282, in __init__
self._authkey = AuthenticationString(os.urandom
(32))
  File /QOpenSys/download/INSTALLDIR/lib/python2.6/os.py, line 755,
in urandom
raise NotImplementedError(/dev/urandom (or equivalent) not
found)
NotImplementedError: /dev/urandom (or equivalent) not
found

I don't have a /dev/urandom on this platform and I can't disable
logging (it's too integral I think).  You must have a more complete
PASE setup than I.

-tim

On Aug 17, 3:35 pm, DenesL denes1...@yahoo.ca wrote:
 On Aug 14, 4:12 pm, Timbo tfarr...@swgen.com wrote:

  This is really cool!  Good Job!

  Perhaps you can get around 1 by having Apache handle the encryption
  and 2 by not using cron?

 I believe IBM's version of Apache server does not handle wsgi but I
 might be wrong.
 That would mean installing Apache on PASE also.
 I am trying to find the cause of the warning message and see if I can
 fix it.



  I can't wait for the how-to.  I'd love to have this working on our
  AS400.

 Check your swgen email.



  -tim
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28618] Re: logo

2009-08-14 Thread Timbo

I think you're missing all the over-whelming votes for A.  The mix
that you propose looks lop-sided (what to do with that big, black
space).  I too like A the best with the sans-serif font.

If you have space to fill in a new website design, then your better
bet is to add some detail to the A logo that we already like and
enlarge it to fill the space.  Adding detail could be any combination
of:

- drop shadow
- 3D form
- add a bezel to the shape
- give the guy in the middle a tie (with two dots for eyes that could
make a snake)
- make the white background transparent
- add texture to the dudes (grid, stipples, lines)

I'm just naming some options.  The point is that with you have the
true logo (A) in a cool, grabs-your-attention way but it doesn't undo
the usefulness of the basic icon that it could be without all that
added stuff.

-tim

On Aug 14, 7:40 am, Massimo Di Pierro mdipie...@cs.depaul.edu wrote:
 What about this compromise (assuming the two authors agree)?

 Massimo

  logo.tiff
 385KViewDownload
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28655] Re: test on IBM AS/400 iSeries System i

2009-08-14 Thread Timbo

This is really cool!  Good Job!

Perhaps you can get around 1 by having Apache handle the encryption
and 2 by not using cron?

I can't wait for the how-to.  I'd love to have this working on our
AS400.

-tim

On Aug 14, 2:50 pm, DenesL denes1...@yahoo.ca wrote:
 Two issues:

 1) I created the key and certificate files for SSL but when I start
 web2py with them I get:
 WARNING:root:OpenSSL libraries unavailable. SSL is OFF

 openssl is installed.

 2) Even without any clients this is showing up in the console
 periodically (but not often):

 Exception in thread Thread-12:
 Traceback (most recent call last):
   File /QOpenSys/download/INSTALLDIR/lib/python2.5/threading.py,
 line 488, in __bootstrap_inner
     self.run()
   File /QOpenSys/web2py/gluon/contrib/cron.py, line 249, in run
     shell=self.shell
   File /QOpenSys/download/INSTALLDIR/lib/python2.5/subprocess.py,
 line 594, in __init__
     errread, errwrite)
   File /QOpenSys/download/INSTALLDIR/lib/python2.5/subprocess.py,
 line 1097, in _execute_child
     raise child_exception
 OSError: [Errno 13] Permission denied

 It does not seem to affect but I have not done much testing.

 Denes.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28355] Re: viability test on IBM AS/400 i5 iSeries ...

2009-08-11 Thread Timbo

I haven't recently.  It's likely that the one you downloaded is not
the one I tried.

Have you tried unzipping it on a PC?  Does it give the same error?

On Aug 10, 1:53 pm, DenesL denes1...@yahoo.ca wrote:
 Thanks, but when I try to unpack ActivePython-2.5.4.4-aix5-
 powerpc.tar.gz I get:
 tar: 0511-169 A directory checksum error on media; 1249928580 not
 equal to 41132

 Which one did you try?.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28296] Re: viability test on IBM AS/400 i5 iSeries ...

2009-08-10 Thread Timbo

I tried to get a PASE version running a while ago with no luck.  But I
am not adept at AS400 use.  You could try ActivePython's distribution:

http://www.activestate.com/activepython/downloads

Let me know how it goes.  I would love to be able to move some of my
apps over to our AS400 for nothing other than redundancy.

-tim

On Aug 9, 5:56 am, mdipierro mdipie...@cs.depaul.edu wrote:
 The reason I asked is that you said it does not support threads. I
 guess it does not support threads under python. In this case you
 should be able to run it in cgi mode (not recommended but worth trying
 to see if there are other issues).

 Massimo

 On Aug 9, 5:13 am, DenesL denes1...@yahoo.ca wrote:

  In theory any open source web server that can be compiled on AIX
  (IBM's Unix).
  There are some Apache 2 packages available on the net, 
  e.g.http://www.softpanorama.org/Commercial_unixes/AIX/OSS/compiling_apach...
  IBM's own version of Apache has some enhancements for the AS400
  platform but it is closed source.

  On Aug 9, 2:59 am, mdipierro mdipie...@cs.depaul.edu wrote:

   Is there any open source web server that runs on AS400?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28307] Re: viability test on IBM AS/400 i5 iSeries ...

2009-08-10 Thread Timbo

The link I included has an AIX 5.x version of Python which I used at a
former employer.  It works very well on AIX, I just had trouble with
AS400 PASE.  What I'm saying is, I was an AS400 noob at the time and
so I could hardly tell the difference between PASE and OS400.  It
might still be a viable option though I haven't tried it lately.

-tim

On Aug 10, 9:02 am, DenesL denes1...@yahoo.ca wrote:
 Well that is the thing Tim, this is more of an AIX issue than an AS400
 one.
 My expertise is on AS400 not AIX. Plus PASE is just a run time
 environment, it is not full AIX.

 So unless I can get a precompiled version of Python 2.5 (or 2.6) for
 AIX5.2 PowerPC (maybe even AIX5.1), or a compiled hashlib to re-test
 2.4 (and see if nothing else fails) then I am pretty much stuck.

 Denes.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28088] Re: Fwd: My thoughts on web2py

2009-08-06 Thread Timbo

It's been a while since I've been around but this seems to be an
important discussion that I'd like to weigh in on.

Massimo is right.  Most of Armin's critiques are thought-out design
decisions.  The perceived problems from just looking at the code don't
play out in reality due to being either a non-issue handled by some
other mechanism.

The issue of open file-handles is partly an issue and partly Armin
showing his ignorance of WSGI.  Any iterator passed back to a WSGI
server will be closed if it has a close methods and will be
appropriately deleted.  For all the other instances, yes, we should
close them.

I'm not going to weigh in on the ORM since I currently do not use it
(however, this might change with the new ORM coming out).

Fact is, I've used web2py for production purposes for more than a year
now and the only issues I've had with my setup were either my own code
or issues with python's broken socket library (which the included
wsgiserver uses).

As for the future of Python...I see cPython becoming what the vanilla
Linux kernel is today.  That is to say, it's sort of the base-line,
but no distribution uses just the vanilla kernel, but they all add
their own patches and customizations.  Pypy will likely bypass both
cPython and Jython in performance and flexibility within the next 2
years and popularity in the following 5.  Python developers will refer
to cPython more than end-users will actually use it.  Google will keep
using it since they're investing in Unladen-Swallow, but independent
projects will gear more towards Pypy compatibility due to it's
platform flexibility, speed and scalability.

That being said, Python 3.x will not be adopted as quickly as some
would hope.  Py3 support is barely on the radar for Pypy and Jython.
Frankly, even at Python3.1 it's still horribly broken for web-
development.  The Cherrypy and Werkzeug devs are building their own
versions of the cgi library.

Eventually, web2py will need to have some implementation on Python3,
but I don't see that as needed for at least 2 more years.  Python2 is
still going very strong.  It will be more than 2 years before Google
migrates.  They will likely be the driving force behind moving beyond
Py2.

Just my 2c

-tim
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20889] Re: zk-Direct

2009-04-30 Thread Timbo

Take a look at ExtJS or Smartclient.  They have many of the same
capabilities but are Javascript based rather than Java based.  Most
experienced web-devs will tell you, just learn Javascript, it's not
that hard, and you'll be glad you did.  Most studies show that the
speed gains of GWT-style (that is AJAX where the J doesn't stand for
Javascript) programming are offset by the corner-cases that the
toolkit in question doesn't handle well.

A good resource to start learning Javascript is:  http://eloquentjavascript.net/

-tim

On Apr 29, 11:30 pm, Jason Brower encomp...@gmail.com wrote:
 I haven't looked at the site.(On a train.)  Nor have I ever heard of
 them.  But the design of a site, pictures, borders, content style,
 etc... of just about any site can be done in web2py.  It's all a matter
 of the effort, and talent, that you throw into it.  I for one, am no
 designer, so when looking for a site design I look at what features I
 would like to implement and how they should be implemented.  Then I make
 a paper prototype of the site that I give to my designer.  (If you want
 his name he can work for you too. :D) He then produces a color scheme
 and design that I have imagined my site being.
 Then you take that design and chop it up into an html production.  You
 can subcontract this too if you like.  The last steps are to take the
 html and chop it up too.
 What parts of the design need to be static, what parts are dynamic and
 changing.  From this information you can begin building the views for
 your site.  You may want at this point to create some skeleton methods
 or data to fill the site with.  At this point is where this list can
 best help you.  We can help you figure out how to make the site dynamic
 and interactive with the user.
 Have you made an HTML website before?
 BR-
 Jason Brower

 On Wed, 2009-04-29 at 15:00 -0700, mikech wrote:
  Hi: I'm still in the learning process with Web2py and Python for that
  matter.  And while its really too soon for me to consider the ui
  design aspect of my projects I've been looking around at what's
  available.  YUI, pyjamas and others all look interesting but I'm
  really impressed with the appearance of zk-direct 
  zk-directhttp://zkoss.org/.
  According to the website there is some ability to use Python, but I'm
  unable to tell because of my beginner status whether it could be used
  with web2py.  Has anyone looked at this, any ideas?

  Mike

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:10089] Re: Dispatcher

2008-10-11 Thread Timbo

The only part about what you said that I don't think I get is:

---
Ideally all of the processing of routes.py should be done in a
separate WSGI plugin module since there is no need to modify web2py to
implement this functionality. It would be sufficient to look for
web2py_error in the HTTP response header.
---

From reading PEP 333, and seeing how Pylons implements error handling,
what I think you mean is just to beef-up rewrite.py such that instead
of rewrite() returning lambdas, it would return a full error handler.
The part that confused me is when you said there would be no need to
modify web2py...in that context, what is web2py?  Is rewrite (or the
WSGIServer) part of web2py?

-tim

On Oct 10, 5:22 pm, mdipierro [EMAIL PROTECTED] wrote:
 Right now there are various types of errors:

 - URL does not pass validation
 - Invalid controller
 - Invalid action
 - Invalid static file

 They all raise HTTP(400,message,web2py_error=) and if

 - A ticket is being issues

 It raises HTTP(200) but the page shows the ticket number.

 The value of web2py_error is added as a parameter of the HTTP response
 header and it was intended as a mechanism to allow SWGI filtering and
 rewriting of these error messages but not used.

 I would like to extend routes so that it  has a new item in it
 (optional) that says something like

 onerror=(
  ('myapp:name','200:/myapp/static/error400.html')
  ('name','200:/examples/static/error400.html')
 )

 where name is the name of error message (we2py_error). 'myapp:' means
 this rule only applies to myapp (assuming web2py validates the URL and
 can determine the app name.

 If the event name happens, web2py will redirect or serve instead

      /myapp/static/error400.html?ticket=url=/past/url

 with HTTP 200 status.

 Ideally all of the processing of routes.py should be done in a
 separate WSGI plugin module since there is no need to modify web2py to
 implement this functionality. It would be sufficient to look for
 web2py_error in the HTTP response header.

 Hope I am making sense. I find this a simple and powerful solution.

 Massimo

 On Oct 10, 1:21 pm, Timothy Farrell [EMAIL PROTECTED] wrote:

  I know you're busy, I just don't want this to get lost in the fray.  I
  don't mean to be naggy. Anyway...

  I actually had that idea a while ago but never presented because I
  thought you would be against it.  Anyway, I like this concept better anyway.

  Here's an idea:
  - Have a generic error page (straight HTML, no processing whatsoever)
  - When running an error handler function set a request flag that says
  this is an error handler
  - If an error handler throws an error, serve the generic error page.

  This is what google does.  http://i36.tinypic.com/b3sw03.png

  If you like this idea or come up with other details, I'll code it if you
  like.  Just let me know.

  -tim

  mdipierro wrote:
   I think in routes.py there should be routes on error for different
   types of error. The problem is this may cause circular references.

   Timothy Farrell wrote:

   # ps ax | grep 'dispatcher' | grep -v 'grep' | sed -e s/ ?.*//
   123456
   # renice -10 123456

   (just a friendly reminder)

   mdipierro wrote:

   processing

   tfarrell.vcf
   1KViewDownload
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---