Re: getting mimetype and extension of a file posted to pylons action.

2007-09-20 Thread Lawrence Oluyede
> You can get extension from filename: > > file_data = request.POST['file'] > > file_data.filename # filename > > I guess you can extract ext from os.path.splitext ? > > import mimetypes > mimetypes.guess_type(file_data.filename) Remember that you can also peek at request.POST['file'].type HTH

Routes, map.resource and HEAD

2007-11-16 Thread Lawrence Oluyede
I'd like to implement support for HEAD on some kind of resources in my web application. I use map.resource() to autogenerate the RESTful routes, but HEAD is not included by default How can I do that? I tried to manually connect another route after the map.resource() but it didn't work. Any hints

Re: Routes, map.resource and HEAD

2007-11-16 Thread Lawrence Oluyede
On Nov 16, 2007 7:48 PM, programmer.py <[EMAIL PROTECTED]> wrote: > > I saw this in the routes manual... > (http://routes.groovie.org/manual.html) > > m.connect('user/list', controller='user', action='list', > conditions=dict(method=['GET', 'HEAD'])) That's exactly what I did, it didn't

Re: What's new in Pylons 0.9.7 and future versions

2007-12-11 Thread Lawrence Oluyede
On Dec 11, 2007 12:26 AM, Mike Orr <[EMAIL PROTECTED]> wrote: > > Added "What's New in Pylons 0.9.7?" to the Cookbook, explaining the > changes that have been implemented in Pylons' development version. > http://wiki.pylonshq.com/pages/viewpage.action?pageId=11174779 Don't mean to criticise but I

Re: Testing Pylons apps

2008-01-08 Thread Lawrence Oluyede
On Jan 7, 2008 10:24 PM, Mike Orr <[EMAIL PROTECTED]> wrote: > > I looked over the testing page and saw we're recommending nosetests > with self.assertEqual(). That seems a bit schizophrenic since > "nosetests -d" is supposed to unpack assert expressions for you, and > show you the actual values

Re: Testing Pylons apps

2008-01-08 Thread Lawrence Oluyede
> How do you get it to show the variables' values then? With -d when I need to. nosetests -s -d -- Lawrence, stacktrace.it - oluyede.org - neropercaso.it "It is difficult to get a man to understand something when his salary depends on not understanding it" - Upton Sinclair --~--~-~--~

Re: WebHelpers plans

2008-01-11 Thread Lawrence Oluyede
On Jan 11, 2008 9:42 AM, Mike Orr <[EMAIL PROTECTED]> wrote: > > Ben discovered two problems with using ElementTree for the WebHelpers > HTML generation: What about http://codespeak.net/lxml/dev/lxmlhtml.html#creating-html-with-the-e-factory ? About the JavaScript thing: is it savvy to havea "

Re: WebHelpers plans

2008-01-11 Thread Lawrence Oluyede
> The only disadvantage of ExtJS I've heard is that it's so big, not > that it's missing anything. So that's an advattage. Does it have > good modularity; i.e., is it possible to load just the parts you use? extjs is quite modular: http://extjs.com/download/build try to build a version without

Re: url_for() : how to create URL whithout action?

2008-01-12 Thread Lawrence Oluyede
> Thanks. Now I have a question for you. How would you do this in > Django? How does Routes differ from the Django dispatcher as a Django > person would see it? As you may know, I'm coordinating an upgrade to > Routes, so I'm curious about any feedback which may lead to its > improvement. For

Re: WebHelpers plans

2008-01-14 Thread Lawrence Oluyede
> The biggest complaint I have and the main reason to stop using it is > the development process. You have to write a lot of error prone > javascript to tie together all the widgets; This can only be debugged > using long firebug sessions. I was hoping that after the initial > learning curve, th

Re: Pylons Model approach vs simple sql?

2008-01-22 Thread Lawrence Oluyede
> Is there a reason I couldn't just create a simple model that uses a db > connection string from the developer.ini conf file and then just make > direct queries? We have a pretty big application using PostgreSQL + psycopg2 with no SqlAlchemy whatsoever, so it's definitely possible :-) -- Law

Re: [authkit]: HTTP Basic auth needs some love

