Time out beaker session?

2009-02-06 Thread Jules Stevenson

Hi All,

Is it possible to make the beaker session time out / delete itself after a
period of inactivity? I'd like it so that when a user doesn't use the site
for x amount of time the session is deleted, forcing the user to re log in
[user name is stored in the session].

Many thanks, Jules


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



Re: pyjamas + pylons

2009-02-06 Thread Jim Washington

lkcl wrote:

[ a lot of good stuff]

FWIW, here's another few cents about pyjamas, gleaned from using it for
a couple of weeks.

I found Ian Bicking's JSON-RPC example a good starting point for doing
the rpc stuff with pyjamas and repoze.bfg, so I imagine it will work
similarly well in pylons. http://pythonpaste.org/webob/jsonrpc-example.html

If you want to use all the batteries included with python, you need to
use that code server side.  Protect your rpc methods with
authentication, authorization and XSS safeguards.  For auth/auth,
repoze.who/what are definitely usable.

The html that pyjamas/GWT generates tends to use table-based layout,
very ugly for those of us trying to get away from that.  But it is
liberally sprinkled with uniformly-named class attributes, so styling
can still be done with css.  If you think user interface rather than
web page, this is really not too bad a way to go.

In pyjamas, you can maybe use your favorite external javascript
libraries.  Sometimes it is as easy as

import thatotherlibrary.js

Then, if thatotherlibrary exposes a function fribble, you can use it
in a python function or method

def xfribble(obj1,obj2):
JS(return fribble(obj1,obj2);)

Several python syntactical constructs are not currently available in
pyjamas.  At compile time, pyjamas will tell you if you do something it
cannot handle.  Generally, if you keep your python code simple and
readable, it will work fine.  Compiling is pretty fast.

pyjamas does not currently minimize or obfuscate its output javascript,
so your javascript debugger will give you fairly useful hints about what
might be going wrong. Fix your python code, recompile, try again.

The widget set available in pyjamas is pretty basic.  You can compose
fancier widgets from the basic ui objects. You can also snoop in the
various libraries folks have built for GWT, and rewrite the java code in
python, if you do not want to reinvent the wheel too much.

I have not seen anything easier to work with to generate a complex user
interface for a web app.  Any widget can request data from the server
and handle the response.  This is a very nice way to make things happen.

- Jim Washington


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



is there a way to call render with string teamplates?

2009-02-06 Thread Jonathan Vanasco

ie -- instead of passing in a file, passing in a string?

the only way i can think of this right now is with a tmpfile, and i'd
like to avoid that.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: pyjamas + pylons

2009-02-06 Thread Tycon

Easy to work with is questionable when the first thing you encounter
is an error during easy install of pyjamas.
The menu widget displays incorrectly when you scroll the page (a basic
widget and pretty much unusable)
and there is no rich text editor.
AFAIK no one is using pyjamas for a production site.
There is almost no active development or community.
The documentation is lacking (to say the least).

So there is a lot of potential but this project still needs a lot of
work to be usable for production,
unless you want to deal with all the issues yourself.

