Re: Big development in the GUI realm

2005-02-11 Thread Jorge Luiz Godoy Filho
Max M wrote:

> GPL is not suitable for all kinds of software. It's nice if you are
> sharing code with others, but if you are developing something like a
> desktop application that you want to sell for money, using the GPL is a
> bad idea.

If you're earning money, why not pay for the libraries that allowed you to
do so?


Be seeing you,
Godoy.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Postgres and SSL

2005-02-11 Thread Jorge Luiz Godoy Filho
Greg Lindstrom wrote:

> I'm on a Linux box running python 2.3 and would like to connect to a
> postgres database via SSL, but have not been able to find a module to do
> this (or haven't figured out the syntax).  Can anyone help me out?

With both psycopg and pypgsql it depends on how your libpq was compiled.  If
the libraries from your PostgreSQL installation were compiled to support
SSL, then you can connect to the server without any problems. 


Be seeing you,
Godoy.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ElementTree cannot parse UTF-8 Unicode?

2005-01-20 Thread Jorge Luiz Godoy Filho
Fredrik Lundh, Quinta 20 Janeiro 2005 05:17, wrote:

> what does it give you on your machine?  (looks like wxPython cannot handle
> Unicode strings, but can that really be true?)

It does support Unicode if it was built to do so... 

-- 
Godoy. <[EMAIL PROTECTED]>

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Accessing MDB files on Windows

2005-01-19 Thread Jorge Luiz Godoy Filho
Jorge Luiz Godoy Filho, Quarta 19 Janeiro 2005 15:17, wrote:

> Hmmm...   I see.  I'm trying to avoid having to install external modules
> at
> my client's server.  Should I use, given that both DAO and ODBC are
> available with the win32all extensions, DAO or ODBC?
> 
> Or would ADO give me so much more performance that I should really use it?

I've also made it work with ADO...  It doesn't require me to use the
'makepy' on it, so this might be a better choice if I have to deploy for
more machines.

I think I'll go with ADO.


Thanks Larry and Steve.

-- 
Godoy. <[EMAIL PROTECTED]>

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Accessing MDB files on Windows

2005-01-19 Thread Jorge Luiz Godoy Filho
Jorge Luiz Godoy Filho, Quarta 19 Janeiro 2005 14:25, wrote:

> Thanks!  I'm looking at it.

Worked like a charm!  And just now I noticed who's the author of the
recipe ;-)


Thanks!
-- 
Godoy. <[EMAIL PROTECTED]>

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Accessing MDB files on Windows

2005-01-19 Thread Jorge Luiz Godoy Filho
Steve Holden, Quarta 19 Janeiro 2005 14:38, wrote:

> Note that DAO is a very old library, and nowadays ADO would probably be
> the preferred method in the Windows environment (can DAO even *use*
> oledb providers?). ADO libraries are available - see
> 
>http://www.markcarter.me.uk/computing/python/ado.html
> 
> for example, or Google for "python ado". Bottom line, there are many
> ways to skin this particular cat.

Hmmm...   I see.  I'm trying to avoid having to install external modules at
my client's server.  Should I use, given that both DAO and ODBC are
available with the win32all extensions, DAO or ODBC?

Or would ADO give me so much more performance that I should really use it?

-- 
Godoy. <[EMAIL PROTECTED]>

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Accessing MDB files on Windows

2005-01-19 Thread Jorge Luiz Godoy Filho
Larry Bates, Quarta 19 Janeiro 2005 14:01, wrote:

> I'm assuming the application will be run on Windows.

You're right.  It will be run on Windows.  I discarded some other platform
due to the difficulty of supporting this file format.
 
> You can use ODBC or DAO.
> 
> An DAO solution that I wrote (and use) can be found
> at:
> 
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303349

Thanks!  I'm looking at it. 

> For ODBC you would just use the standard library module.

Thanks.  I'll be trying the DAO first.

-- 
Godoy. <[EMAIL PROTECTED]>

-- 
http://mail.python.org/mailman/listinfo/python-list


Accessing MDB files on Windows

2005-01-19 Thread Jorge Luiz Godoy Filho

Hi,


What is the best way to deal with MDB files?  I was thinking on using
ODBC...  I'll need to read and write some information to it.  The load
won't be so high, but there might be a lot of data. 

Any advices?  Will my approach work?  I'm not a Windows guy... :-)

-- 
Godoy. <[EMAIL PROTECTED]>

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python mode indentation problem

2005-01-15 Thread Jorge Luiz Godoy Filho
Xah Lee, SÃbado 15 Janeiro 2005 13:24, wrote:

