Re: What's in a name?

2011-07-29 Thread Billy Mays
On 7/29/2011 11:25 PM, Andrew Berg wrote: In case you want to see the code (not complete by a long shot, and they need to be refactored): Module - http://elucidation.hg.sourceforge.net/hgweb/elucidation/elucidation/file/f8da0b15ecca/elucidation.py CLI app - http://disillusion-cli.hg.sourceforge.n

Re: What's in a name?

2011-07-29 Thread harrismh777
Andrew Berg wrote: The first (and main) project is a module that provides a class for holding information related to audio/video encoding/muxing and methods that encode/mux based on that info. Any ideas? Multiplexing Audio Video Encoder MuXaven -- m harris FSF ...free as in freedom/

What's in a name?

2011-07-29 Thread Andrew Berg
I know I really shouldn't be spending too much time and effort on a name, but for some reason, it's really bothering me that I can't come up with good names for the projects I'm working on. The first (and main) project is a module that provides a class for holding information related to audio/vide

Re: Function "modes" vs. separate functions

2011-07-29 Thread Ben Finney
Rustom Mody writes: > Ben Finney said: > > But this is all getting rather generic and abstract. What specific > > real-world examples do you have in mind? > > regex match vs regex search? That's not showing a real-world example. Where is the code which is prone to “lots of shared code but can't

Re: NoneType and new instances

2011-07-29 Thread Gregory Ewing
Steven D'Aprano wrote: As for True and False, bool has to be able to return them, because the whole purpose of exposing bool is so people can call it: if bool(some_value) was an error, that would defeat the purpose of having bool! Bool is different, because it doubles as a function for coercin

Re: Function "modes" vs. separate functions

2011-07-29 Thread Andrew Berg
On 2011.07.29 08:57 PM, Ben Finney wrote: > If they share a lot of code, either it *is* separable to common > functions (in which case, implement it that way), or the “same thing” > code is sufficiently complex that it's better to show it explicitly. > > But this is all getting rather generic and

Re: Function "modes" vs. separate functions (was: PyWart: os.path needs immediate attention!)

2011-07-29 Thread Rustom Mody
Ben Finney said: > But this is all getting rather generic and abstract. What specific > real-world examples do you have in mind? regex match vs regex search? -- http://mail.python.org/mailman/listinfo/python-list

Re: Function "modes" vs. separate functions

2011-07-29 Thread Ben Finney
Andrew Berg writes: > On 2011.07.29 07:50 PM, Steven D'Aprano wrote: > > Especially if the implementation looks like this: > > > > def get_thing(argument, flag): > > if flag: > > return one_thing(argument) > > else: > > return another_thing(argument) > > > Well, that wou

Re: What is xrange?

2011-07-29 Thread Steven D'Aprano
Billy Mays wrote: > Is xrange not a generator? I know it doesn't return a tuple or list, so > what exactly is it? xrange pre-dates generators by approximately forever. It returns a special "xrange object", which generates values suitable for use in for-loops using the old __getitem__ protocol.

Function "modes" vs. separate functions (was: PyWart: os.path needs immediate attention!)

2011-07-29 Thread Andrew Berg
On 2011.07.29 07:50 PM, Steven D'Aprano wrote: > Especially if the implementation looks like this: > > def get_thing(argument, flag): > if flag: > return one_thing(argument) > else: > return another_thing(argument) > Well, that would be annoying, but wouldn't it be even mo

Re: PyWart: os.path needs immediate attention!

2011-07-29 Thread Steven D'Aprano
Teemu Likonen wrote: > * 2011-07-29T10:22:04-07:00 * wrote: > >> * New path module will ONLY support one path sep! There is NO reason >> to support more than one. > > Pathnames and the separator for pathname components should be abstracted > away, to a pathname object. Been there, done that,

Re: list comprehension to do os.path.split_all ?