2008-02-15 Thread Lawrence Oluyede
On Fri, Feb 15, 2008 at 12:39 PM, Luis Bruno <[EMAIL PROTECTED]> wrote: > > Please, someone apply the "patch" below, hmmkay? Can't be arsed to find > a "diff" to install in my Windows box. Thank you. > > > class BasicUserSetter(AuthKitUserSetter): > def __init__(self, application, realm, au

Re: [authkit]: HTTP Basic auth needs some love

2008-02-15 Thread Lawrence Oluyede
> How can result be a HTTPUnauthorized instance if it's a str instance? Sorry, I was tricked by the indentation :D -- Lawrence, stacktrace.it - oluyede.org - neropercaso.it "It is difficult to get a man to understand something when his salary depends on not understanding it" - Upton Sinclair

Re: Pylons + Google App Engine

2008-04-09 Thread Lawrence Oluyede
On Wed, Apr 9, 2008 at 5:08 PM, Mike Orr <[EMAIL PROTECTED]> wrote: > According to IRC yesterday, appengine doesn't allow C modules, so that > takes out Mako, SQLAlchemy, and parts of Paste and Setuptools. So it > will take a while to get any non-trivial Pylons app running on it. > > http://p

Re: Pylons + Google App Engine

2008-04-09 Thread Lawrence Oluyede
On Wed, Apr 9, 2008 at 5:50 PM, Mike Orr <[EMAIL PROTECTED]> wrote: > You're discounting the "fun" effect: people want to see if they can > accomplish it. There is no "fork" of Pylons/Mako/Paste. Merely > people exploring the incompatibilities to see if the same package can > be made compati

Re: Pylons + Google App Engine

2008-04-09 Thread Lawrence Oluyede
On Wed, Apr 9, 2008 at 6:43 PM, Bob Ippolito <[EMAIL PROTECTED]> wrote: > You can always take the approach where C modules are used if > available, otherwise pure Python code can be used. simplejson does > this, for example. Yes and it's maybe the way to go but requires careful coding at import

Re: Pylons + Google App Engine

2008-04-09 Thread Lawrence Oluyede
On Wed, Apr 9, 2008 at 8:12 PM, Justin Driscoll <[EMAIL PROTECTED]> wrote: > Have you ever compiled PIL on OS X? It's kind of a PITA. On Windows it's a > simple install exe. I've had more problems on my Mac with C libs than on my > Windows box/server at work. For Linux a lot of it depends on your

Re: WebHelpers 0.6 reorganization

2008-05-01 Thread Lawrence Oluyede
On Thu, May 1, 2008 at 8:36 AM, Mike Orr <[EMAIL PROTECTED]> wrote: > > I moved some things around in WebHelpers 0.6 to accommodate current > and future growth. I wanted to get this done before release to avoid > a backward-compatibility precedent. > > webhelpers.html is now a package. All HT

Re: WebHelpers 0.6 reorganization

2008-05-01 Thread Lawrence Oluyede
On Thu, May 1, 2008 at 5:54 PM, Mike Orr <[EMAIL PROTECTED]> wrote: > > On Thu, May 1, 2008 at 5:40 AM, Lawrence Oluyede <[EMAIL PROTECTED]> wrote: > > Can't you keep the old import style issuing warnings for each module > > moved ? It will be better to

Re: REST methods implementation

2008-05-18 Thread Lawrence Oluyede
On Sun, May 18, 2008 at 5:15 PM, Alexis Georges <[EMAIL PROTECTED]> wrote: > > Hello, > I am having trouble understanding how the methods of a REST controller > are implemented, especially the new()/create() and edit()/update() > methods. I think you mean "how the methods work" not "how they are

Re: Deployment Question

2008-05-23 Thread Lawrence Oluyede
On Thu, May 22, 2008 at 11:12 PM, Shannon -jj Behrens <[EMAIL PROTECTED]> wrote: > Has anyone tried out the mod_wsgi module for *Nginx*? Yeah, I know, > weird: http://wiki.codemongers.com/NginxNgxWSGIModule I personally know the author and I definitely recommend it. He's focused and competent.

Re: Deployment Question

2008-05-23 Thread Lawrence Oluyede
On Fri, May 23, 2008 at 11:05 AM, Shannon -jj Behrens <[EMAIL PROTECTED]> wrote: >> I personally know the author and I definitely recommend it. He's >> focused and competent. > > Oh, cool! He also gave a talk about nginx's mod_wsgi at the PyCon Italy