On Feb 6, 5:31 am, Jim Washington jwas...@vt.edu wrote:
 lkcl wrote:

 [ a lot of good stuff]

 FWIW, here's another few cents about pyjamas, gleaned from using it for
 a couple of weeks.

 I found Ian Bicking's JSON-RPC example a good starting point for doing
 the rpc stuff with pyjamas and repoze.bfg, so I imagine it will work
 similarly well in pylons.http://pythonpaste.org/webob/jsonrpc-example.html

 If you want to use all the batteries included with python, you need to
 use that code server side.  Protect your rpc methods with
 authentication, authorization and XSS safeguards.  For auth/auth,
 repoze.who/what are definitely usable.

 The html that pyjamas/GWT generates tends to use table-based layout,
 very ugly for those of us trying to get away from that.  But it is
 liberally sprinkled with uniformly-named class attributes, so styling
 can still be done with css.  If you think user interface rather than
 web page, this is really not too bad a way to go.

 In pyjamas, you can maybe use your favorite external javascript
 libraries.  Sometimes it is as easy as

 import thatotherlibrary.js

 Then, if thatotherlibrary exposes a function fribble, you can use it
 in a python function or method

 def xfribble(obj1,obj2):
     JS(return fribble(obj1,obj2);)

 Several python syntactical constructs are not currently available in
 pyjamas.  At compile time, pyjamas will tell you if you do something it
 cannot handle.  Generally, if you keep your python code simple and
 readable, it will work fine.  Compiling is pretty fast.

 pyjamas does not currently minimize or obfuscate its output javascript,
 so your javascript debugger will give you fairly useful hints about what
 might be going wrong. Fix your python code, recompile, try again.

 The widget set available in pyjamas is pretty basic.  You can compose
 fancier widgets from the basic ui objects. You can also snoop in the
 various libraries folks have built for GWT, and rewrite the java code in
 python, if you do not want to reinvent the wheel too much.

 I have not seen anything easier to work with to generate a complex user
 interface for a web app.  Any widget can request data from the server
 and handle the response.  This is a very nice way to make things happen.

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



storing formattable strings in the config file?

2009-02-06 Thread Jonathan Vanasco

i want to store something in my config file like

foo %(bar)s

normally in python, i would do this

foo %%(bar)s

to escape the string interpolation.

paste doesn't like that.  anyone have a suggestion.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: is there a way to call render with string teamplates?

2009-02-06 Thread Dalius Dobravolskas
Hello,

On Fri, Feb 6, 2009 at 9:03 PM, Jonathan Vanasco jonat...@findmeon.comwrote:


 ie -- instead of passing in a file, passing in a string?

 the only way i can think of this right now is with a tmpfile, and i'd
 like to avoid that.

I'm pretty sure that methods must return string and that's the only
requirement on them.

That basically means you can use template engines directly. If it is mako
something like that should work:

from mako.template import Template
print Template(hello ${data}!).render(data=world)

Example was shamelessly take from first page of
http://www.makotemplates.org/.

-- 
Dalius
http://blog.sandbox.lt

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



Re: is there a way to call render with string teamplates?

2009-02-06 Thread Wichert Akkerman

Previously Dalius Dobravolskas wrote:
 Hello,
 
 On Fri, Feb 6, 2009 at 9:03 PM, Jonathan Vanasco jonat...@findmeon.comwrote:
 
 
  ie -- instead of passing in a file, passing in a string?
 
  the only way i can think of this right now is with a tmpfile, and i'd
  like to avoid that.
 
 I'm pretty sure that methods must return string and that's the only
 requirement on them.

Or string-like things. If you want to have the option of doing
transformation on the output rendering to XML doms and returning
repoze.xmliter (see
http://repoze.org/viewcvs/repoze.xmliter/trunk/README.txt?rev=2839view=auto)
instances is quite interesting.

Wichert.

-- 
Wichert Akkerman wich...@wiggy.netIt is simple to make things.
http://www.wiggy.net/   It is hard to make things simple.

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



beaker_cache query_args when duplicate queries are in

2009-02-06 Thread eleith

i've got a controller that will accept multiple same name args in the
query string

?id=10id=100id=50

it looks like beaker_cache does not interpret these as different query
strings, so

?id=10id=100id=50

will return the same as

?id=10id=100id=20id=50

any recommended workarounds for this?

on a tangential note, does beaker_cache support keying on a
controllers 'action' as well as a 'query_arg' ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: is there a way to call render with string teamplates?

2009-02-06 Thread Jonathan Vanasco

ok, this has given me ideas!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: is there a way to call render with string teamplates?

2009-02-06 Thread Mike Orr

On Fri, Feb 6, 2009 at 12:13 PM, Dalius Dobravolskas
dalius.dobravols...@gmail.com wrote:
 Hello,

 On Fri, Feb 6, 2009 at 9:03 PM, Jonathan Vanasco jonat...@findmeon.com
 wrote:

 ie -- instead of passing in a file, passing in a string?

 the only way i can think of this right now is with a tmpfile, and i'd
 like to avoid that.

 I'm pretty sure that methods must return string and that's the only
 requirement on them.

 That basically means you can use template engines directly. If it is mako
 something like that should work:

 from mako.template import Template
 print Template(hello ${data}!).render(data=world)

 Example was shamelessly take from first page of
 http://www.makotemplates.org/.

Yes, the biggest issue is whether the template engine accepts input
from a string.  I didn't realize Mako did.  I had to consider this
when I was building that upgrade to Buffet that didn't end up being
used.  My research showed that some engines have flexible input
formats, while others are more narrow.

render_mako() should really be considered a convenience function.  It
encapsulates some repetitive steps, and that's it's only purpose.
It's not intended to enforce some API that you have to use.  It's just
that the render_* functions shipped with Pylons have to use a common
API to avoid confusing newbies.  The most commonly-requested change is
to pass a dict of template values rather than using 'c'.  You can
certainly do that (although I personally like 'c' better).

-- 
Mike Orr sluggos...@gmail.com

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



Re: monit + pylons under Ubuntu 8

2009-02-06 Thread Matt Feifarek
On Mon, Jun 9, 2008 at 3:18 PM, Jonathan Vanasco jonat...@findmeon.comwrote:


 I'm new to ubuntu, and their syntax for scripts seems to differ from
 all the examples i've seen floating in the pylons community ( ie. lots
 of errors )