> does anyone know why the Python mode in emacs uses spaces for first
> level indentation but one tab for second level?
> 
> i'm using emacs 21.3.50.1.
> Xah
>  [EMAIL PROTECTED]
>  http://xahlee.org/PageTwo_dir/more.html

It doesn't.  It uses spaces for everything, unless told otherwise. 

-- 
Godoy. <[EMAIL PROTECTED]>

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: get the IP address of a host

2005-01-07 Thread Jorge Luiz Godoy Filho
Kartic, Quarta 05 Janeiro 2005 14:08, wrote:

> socket.gethostbyaddr(socket.gethostname())
> 
> will return a tuple containing fully qualified hostname,  alternative
> hostnames, ip addresses (>1 if multihomed).
>
> or
> 
> socket.gethostbyname(socket.gethostname())

None of these work with computers with more than one interface...  They get
only one of them.  It would be safer, then, to specify the desired
interface or use an alternative method.

-- 
Godoy. <[EMAIL PROTECTED]>

-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Pexpect getting a defuct process

2005-01-04 Thread Jorge Luiz Godoy Filho
Baillargeon, Sonny, TerÃa 04 Janeiro 2005 16:16, wrote:

> Nothing...I know that's the default answer but considering I control the
> environment, I can assure you that nothing changed.

I have no reason to doubt you.  :-)

Checking pexpect's documentation, and re-reading your code I see that you
have not called "close()".  As the documentation says:

(http://pexpect.sourceforge.net/doc/pexpect.html)
"""
close(self, wait=1)
(...)
Only set wait to false if you know the child will
continue to run after closing the controlling TTY.
Otherwise you will end up with defunct (zombie) processes.
"""


Be seeing you,
-- 
Godoy. <[EMAIL PROTECTED]>

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pexpect getting a defuct process

2005-01-04 Thread Jorge Luiz Godoy Filho
Baillargeon, Sonny, TerÃa 04 Janeiro 2005 14:42, wrote:

> This used to work before but now I get a defunct process after it runs.
> Any ideas?

"before" what?  What has changed in your environment to make it stop
working? 

-- 
Godoy. <[EMAIL PROTECTED]>

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: standard IDE in python 3000 (or beyond)? *semi-newbie*

2004-12-30 Thread Jorge Luiz Godoy Filho
mrkurt, Quinta 30 Dezembro 2004 14:39, wrote:

> About the closest thing to what Mike might want is Boa Constructor,
> which does have a GUI building tool.  It is not as polished as the
> Visual Studio GUI builder, but there are a lot of controls there that
> can be used.  It requires the wxWindows toolkit.

It has another advantage as well: it can be improved by *us*, the community.  

I am looking at Eclipse for a while and it is interesting, but too heavy,
indeed.  
 

-- 
Godoy. <[EMAIL PROTECTED]>

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyQT installation

2004-12-30 Thread Jorge Luiz Godoy Filho
Steve Holden, Quinta 30 Dezembro 2004 14:13, wrote:

> If that is a real *never* then Qt just fell behind in the "what's the
> best GUI platform" stakes. It'd be a shame to lose PyQT, but if there's
> no way to migrate it forwards it will atrophy and die. Have TrollTech
> said they will never issue MSVC 7 binaries?

"non-commercial" binaries he said...  I hope it is just the non-commercial
really, 'cause the look & feel of Qt is very nice.
 
> Is there no way to use the free Microsoft toolchain to compile, or do
> the language differences just make the whole deal too difficult (or is
> there some other show-stopper that my ignorance prevents me from seeing?).

Isn't it possible to compile everything with a free compiler?  I'm not a
Windows user, but... :-)


-- 
Godoy. <[EMAIL PROTECTED]>

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Updating file objects automatically

2004-12-30 Thread Jorge Luiz Godoy Filho
Jorge Luiz Godoy Filho, Quinta 30 Dezembro 2004 09:20, wrote:

> It helps, yes.  Putting the object on the class instead of on an instance
> of
> it might (I'm 99.9% sure) solve the problem.  (I have already done that
> for other object that is shared, but I didn't remember doing that for
> this)

And, as expected, it worked.  Thanks for the help, Craig.

-- 
Godoy. <[EMAIL PROTECTED]>

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Updating file objects automatically

2004-12-30 Thread Jorge Luiz Godoy Filho
Craig Ringer, Quinta 30 Dezembro 2004 06:27, wrote:

> I couldn't really catch your explanation, but mention of changing all
> instances of a class suggests that you may be in a situation where you
> need to modify the class, not its instances. There are two methods I use
> when I have to change things across all instances:

I'm sorry.  It was late here and I've been coding this and other things for
near 14h in a row...  I think that even I wouldn't understand that if I
weren't working with it :-)