Re: Defunct website for 'decorator' module halts installation of Pylons

2008-06-30 Thread Lawrence Oluyede
On Mon, Jun 30, 2008 at 3:07 PM, HÃ¥vard Haugen <[EMAIL PROTECTED]> wrote: > > The download url [*] specified on pypi.pyhon.org for the module > 'decorator' [**] is down. This breaks install of Pylons due to > dependence on this module. Anyone know of a way to circumvent this > (including getting ho

Re: Debugging failed tests with pylons globals

2008-07-09 Thread Lawrence Oluyede
On Thu, Jul 10, 2008 at 7:12 AM, Mike Orr <[EMAIL PROTECTED]> wrote: > > On Wed, Jul 9, 2008 at 7:04 PM, Graham Dumpleton > <[EMAIL PROTECTED]> wrote: >> >> >> >> On Jul 9, 6:22 am, "Mike Orr" <[EMAIL PROTECTED]> wrote: >>> Having one SOP, pylons.app, containing all the Pylons globals has long >>>

Re: simplejon 1.7.1

2008-07-21 Thread Lawrence Oluyede
On Mon, Jul 21, 2008 at 4:33 PM, Beginner <[EMAIL PROTECTED]> wrote: > > hello, > > I'm learning Pylons and i'm following the steps giving in the Part 1 > Chapter 8 of the pylons book tutorial(http://pylonsbook.com/alpha1/ > simplesite_tutorial) to do this simpleSite, but i am getting the > fol

Re: About the whitespaces in URLs

2008-07-25 Thread Lawrence Oluyede
On Fri, Jul 25, 2008 at 4:18 PM, Stefano <[EMAIL PROTECTED]> wrote: > > > > On Jul 25, 12:10 am, "Lawrence Oluyede" <[EMAIL PROTECTED]> wrote: >> >> Ok I'll try tomorrow >> > > I have a similar problem with '/' esca

Re: About the whitespaces in URLs

2008-07-28 Thread Lawrence Oluyede
On Fri, Jul 25, 2008 at 6:48 PM, Dean Landolt <[EMAIL PROTECTED]> wrote: > >> I'm working in a intranet environment, and the '/' is a item code >> naming convention in ERP and the field compose the key of database >> table. >> >> For workaround I chosen to replace backslash with underscore when i

Re: response status when form validation fails

2008-08-19 Thread Lawrence Oluyede
On Tue, Aug 19, 2008 at 8:20 AM, Sok Ann Yap <[EMAIL PROTECTED]> wrote: > Returning 400 for form validation error is recommended by Leonard > Richardson and Sam Ruby in the book RESTful Web Services. Here's an > excerpt from one of the examples in the book Also if they didn't say it... it's just

Re: response status when form validation fails

2008-08-19 Thread Lawrence Oluyede
On Tue, Aug 19, 2008 at 11:17 AM, Jorge Vargas <[EMAIL PROTECTED]> wrote: > > On Tue, Aug 19, 2008 at 1:08 AM, Lawrence Oluyede <[EMAIL PROTECTED]> wrote: >> >> On Tue, Aug 19, 2008 at 8:20 AM, Sok Ann Yap <[EMAIL PROTECTED]> wrote: >>> Returning 40

Re: If you HAD to use Java...

2008-10-31 Thread Lawrence Oluyede
On Fri, Oct 31, 2008 at 7:05 PM, Wyatt Baldwin <[EMAIL PROTECTED]> wrote: > On top of all that (or maybe beneath it), you're a RESTafarian (but > not a dogmatic practitioner) who prefers JSON over XML and has written > your own RESTful base controller for Pylons (Restler) that follows the > Rails/

Re: Pylons and Python 2.6 (Was: Re: go-pylons.py broken on Python 2.6 in Windows?)

2008-11-18 Thread Lawrence Oluyede
On Tue, Nov 18, 2008 at 8:35 AM, Eric Ongerth <[EMAIL PROTECTED]> wrote: > > Correction: the point at which easy_installing Pylons errored out was > during the installation of simpleJSON. So it never reached the point > of installing paste, pastescript, pastedeploy etc. > > Hey, I thought Python

Routes, regexp and matching

2008-11-24 Thread Lawrence Oluyede
I have a route made like this: map.resource('customer', 'customers', controller='customers', name_prefix='', path_prefix='') map.resource('instrument', 'basket', controller='basket', parent_resource=dict( member_name='customer', collection_name='customers')) This allows m

Re: Configuring https connection

2008-11-26 Thread Lawrence Oluyede
On Wed, Nov 26, 2008 at 11:59 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Is there a way to do that simply or do I need to make a new site and > redirect the link "myBasket" to this new site ? I think it's not Pylons's jobs to handle the HTTPS/SSL thing. You should implement your web appl

Re: repoze.what -- Authorization for WSGI applications

2008-11-27 Thread Lawrence Oluyede
On Wed, Nov 26, 2008 at 8:03 PM, Gustavo Narea <[EMAIL PROTECTED]> wrote: > Cheers! Slight point about the documentation: you use the same color for hyperlinked text and non-hyperlinked text and I think it somewhat misleading. HTH -- Lawrence, neropercaso.it - oluyede.org "It is difficult to g

Re: Pyjamas : Python -> JS

2008-12-06 Thread Lawrence Oluyede
On Sat, Dec 6, 2008 at 2:36 PM, Jorge Vargas <[EMAIL PROTECTED]> wrote: > That said I really think a JS wrapper in JS is better than a JS > wrapper in python or whatever language for that matter. Any DSL which > is pretty much what all the libraries have become is way better than > having a half b

Re: Pyjamas : Python -> JS

2008-12-07 Thread Lawrence Oluyede
On Sun, Dec 7, 2008 at 7:34 AM, Jens Hoffrichter <[EMAIL PROTECTED]> wrote: > Because it is just a lot more productive writing code in Python or > Ruby or even Java, than doing it in plain C or even Assembler. Yes, > with some good libraries, you can speed up the development process in > C quite a

Re: books

2008-12-07 Thread Lawrence Oluyede
On Sun, Dec 7, 2008 at 2:52 AM, jose <[EMAIL PROTECTED]> wrote: > > I'm thinking of pre-ordering the pylons book, and Amazon gives you the > option to get the sqlalchemy book at the same time. Has anyone red > the book? is it good? is is fairly recent or better yet how out of > date is it? It's

Re: easy_install pylons

2008-12-18 Thread Lawrence Oluyede
On Thu, Dec 18, 2008 at 5:27 PM, Tibor Arpas wrote: > > Hi, > > I don't know if anybody noticed. easy_install pylons is broken because of > this: > > (ENV) C:\Documents and Settings\All > Users\services\infinitsk\infinitsk>easy_install decorator==2.3.1 > Searching for decorator==2.3.1 > Reading

Re: Ten reasons why couchdb is better than (off topic)

2009-01-04 Thread Lawrence Oluyede
2009/1/4 Tycon : > > Oracle XML-DB can do the same thing (and more) - that is, allow you to > store documents in filesystem-like structure, and get the DBMS > transactional behavior as well as allow you to query based on document > contents (be it structured or not). Oracle XML-DB is not client/s

Re: Ten reasons why couchdb is better than (off topic)

2009-01-04 Thread Lawrence Oluyede
On Sun, Jan 4, 2009 at 11:41 PM, Tycon wrote: > > "Oracle XML-DB is not client/server" ? > > hahahahahahahahhahahaha My bad, I misplaced the product. I thought you were talking about "Oracle Berkeley DB XML" and I noticed there's another product called "Oracle XML DB" which is part of th

Re: Is Pylons a meta-package ?

2009-01-11 Thread Lawrence Oluyede
On Sun, Jan 11, 2009 at 2:33 PM, Tycon wrote: > Pylons has some useful things in it, however most of them are actually > independent packages that pylons just depends on. The definition of a > meta-package - in the context of Debian's APT, for instance - is a > package that doesn't have any conte

Re: Recommended production deployment (was: Re: Is Pylons a meta-package ?)

2009-01-12 Thread Lawrence Oluyede
On Mon, Jan 12, 2009 at 7:05 PM, mk wrote: > > Lawrence Oluyede wrote: > >> Paste and CP3 are not meant to be used in the deployment phase. I >> really don't care about who's fast during development mode (either >> Paste or CP3 or something else), I do care t

Re: Recommended production deployment (was: Re: Is Pylons a meta-package ?)

2009-01-12 Thread Lawrence Oluyede
On Mon, Jan 12, 2009 at 9:46 PM, Mike Orr wrote: > There are a lot of opinions being thrown about as if they're the > absolute truth, and I'm afraid it may be confusing people. Yeah, like saying that modwsgi + Apache are bad... > I can't > speak officially for Pylons (only Ben can), but I can s

Re: Recommended production deployment (was: Re: Is Pylons a meta-package ?)

2009-01-13 Thread Lawrence Oluyede
On Tue, Jan 13, 2009 at 3:03 AM, Mike Orr wrote: > > On Mon, Jan 12, 2009 at 4:20 PM, Lawrence Oluyede wrote: >>> The argument against PasteHTTPServer and CherryPy3 seems to be >>> efficiency. The arguments against mod_wsgi and daemon mode seem to be >>> ideolo

Re: Django or Pylons - comparison details

2009-01-19 Thread Lawrence Oluyede
On Mon, Jan 19, 2009 at 6:20 PM, Colin Flanagan wrote: > I'm curious if Django's CMS reputation comes from the fact that it's used by > a lot of newspapers and content providers, or if there really is something > that makes it advantageous over other frameworks. Django's admin is very handy fo

Re: Webtest doesn't like 204 response with Content-Type header

2009-01-22 Thread Lawrence Oluyede
On Wed, Jan 21, 2009 at 7:38 AM, Chris Miles wrote: > Either Pylons or Webtest are at fault with their understanding of > whether a Content-Type header is allowed with a 204 response. As far as I know the content-type without any body has no meaning. In the controller methods I have with 204 as

Re: routes src

2009-01-23 Thread Lawrence Oluyede
On Fri, Jan 23, 2009 at 12:05 PM, przemek.ch wrote: > > I'm getting an error while trying to get sources from svn co > http://routes.groovie.org/svn/trunk routes > > svn: Server sent unexpected return value (405 Method Not Allowed) in > response to PROPFIND request for '/svn/trunk' Routes is in

Re: Pylons 0.9.7 released

2009-02-24 Thread Lawrence Oluyede
On Mon, Feb 23, 2009 at 8:46 PM, Ben Bangert wrote: > Pylons 0.9.7 has been released, I've posted a full write-up on it on the > PylonsHQ site: > http://pylonshq.com/articles/archives/2009/2/pylons_097_released Congratulations Ben, I made no secret of my reservations in the past but I'm truly h

Re: Pylons, HTTP 201 Accepted, Task Queues and Background threads

2009-03-04 Thread Lawrence Oluyede
On Tue, Mar 3, 2009 at 9:57 PM, kmw wrote: > When I get the request I add the item to a synchronized queue (which > the processing thread blocks on) and return a HTTP 201 Accepted to the > client. The processing thread picks up tasks from the queue and they > are completed in the order received.

Re: Pylons, HTTP 202 Accepted, Task Queues and Background threads [was Re: Pylons, HTTP 201 Accepted ... ]

2009-03-04 Thread Lawrence Oluyede
> If you use Python 2.6 use the builtin module "multiprocessing", otherwise you can use the backport of that: <http://pypi.python.org/pypi/multiprocessing/> I'm not entirely sure of the compatibility issues between the standard library version of the package and the orig

Re: Thread-safety in Pylons (Python?)

2009-03-05 Thread Lawrence Oluyede
not <http://fisheye3.atlassian.com/browse/jython/trunk/jython/src/org/python/compiler/Future.java?r1=4203&r2=4202>. -- Lawrence Oluyede [eng] http://oluyede.org - http://twitter.com/lawrenceoluyede [ita] http://neropercaso.it - http:/

Re: How to strip HTML tags?

2010-08-25 Thread Lawrence Oluyede
On Wed, Aug 25, 2010 at 5:06 PM, Dobrysmak wrote: > As in the title. How to strip HTML tags in a string in Pylons? You can do it using my module http://www.oluyede.org/files/htmlstripper.py import htmlstripper print htmlstripper.stripHTML("AB", 'ascii') 'AB