One thing that might help, is that by default, Ubuntu isn't using 'bash' for
/bin/sh; it's using 'dash'.

I've found this borks some of the init.d scripts that I move from one server
to another.

I don't know what best-practices are for /etc/init.d and pylons, which is
the google search that brought me to your message.

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



Re: monit + pylons under Ubuntu 8

2009-02-06 Thread Mike Orr
On Fri, Feb 6, 2009 at 3:50 PM, Matt Feifarek matt.feifa...@gmail.com wrote:

 On Mon, Jun 9, 2008 at 3:18 PM, Jonathan Vanasco jonat...@findmeon.com
 wrote:

 I'm new to ubuntu, and their syntax for scripts seems to differ from
 all the examples i've seen floating in the pylons community ( ie. lots
 of errors )


 One thing that might help, is that by default, Ubuntu isn't using 'bash' for
 /bin/sh; it's using 'dash'.

 I've found this borks some of the init.d scripts that I move from one server
 to another.

 I don't know what best-practices are for /etc/init.d and pylons, which is
 the google search that brought me to your message.

Every distro has different init scripts.  Ubuntu uses different
functions than Red Hat, which uses different functions than Gentoo,
etc.  Your best bet is to copy the smallest existing init script on
your system and modify it.

As for init scripts for Pylons, Pylons is not a daemon.  I assume
you mean an init script for paster.   Although the OP asked for a
script for Monit, which according to its website is a daemon manager.
I use another daemon manager, Supervisor,  with the attached Ubuntu
script.  (Note that I have Supervisor installed in its own virtualenv
/usr/local/venv-supervisor.)  It was written for Ubuntu 7.04.  I will
probably work on 8.10 without changes.  (I'll know next week when I
finish setting up my 8.10 server. :)

-- 
Mike Orr sluggos...@gmail.com

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



supervisor
Description: Binary data


HOWTO: Installing Pylons on Hardy

2009-02-06 Thread Joshua D. Drake

Hello,

I recently had to do this for a customer. It wasn't as easy as it should
be, but it was hardly difficult. I have blogged it here if any are
interested:

http://www.commandprompt.com/blogs/joshua_drake/2009/02/configuring_pylons_on_ubuntu_hardy/

I do make some assumptions in the document but anyone reasonably
familiar with how to use a web browser and their own system
configuration shouldn't have any problems.

Comments welcome.

Sincerely,

Joshua D. Drake

-- 
PostgreSQL - XMPP: jdr...@jabber.postgresql.org
   Consulting, Development, Support, Training
   503-667-4564 - http://www.commandprompt.com/
   The PostgreSQL Company, serving since 1997


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



Re: monit + pylons under Ubuntu 8