> I have no idea if that's actually appropriate for your needs, it's just
> a stab in the dark, but perhaps it might be.

It helps, yes.  Putting the object on the class instead of on an instance of
it might (I'm 99.9% sure) solve the problem.  (I have already done that for
other object that is shared, but I didn't remember doing that for this)


Thank you.  You helped a lot to make me "see" it :-)

-- 
Godoy. <[EMAIL PROTECTED]>

-- 
http://mail.python.org/mailman/listinfo/python-list


Updating file objects automatically

2004-12-29 Thread Jorge Luiz Godoy Filho

Hi,


I have the following situation where I only open the file on the Search
class (where it should be used more often) and I want to reutilize search
methods to find the exact location of where the changes should occur.  In
code terms, I have something like:

===
class Search(object):
def __init__(self, fileToRead):
self.fileToRead = open(fileToRead)
(definition of several search methods)

class Writer(Search):
def __init__(self, fileToRead, fileToWrite=None):
super(Writer, self).__init__(fileToRead)
super(Search, self).__init__(fileToRead)
(definition of write methods)

def exampleMethod(self):
place = self.searchSomeParticularCondition() # method from 
Search
place.change.values('old', 'new')
self.fileToRead.write(all_things) # object from Search

search = Search('someFile')
print "Information:", search.something()
change = Writer('someFile')
change.exampleMethod()
# here if I do another search, with "search.something('id')" I get the old 
# value ...
print search.something('id') # prints old data
# ... I want the new one, so I reassign the search instance:
search = Search('someFile')
print search.something('id') # prints new data
===

Is there something I can do to change all instances of the Search class? 
Are there different alternatives for such a "thing"?


Thanks in advance,
-- 
Godoy. <[EMAIL PROTECTED]>

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: consequences of not calling object.__init__?

2004-12-28 Thread Jorge Luiz Godoy Filho
Peter Hansen, Quarta 29 Dezembro 2004 01:04, wrote:

> Maybe there's no such pronouncement, but unless there is a
> clear statement somewhere (and I believe I've missed it, if
> there is) that reads "one should *always* call __init__ on the
> superclass even if one is just subclassing object and not
> dealing with multiple inheritance situations", then I would
> submit that the majority of Python code written using new-style
> classes would be broken should what you suggest above ever
> actually happen...  starting with much of the code in the
> standard library (based on a quick glance at those modules
> whose contents match the re pattern "class .*(object):" .

Things are kind weird at this point, since there are too many things to
think about and to make a decision on what should be done and what is
recommended to be done...

Quoting from http://www.python.org/peps/pep-0008.html:

"""
(...)
Designing for inheritance
(...)
  Also decide whether your attributes should be private or not.
  The difference between private and non-public is that the former
  will never be useful for a derived class, while the latter might
  be.  Yes, you should design your classes with inheritence in
  mind!
(...)
"""

So, I don't really know which is correct: to always call the constructor of
the parent class or just do that when it is needed by design... 

I think that based on the above quotation from PEP-0008 code in the standard
library should be calling the parent class constructor.  But then, I'm one
of the people who never do that :-)

-- 
Godoy. <[EMAIL PROTECTED]>

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to pass globals across modules (wxPython)

2004-12-22 Thread Jorge Luiz Godoy Filho
Fredrik Lundh, TerÃa 21 Dezembro 2004 16:33, wrote:

> well, in my applications, subsystems usually consists of one or more
> classes, or at least
> one or more functions.  code that needs the global context usually gets
> the content either as a constructor argument, or as an argument to
> individual methods/functions.

I see.  Differences in terminology.  We use the same approach as you do. 


Be seeing you,
Godoy.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to pass globals across modules (wxPython)

2004-12-21 Thread Jorge Luiz Godoy Filho
Fredrik Lundh, TerÃa 21 Dezembro 2004 14:02, wrote:

> or a single "application context class" instance, which is passed to
> various parts of the system as necessary.

Wouldn't that cause a chicken & egg problem?  How, then, would one pass such
an instance across modules?

I'm sorry for my ignorance, but I'm a lot more slow than usually today and I
might have missed your point :-)


Be seeing you,
Godoy.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to pass globals across modules (wxPython)

2004-12-21 Thread Jorge Luiz Godoy Filho
Peter Hansen, Segunda 20 Dezembro 2004 08:01, wrote:

> An even better approach might be to find a way to avoid
> having to access the main window through a global, but
> I'll have to leave this up to you, as it may depend on
> your program structure.

This might be a problem also to share a database connection, where one needs
to pass the open and authenticated connection to several specialized
modules. 

Maybe a module where you can access that should be a better option...

Be seeing you,
Godoy.
-- 
http://mail.python.org/mailman/listinfo/python-list