Re: The power of PEPs

2010-12-02 Thread BrianTheLion
@Mike - I tend to feel like the effort should be officially sanctioned in some way, but thanks for offering up a stopgap. @whit - By "current documentation structure," do you mean inline documentation? As in, documentation that lives in line with the code? Where do we go from here? Does anybody e

Re: how can I render an image (barcode) without writing the file to disk?

2010-12-02 Thread Mike Orr
``sio.getvalue()`` has always been the way to get the contents of a StringIO "file". ``sio.buff`` is undocumented so who knows what it might do. http://docs.python.org/library/stringio.html On Thu, Dec 2, 2010 at 5:54 PM, snfct...@sacfoodcoop.com wrote: > Thanks, Ian - that worked! > > @Marco:

Re: how can I render an image (barcode) without writing the file to disk?

2010-12-02 Thread snfct...@sacfoodcoop.com
Thanks, Ian - that worked! @Marco: Thanks for the alternative technique - I think I like the idea of using StringIO and not creating/ deleting the file. On Dec 2, 4:20 pm, Ian Wilson wrote: > Seems that you want something like this when using StringIO (in python 2.6 > at least): > > try: >    

Re: how can I render an image (barcode) without writing the file to disk?

2010-12-02 Thread Marco
Can't you just cache the result of the f.read() call, delete the file and then return from the call? f.close() f.open('barcode.jpg') tmp = f.read() os.remove('barcode.jpg') # should really create a unique temp name to avoid concurrency problems On Dec 2, 2:33 pm,

Re: how can I render an image (barcode) without writing the file to disk?

2010-12-02 Thread Ian Wilson
Seems that you want something like this when using StringIO (in python 2.6 at least): try: return f.getvalue() finally: f.close() On Thu, Dec 2, 2010 at 2:33 PM, snfct...@sacfoodcoop.com < snfct...@sacfoodcoop.com> wrote: > I want my controller to return a UPC barcode as action with one

how can I render an image (barcode) without writing the file to disk?

2010-12-02 Thread snfct...@sacfoodcoop.com
I want my controller to return a UPC barcode as action with one argument, like so: mycontroller/barcode/012345678901 It works fine if I read a file object, like so: def barcode(self, data): f = open('barcode.jpg', 'r') barcode_('upc-a', str(data)).save(f, format='JPEG')

Re: Official versions in mercurial repo

2010-12-02 Thread Mike Orr
On Thu, Dec 2, 2010 at 7:38 AM, Antonio Beamud Montero wrote: > Hi all: > I'm trying to download the 1.1 pylons stable release via mercurial, but I > cannot find a tag in mercurial pointing to that release... > How can I get it? The latest version is 1.0. The repository is missing some tags, whic

Official versions in mercurial repo

2010-12-02 Thread Antonio Beamud Montero
Hi all: I'm trying to download the 1.1 pylons stable release via mercurial, but I cannot find a tag in mercurial pointing to that release... How can I get it? Greetings. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group,

Re: Some information about « SQLite objects created in a thread can only be used in that same thread » error with Pylons framework ?

2010-12-02 Thread Marius Gedminas
On Thu, Dec 02, 2010 at 02:59:54PM +0100, Stéphane Klein wrote: > in a Pylons Framework project, I've this error : > > ProgrammingError: (ProgrammingError) SQLite objects created in a > thread can only be used in that same thread.The object was created > in thread id 1091357552 and this is thread

Re: Some information about « SQLite objects created in a thread can only be used i n that same thread » error with Pylons framework ?

2010-12-02 Thread Stéphane Klein
Le 02/12/2010 15:14, Stéphane Klein a écrit : Le 02/12/2010 14:59, Stéphane Klein a écrit : Hi, in a Pylons Framework project, I've this error : ProgrammingError: (ProgrammingError) SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 1091

Re: Some information about « SQLite objects created in a thread can only be used i n that same thread » error with Pylons framework ?

2010-12-02 Thread Stéphane Klein
Le 02/12/2010 14:59, Stéphane Klein a écrit : Hi, in a Pylons Framework project, I've this error : ProgrammingError: (ProgrammingError) SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 1091357552 and this is thread id 1099762544 I use

Some information about « SQLite objects c reated in a thread can only be used in that same thread » error with Pylons fram ework ?

2010-12-02 Thread Stéphane Klein
Hi, in a Pylons Framework project, I've this error : ProgrammingError: (ProgrammingError) SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 1091357552 and this is thread id 1099762544 I use a standard sqlalchemy pylons skeleton. I us