2011-07-29 Thread Steven D'Aprano
Carl Banks wrote: > It's not even fullproof on Unix. > > '/home//h1122/bin///ghi/'.split('/') > > ['','home','','bin','','','ghi',''] What? No. Absolutely not -- that would be a major bug. Did you actually try it? >>> '/home//h1122/bin///ghi/'.split('/') ['', 'home', '', 'h1122', 'bin', '', '

Re: PyWart: os.path needs immediate attention!

2011-07-29 Thread Steven D'Aprano
Andrew Berg wrote: > os.path.exists(path, ignoreSymLnks=False) > I actually agree with you on these, which I suppose is interesting. Guido has a rule of thumb: "No constant arguments". Or another way to put it: if a function takes an argument which is nearly always a constant (usually, but n

Re: PyWart: os.path needs immediate attention!

2011-07-29 Thread Michael Poeltl
join 'Python-Dev'-mailinglist and tell them! from now on I will just ignore threads you initiated does trolling really make that much fun? * rantingrick [2011-07-29 19:25]: > > -- > Overview of Problems: > -

Re: list comprehension to do os.path.split_all ?

2011-07-29 Thread Michael Poeltl
* Alexander Kapps [2011-07-29 22:30]: > On 29.07.2011 21:30, Carl Banks wrote: > >> It's not even fullproof on Unix. >> >> '/home//h1122/bin///ghi/'.split('/') >> >> ['','home','','bin','','','ghi',''] what about this? >>> ' '.join('/

Re: PyWart: os.path needs immediate attention!

2011-07-29 Thread Terry Reedy
On 7/29/2011 1:22 PM, rantingrick wrote: * Introduce a new method named "partition" which (along with string splitting methods) will replace the six methods "basename", "dirname", "split", "splitdrive", "splitunc", "splittext". The method will return a tuple of the path split into four parts:

Re: Identical descriptor value, without leaking memory?

2011-07-29 Thread Ian Kelly
On Fri, Jul 29, 2011 at 5:01 PM, Ian Kelly wrote: > On Mon, Jul 25, 2011 at 11:46 AM, Jack Bates wrote: >> How can you get a descriptor to return an identical value, each time >> it's called with the same "instance" - without leaking memory? Oops, that should have been: class MyDescriptor(objec

Re: Identical descriptor value, without leaking memory?

2011-07-29 Thread Ian Kelly
On Mon, Jul 25, 2011 at 11:46 AM, Jack Bates wrote: > How can you get a descriptor to return an identical value, each time > it's called with the same "instance" - without leaking memory? class MyDescriptor(object): def __get__(self, instance, owner): try: return instance.

Identical descriptor value, without leaking memory?

2011-07-29 Thread Jack Bates
How can you get a descriptor to return an identical value, each time it's called with the same "instance" - without leaking memory? #!/usr/bin/env python class descriptor: class __metaclass__(type): def __get__(self, instance, owner): ... class owner: descriptor = descriptor inst

Re: change gtk STOCK_SAVE label text on the fly

2011-07-29 Thread Thomas Jollans
On 30/07/11 00:29, Peter Irbizon wrote: >> (Don't feel you need to answer this: Do you really think you need > on-the-fly language switching? It's "cool", but how many users are going > to want to use that?) > yes, you're right. anyway it's cool feature and I hoped it's easy to do > it in python /

Re: change gtk STOCK_SAVE label text on the fly

2011-07-29 Thread Peter Irbizon
> (Don't feel you need to answer this: Do you really think you need on-the-fly language switching? It's "cool", but how many users are going to want to use that?) yes, you're right. anyway it's cool feature and I hoped it's easy to do it in python / but it isn't... > Why do you want to change it?

Re: removing nested iffs

2011-07-29 Thread Chris Angelico
On Sat, Jul 30, 2011 at 6:42 AM, Peter Otten <__pete...@web.de> wrote: > def format_pairs(pairs): >    for template, value in pairs: >        if value is None: >            break >        yield template.format(value) > Cool! May I suggest a trifling change: def format_pairs(*pairs): for t

Re: PyWart: os.path needs immediate attention!

2011-07-29 Thread Chris Angelico
On Sat, Jul 30, 2011 at 6:44 AM, Corey Richardson wrote: > Excerpts from rantingrick's message of Fri Jul 29 13:22:04 -0400 2011: >>  * New path module will ONLY support one path sep! > > People who use windows are used to \ being their pathsep. If you show > them a path that looks like C:/whateve

Re: PyWart: os.path needs immediate attention!

2011-07-29 Thread Andrew Berg
On 2011.07.29 04:21 PM, Alister Ware wrote: > instead of all this negativity why don't you try being productive for a > change either make a suggestion for an addition (ie something that does > not yest exits) or better yet give us all the benefit of your supreme > coding talent & provide some c

Re: PyWart: os.path needs immediate attention!

2011-07-29 Thread Alister Ware
On Fri, 29 Jul 2011 10:22:04 -0700, rantingrick wrote: > -- > Overview of Problems: > -- > > * Too many methods exported. > * Poor choice of method names. > * Non public classes/methods exported! >

Re: PEP 8 and extraneous whitespace

2011-07-29 Thread Chris Angelico
On Sat, Jul 30, 2011 at 4:45 AM, OKB (not okblacke) wrote: > Chris Angelico wrote: >> That mandates that formatting NOT be a part of the language. I could >> take C code and reformat it in various ways with a script, and easily >> guarantee that the script won't affect the code by simply having it

Re: removing nested iffs

2011-07-29 Thread Chris Angelico
On Sat, Jul 30, 2011 at 5:40 AM, Josh Benner wrote: > I'm writing a function to create a string that gets longer iff an argument > is defined.  In there a more elegant way than nesting all those ifs? Your logic appears to be: Proceed along a specified list and stop when you find that you don't ha

Re: PyWart: os.path needs immediate attention!

2011-07-29 Thread Corey Richardson
Excerpts from rantingrick's message of Fri Jul 29 13:22:04 -0400 2011: > -- > Proposed new functionality: > -- > > * New path module will ONLY support one path sep! There is NO > reason to support more

Re: removing nested iffs

2011-07-29 Thread Peter Otten
Josh Benner wrote: > I'm writing a function to create a string that gets longer iff an argument > is defined. In there a more elegant way than nesting all those ifs? > > def format_rsync_src_string(args, server="RSYNC"): > """ Format an rsync source directory string. """ > if args.server

Re: What is xrange?

2011-07-29 Thread Jerry Hill
On Fri, Jul 29, 2011 at 3:36 PM, Billy Mays wrote: > Is xrange not a generator?  I know it doesn't return a tuple or list, so > what exactly is it?  Y doesn't ever complete, but x does. > > x = (i for i in range(10)) > y = xrange(10) xrange() does not return a generator. It returns an iterable x

Re: regex question

2011-07-29 Thread Thomas Jollans
On 29/07/11 19:52, Rustom Mody wrote: > MRAB wrote: > > findall returns a list of tuples (what the groups captured) if there > is more than 1 group, > > or a list of strings (what the group captured) if there is 1 group, > or a list of > > strings (what the regex matched) if there are no groups. >

Re: What is xrange?

2011-07-29 Thread Thomas Jollans
On 29/07/11 21:36, Billy Mays wrote: > Is xrange not a generator? I know it doesn't return a tuple or list, > so what exactly is it? Y doesn't ever complete, but x does. > > x = (i for i in range(10)) > y = xrange(10) > > print "===X===" > while True: > for i in x: > print i >

Re: PyWart: os.path needs immediate attention!

2011-07-29 Thread Chris Angelico
On Sat, Jul 30, 2011 at 3:22 AM, rantingrick wrote: > ~ >  3. Non Public Names Exposed! > ~ > >  * genericpath >  * os >  * stat >  * sys >  * warnings > And you intend to do what, exactly, with these? > - splitunc --> Unix specific! 1) So? 2) ht

