ANN: cmd2, an extenstion of cmd that parses its argument line

2012-03-18 Thread anntzer . lee
Dear all, I would like to announce the first public release of cmd2, an extension of the standard library's cmd with argument parsing, here: https://github.com/anntzer/cmd2. Cmd2 is an extension built around the excellent cmd module of the standard library. Cmd allows one to build simple custo

Re: ANN: cmd2, an extenstion of cmd that parses its argument line

2012-04-26 Thread anntzer . lee
I have renamed the project to parsedcmd, which is also a better description of what the module does. https://github.com/anntzer/parsedcmd On Monday, March 19, 2012 6:14:44 AM UTC-7, xDog Walker wrote: > On Sunday 2012 March 18 22:11, anntzer@gmail.com wrote: > > I would like to announce the f

Re: cmd2, an extenstion of cmd that parses its argument list

2012-04-26 Thread anntzer . lee
On Sunday, March 18, 2012 10:12:24 PM UTC-7, anntz...@gmail.com wrote: > Dear all, > > I would like to announce the first public release of cmd2, an extension of > the standard library's cmd with argument parsing, here: > https://github.com/anntzer/cmd2. > Due to an already existing Cmd2 on PyP

issubclass(C, Mapping) not behaving as expected

2012-05-30 Thread anntzer . lee
from collections import * class C(object): def __iter__(self): pass def __contains__(self, i): pass def __len__(self): pass def __getitem__(self, i): pass issubclass(C, Mapping) => False [issubclass(C, cls) for cls in Mapping.__mro__] => [False, True, True, True, True] i.e. C does

gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow)

2013-08-31 Thread anntzer . lee
Hi, At startup, IPython (qtconsole) calls "socket.gethostbyname_ex(socket.gethostname())[2]" to find a list of IP addresses that point to the machine. On a Linux server that I manage this call is extremely slow (>20s)... which I have trouble understanding as "ip addr show" seems to give the sa

Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow)

2013-08-31 Thread anntzer . lee
It is the call to gethostbyname_ex that is very slow. The call to gethostname is quick (and returns the same string as /usr/bin/hostname). On Saturday, August 31, 2013 6:01:00 PM UTC-7, Roy Smith wrote: > In article , > > anntzer@gmail.com wrote: > > > > > Hi, > > > > > > At startup,

Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow)

2013-09-01 Thread anntzer . lee
On Saturday, August 31, 2013 10:06:43 PM UTC-7, Michael Torrie wrote: > On 08/31/2013 10:51 PM, anntzer@gmail.com wrote: > > > It is the call to gethostbyname_ex that is very slow. The call to > > gethostname is quick (and returns the same string as > > /usr/bin/hostname). > > What gethostby

Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow)

2013-09-01 Thread anntzer . lee
On Sunday, September 1, 2013 4:37:34 AM UTC-7, Chris Angelico wrote: > Yes, it most definitely CAN be a network config issue. The C function > you want to be calling is getifaddrs(), and I don't think there's a > way to call that from core Python. But a Google search for 'python > getifaddrs' show

Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow)

2013-09-01 Thread anntzer . lee
On Sunday, September 1, 2013 2:03:56 PM UTC-7, Chris Angelico wrote: > > I tried using netifaces (https://pypi.python.org/pypi/netifaces) which > > seems to rely on getifaddrs (according to the doc, I didn't check the > > source). Again, it returns nearly instantaneously the correct IP address.

Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow)

2013-09-02 Thread anntzer . lee
On Monday, September 2, 2013 5:45:26 AM UTC-7, Roy Smith wrote: > In article <00843d58-db21-4cf0-9430-85362a1dd...@googlegroups.com>, > anntzer@gmail.com wrote: > > > As it happens I found a better way: just add the proper entry to /etc/hosts. > > You have not found a better way. You still