2009-02-06 Thread Jonathan Vanasco

wow , i totally forgot about this... its been 8 months!

i ended up making a shell script to wrap start/stop/restart on paster,
and use monit to trigger that

i'll post it soon!

and i'll look into your supervisor info.

in practice, monit is less of a daemon manager than it is a daemon
monitor.  it sends you emails and restarts services.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: is there a way to call render with string teamplates?

2009-02-06 Thread Jonathan Vanasco

well, for this purpose I know that the templates will ALWAYS be mako
-- its a failsafe built-in template for a distributed system that is
only used if not overridden.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Beginners tutorial broken

2009-02-06 Thread Joshua D. Drake

Hello,

I created my HelloWorld application which suggests I go to the Beginners
Tutorial. The link it provides is:

http://pylonshq.com/docs/en/0.9.7/gettingstarted.html

Which is broken.

Joshua D. Drake

-- 
PostgreSQL - XMPP: jdr...@jabber.postgresql.org
   Consulting, Development, Support, Training
   503-667-4564 - http://www.commandprompt.com/
   The PostgreSQL Company, serving since 1997


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



Re: Beginners tutorial broken

2009-02-06 Thread Mike Orr

On Fri, Feb 6, 2009 at 6:58 PM, Joshua D. Drake j...@commandprompt.com wrote:

 Hello,

 I created my HelloWorld application which suggests I go to the Beginners
 Tutorial. The link it provides is:

 http://pylonshq.com/docs/en/0.9.7/gettingstarted.html

 Which is broken.

I too a quick look, and the index.html in the application template is
out of date, which probably means the other links on the page should
be reviewed too.

There is a Getting Started page if you remove the .html suffix
(http://pylonshq.com/docs/en/0.9.7/gettingstarted), although I think
it has changed beyond what the index page anticipated.  In that the
Getting Started page tells how to install Pylons and create the hello
app, but if you've created the hello app you've obviously already done
that.

By the way, what's the status of the QuickWiki tutorial?  The website
still has the 0.9.6 version.  Last I heard two people were working on
updates, which had to be merged.

-- 
Mike Orr sluggos...@gmail.com

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



Re: storing formattable strings in the config file?

2009-02-06 Thread Tycon

maybe foo \x25(bar)s

On Feb 6, 11:11 am, Jonathan Vanasco jonat...@findmeon.com wrote:
 i want to store something in my config file like

     foo %(bar)s

 normally in python, i would do this

     foo %%(bar)s

 to escape the string interpolation.

 paste doesn't like that.  anyone have a suggestion.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: beaker_cache query_args when duplicate queries are in

2009-02-06 Thread Tycon

yes, you're right it's totally weird that the key beaker_cache uses
for caching controller actios,
doesn't include the action in it by default.  My solution was to write
my own decorator.

On Feb 6, 1:52 pm, eleith ele...@gmail.com wrote:
 i've got a controller that will accept multiple same name args in the
 query string

 ?id=10id=100id=50

 it looks like beaker_cache does not interpret these as different query
 strings, so

 ?id=10id=100id=50

 will return the same as

 ?id=10id=100id=20id=50

 any recommended workarounds for this?

 on a tangential note, does beaker_cache support keying on a
 controllers 'action' as well as a 'query_arg' ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: HOWTO: Installing Pylons on Hardy

2009-02-06 Thread m h

On Fri, Feb 6, 2009 at 5:29 PM, Joshua D. Drake j...@commandprompt.com wrote:

 Hello,

 I recently had to do this for a customer. It wasn't as easy as it should
 be, but it was hardly difficult. I have blogged it here if any are
 interested:

 http://www.commandprompt.com/blogs/joshua_drake/2009/02/configuring_pylons_on_ubuntu_hardy/

 I do make some assumptions in the document but anyone reasonably
 familiar with how to use a web browser and their own system
 configuration shouldn't have any problems.

 Comments welcome.

Can't figure out how to comment on your blog

It seems that installation/configuration of apache is what is
hard/painful.  Installing pylons is pretty straightforward on
ubuntu/gentoo/macos

-matt

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