Re: list comprehension to do os.path.split_all ?

2011-07-29 Thread Alexander Kapps
On 29.07.2011 21:30, Carl Banks wrote: It's not even fullproof on Unix. '/home//h1122/bin///ghi/'.split('/') ['','home','','bin','','','ghi',''] The whole point of the os.path functions are to take care of whatever oddities there are in the path system. When you use string manipulation to m

Re: removing nested iffs

2011-07-29 Thread Josh Benner
On Fri, Jul 29, 2011 at 1:07 PM, Wolfgang Rohdewald wrote: > On Freitag 29 Juli 2011, Josh Benner wrote: > > if args.build not None: > > which python version understands this? > > -- > Wolfgang > Apparently the version running in my head understands it ;-) Sorry about that how about this (replac

Re: PyWart: os.path needs immediate attention!

2011-07-29 Thread Teemu Likonen
* 2011-07-29T10:22:04-07:00 * wrote: > * New path module will ONLY support one path sep! There is NO reason > to support more than one. Pathnames and the separator for pathname components should be abstracted away, to a pathname object. This pathname object could have a "path" or "directory" sl

Re: removing nested iffs

2011-07-29 Thread Wolfgang Rohdewald
On Freitag 29 Juli 2011, Josh Benner wrote: > if args.build not None: which python version understands this? -- Wolfgang -- http://mail.python.org/mailman/listinfo/python-list

Re: PyWart: os.path needs immediate attention!

2011-07-29 Thread Waldek M.
Dnia Fri, 29 Jul 2011 14:41:22 -0500, harrismh777 napisał(a): > The backslash sep is an asinine CPM/80 | DOS disk based carry-over which > does not fit well with the modern forward direction. The disk based file > system carry-over is bad enough; but, propagating multiple ways of doing > simple

Re: What is xrange?

2011-07-29 Thread harrismh777
Billy Mays wrote: Is xrange not a generator? I know it doesn't return a tuple or list, so what exactly is it? Y doesn't ever complete, but x does. range(n) creates a list containing all the integers 0..n-1. This is a problem if you do range(100), because you'll end up with a >4Mb l

Re: PyWart: os.path needs immediate attention!

2011-07-29 Thread harrismh777
Andrew Berg wrote: * New path module will ONLY support one path sep! There is NO reason to support more than one. When we support more than one path sep we help to propagate multiplicity.We should only support the slash and NOT the backslash across ALL OS's since the slash is more widely a

removing nested iffs

2011-07-29 Thread Josh Benner
I'm writing a function to create a string that gets longer iff an argument is defined. In there a more elegant way than nesting all those ifs? def format_rsync_src_string(args, server="RSYNC"): """ Format an rsync source directory string. """ if args.server is None: raise CopyNigh

What is xrange?

2011-07-29 Thread Billy Mays
Is xrange not a generator? I know it doesn't return a tuple or list, so what exactly is it? Y doesn't ever complete, but x does. x = (i for i in range(10)) y = xrange(10) print "===X===" while True: for i in x: print i break else: break print "===Y===" while T

Re: list comprehension to do os.path.split_all ?

2011-07-29 Thread Carl Banks
On Thursday, July 28, 2011 2:31:43 PM UTC-7, Ian wrote: > On Thu, Jul 28, 2011 at 3:15 PM, Emile van Sebille wrote: > > On 7/28/2011 1:18 PM gry said... > >> > >> [python 2.7] I have a (linux) pathname that I'd like to split > >> completely into a list of components, e.g.: > >>    '/home/gyoung/ha

Re: Is it bad practise to write __all__ like that

2011-07-29 Thread OKB (not okblacke)
Thomas Rachel wrote: > class AllList(list): > """list which can be called in order to be used as a > __all__-adding > decorator""" Wow, this is a great idea. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path,

Re: PEP 8 and extraneous whitespace

2011-07-29 Thread OKB (not okblacke)
Chris Angelico wrote: > On Thu, Jul 28, 2011 at 4:18 PM, OKB (not okblacke) >>        I think exactly the opposite.  The source file should re flect >> the semantic organization of the code, without extraneous concessions >> to visual display (like "lining things up" with spaces or splitting >> lo

Re: PyWart: os.path needs immediate attention!

2011-07-29 Thread Andrew Berg
On 2011.07.29 12:22 PM, rantingrick wrote: > * New path module will ONLY support one path sep! There is NO reason > to support more than one. When we support more than one path sep we > help to propagate multiplicity.We should only support the slash and > NOT the backslash across ALL OS's since th

Re: regex question

2011-07-29 Thread Rustom Mody
MRAB wrote: > findall returns a list of tuples (what the groups captured) if there is more than 1 group, > or a list of strings (what the group captured) if there is 1 group, or a list of > strings (what the regex matched) if there are no groups. Thanks. It would be good to put this in the manual

Re: Another win for profiling.

2011-07-29 Thread Alan Meyer
On 07/29/2011 07:46 AM, Roy Smith wrote: It's often said that you shouldn't try to guess what's slow, but use profiling tools to measure what's slow. I had a great example of that yesterday. ... Yes. My first experience of profiling was about 25 years ago. I was experimenting with Borland'

PyWart: os.path needs immediate attention!

2011-07-29 Thread rantingrick
-- Overview of Problems: -- * Too many methods exported. * Poor choice of method names. * Non public classes/methods exported! * Duplicated functionality.

Re: How object's setattr differs from inherited?

2011-07-29 Thread Andrew Berg
On 2011.07.29 10:12 AM, Ciantic wrote: class MyObject(object): > ... pass > ... my = MyObject() my.myvar = 'value' # No error! obj = object() obj.myvar = 'value' # Causes error! > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'objec

Re: How object's setattr differs from inherited?

2011-07-29 Thread Thomas Jollans
On 29/07/11 17:12, Ciantic wrote: class MyObject(object): > ... pass > ... my = MyObject() my.myvar = 'value' # No error! obj = object() obj.myvar = 'value' # Causes error! > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'object' ob

Re: regex question

2011-07-29 Thread MRAB
On 29/07/2011 16:45, Thomas Jollans wrote: On 29/07/11 16:53, rusi wrote: Can someone throw some light on this anomalous behavior? import re r = re.search('a(b+)', 'ababbaaab') r.group(1) 'b' r.group(0) 'ab' r.group(2) Traceback (most recent call last): File "", line 1, in IndexErr

Re: How object's setattr differs from inherited?

2011-07-29 Thread Thomas Rachel
Am 29.07.2011 17:12 schrieb Ciantic: class MyObject(object): ... pass ... my = MyObject() my.myvar = 'value' # No error! obj = object() obj.myvar = 'value' # Causes error! Traceback (most recent call last): File "", line 1, in AttributeError: 'object' object has no attribute 'myvar'

How object's setattr differs from inherited?

2011-07-29 Thread Ciantic
>>> class MyObject(object): ... pass ... >>> my = MyObject() >>> my.myvar = 'value' # No error! >>> >>> obj = object() >>> obj.myvar = 'value' # Causes error! Traceback (most recent call last): File "", line 1, in AttributeError: 'object' object has no attribute 'myvar' Why simple inherita

Re: regex question

2011-07-29 Thread Thomas Jollans
On 29/07/11 16:53, rusi wrote: > Can someone throw some light on this anomalous behavior? > import re r = re.search('a(b+)', 'ababbaaab') r.group(1) > 'b' r.group(0) > 'ab' r.group(2) > Traceback (most recent call last): > File "", line 1, in > IndexError: no such gr

Re: change gtk STOCK_SAVE label text on the fly

2011-07-29 Thread Thomas Jollans
On 29/07/11 13:02, Peter Irbizon wrote: > Hello, > > how could I change STOCK_SAVE label text? I would like to have "Save > it!" instead of "Save" > And other question related to this is how can I change translation of > STOCK_SAVE on the fly? I think I need to set locale for pygtk...but > don't

regex question

2011-07-29 Thread rusi
Can someone throw some light on this anomalous behavior? >>> import re >>> r = re.search('a(b+)', 'ababbaaab') >>> r.group(1) 'b' >>> r.group(0) 'ab' >>> r.group(2) Traceback (most recent call last): File "", line 1, in IndexError: no such group >>> re.findall('a(b+)', 'ababbaaab') ['

Re: Only Bytecode, No .py Files

2011-07-29 Thread Alan Meyer
On 07/26/2011 11:19 AM, Eldon Ziegler wrote: Is there a way to have the Python processor look only for bytecode files, not .py files? We are seeing huge numbers of Linux audit messages on production system on which only bytecode files are stored. The audit subsystem is recording each open failure

Re: Only Bytecode, No .py Files

2011-07-29 Thread Thomas Rachel
Am 29.07.2011 14:51 schrieb John Roth: Sorry. I thought what you posted was from the OP. I guess I don't really expect someone to post a completely irrelevant trace in a thread started by someone who has a problem. In what way do you find the trace irrelevant? It clearly shows that it is not

Re: Only Bytecode, No .py Files

2011-07-29 Thread Jerry Hill
On Fri, Jul 29, 2011 at 8:51 AM, John Roth wrote: > Sorry. I thought what you posted was from the OP. I guess I don't > really expect someone to post a completely irrelevant trace in a > thread started by someone who has a problem. I'm not sure why you would think that that post was by the origin

Re: shlex parsing

2011-07-29 Thread Karim
On 07/29/2011 03:42 PM, Web Dreamer wrote: whitespace_split = True Thanks for the tip! Cheers Karim -- http://mail.python.org/mailman/listinfo/python-list

Re: list comprehension to do os.path.split_all ?

2011-07-29 Thread TheSaint
Alan Meyer wrote: > This is not properly portable to all OS, but you could simply split on > the slash character, e.g., > > pathname.split('/') more portable pathname.split(os.sep) -- http://mail.python.org/mailman/listinfo/python-list

Re: Only Bytecode, No .py Files

2011-07-29 Thread Ethan Furman
John Roth wrote: ACK. That is exactly what I wanted to show. (With the difference that this is probably nt the bash, but the linux loader trying to link a .so, but for the problem, it doesn't make any difference.) Sorry. I thought what you posted was from the OP. I guess I don't really expect s

Re: Only Bytecode, No .py Files

2011-07-29 Thread John Roth
On Jul 27, 8:56 am, Thomas Rachel wrote: > Am 27.07.2011 14:18 schrieb John Roth: > > > Two comments. First, your trace isn't showing attempts to open .py > > files, it's showing attempts to open the Curses library in the bash > > directory. > > Of course. My goal was to show that the OP's "proble

Re: list comprehension to do os.path.split_all ?

2011-07-29 Thread Neil Cerutti
On 2011-07-29, Dennis Lee Bieber wrote: > On Thu, 28 Jul 2011 15:31:43 -0600, Ian Kelly > declaimed the following in > gmane.comp.python.general: > >> Using os.sep doesn't make it cross-platform. On Windows: >> >> >>> os.path.split(r'C:\windows') >> ('C:\\', 'windows') >> >>> os.path.split(r'C:/

Re: monotonically increasing memory usage

2011-07-29 Thread Ulrich Eckhardt
Pedro Larroy wrote: > Just crossposting this from stackoverflow: > > http://stackoverflow.com/... > > Any hints? At first I was just too lazy to visit stackoverflow and skipped this posting. Then I thought: Why didn't you include the content, so people can actually answer this question here? T

Another win for profiling.

2011-07-29 Thread Roy Smith
It's often said that you shouldn't try to guess what's slow, but use profiling tools to measure what's slow. I had a great example of that yesterday. We have some web server code that does a big database (MongoDB) query and some post-processing of the data in python. It worked fine in testin

change gtk STOCK_SAVE label text on the fly

2011-07-29 Thread Peter Irbizon
Hello, how could I change STOCK_SAVE label text? I would like to have "Save it!" instead of "Save" And other question related to this is how can I change translation of STOCK_SAVE on the fly? I think I need to set locale for pygtk...but don't know how -- http://mail.python.org/mailman/listinfo/py

Re: PEP 8 and extraneous whitespace

2011-07-29 Thread Chris Angelico
On Thu, Jul 28, 2011 at 4:18 PM, OKB (not okblacke) wrote: > Thomas 'PointedEars' Lahn wrote: >>  Automatic word-wrap, where available, really is not a solution; it >> is a bad workaround to a problem caused by the original author of >> the source code that can be easily avoided by them taking mor

Re: multilanguage application - step by step

2011-07-29 Thread Peter Irbizon
> Well, it depends on how you're constructing your interface. If you're > creating all the widgets in Python code, you could move all your > foo.text = "Bar"; statements to one method that updates the text for all > widgets, and call that both from the constructor and from the > language-switching

Re: Is it bad practise to write __all__ like that

2011-07-29 Thread Karim
On 07/29/2011 08:37 AM, Thomas Rachel wrote: Am 28.07.2011 20:01 schrieb Ian Kelly: The advantage of Thomas's decorator here is that it lets you place the denotation of whether a function is exported alongside its definition, whereas simply declaring the __all__ list forces you to separate them

how to make checkitem menu and allow to be checked only one item?

2011-07-29 Thread Peter Irbizon
Hello geeks, I have this code in my app: self.menu_items = ( ( "/_Languages", None,None, 0, "" ), ( "/Languages/_english", None,self.print_lang, 0, "" ), ( "/Languages/_german", None,self.print_lang, 0, "" ), ) self.vbox = gt

Re: multilanguage application - step by step

2011-07-29 Thread Thomas Jollans
On 29/07/11 11:18, Peter Irbizon wrote: > Hello Thomas, > > > The usual way of using gettext is to use the system locale to determine > > the right language. Of course, you can have different translations and > > install() them (I expect), but you'll have to re-load all the strings > > displayed

Re: shlex parsing

2011-07-29 Thread Karim
On 07/29/2011 09:24 AM, Web Dreamer wrote: Nobody a écrit ce jeudi 28 juillet 2011 18:37 dans : On Thu, 28 Jul 2011 17:48:34 +0200, Web Dreamer wrote: I would like to parse this TCL command line with shlex: '-option1 [get_rule A1 B2] -option2 $VAR -option3 TAG' s = s.replace('[','"[') s =

Re: multilanguage application - step by step

2011-07-29 Thread Peter Irbizon
Hello Thomas, > The usual way of using gettext is to use the system locale to determine > the right language. Of course, you can have different translations and > install() them (I expect), but you'll have to re-load all the strings > displayed in your application when you switch language, which m

Re: gettext switch language on the fly

2011-07-29 Thread Peter Irbizon
hello Chris, I am using pygtk. 2011/7/29 Chris Rebert > On Thu, Jul 28, 2011 at 6:20 PM, Peter Irbizon > wrote: > > hello, > > I am using gettext fo localization > > > Now I would like to switch all texts in my app when I click on item in > menu. > > Unfortunatelly this not switch texts immed

Re: Is it bad practise to write __all__ like that

2011-07-29 Thread mark ferguson
Thomas, A ha! Now I feel all warm and fuzzy inside. It's nice to start the day with learning something new. To be honest, the initial problem was that I didn't understand the meaning of '__all__', again probably from not working in the large with python. After posting, I went and had another go a