Re: How to get/set class attributes in Python

2005-06-12 Thread Axel Straschil
Hello! > You can 'hide' you getsetters using a property attribute[1]: For me, the property attribute is a beast: class A(object): def getP(self): return 'A' p = property(getP) class A2(A): def getP(self): return 'A2' a = A() a2 = A2() print a.getP(), a2.getP() print a.p,

Re: Reusing object methods?

2005-04-29 Thread Axel Straschil
Hello! Why not: > class A: > def a_lengthy_method(self, params): > # do some work depending only on data in self and params > > class B(A): pass ? Lg, AXEL. -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple inheritance: Interface problem workaround, please comment this

2005-04-11 Thread Axel Straschil
Hallo! > Look at the comment in the code! I have posted the "decorate" module in Uuups, sorry, I'll RTFM myselfe *g* Lg, AXEL. -- "Aber naja, ich bin eher der Forentyp." Wolfibolfi's outing in http://www.informatik-forum.at/showpost.php?p=206342&postcount=10 -- http://mail.python.org/mailman/

Re: Multiple inheritance: Interface problem workaround, please comment this

2005-04-09 Thread Axel Straschil
Hello! > from decorate import decorate # see today thread on decorators for this Gives me an ImportError: No module named decorate. I've got to donwload that? (python 2.4) Thanks, AXEL. -- "Aber naja, ich bin eher der Forentyp." Wolfibolfi's outing in http://www.informatik-forum.at/showpost.ph

Re: Can dictionary values access their keys?

2005-04-08 Thread Axel Straschil
Hello! > thousands more entries. So we're talking about maybe a million+ total > nested key:values. I don't know if that counts as large or not. I can't > even guess how much k memory that is. Mhh, maybe you should use a SQL-Database ;-) Lg, AXEL. -- "Aber naja, ich bin eher der Forentyp." Wolf

Re: Can dictionary values access their keys?

2005-04-08 Thread Axel Straschil
Hello! > If I have a simple dictionary, where the value is a class or function, > is there an interface through which it can discover what its key is? The key of a value may not be unique, so you can also get a tupe of keys, like dict(a=1, b=1), the key's of 1 are a and b. For unique values, I d

Re: Multiple inheritance: Interface problem workaround, please comment this

2005-04-07 Thread Axel Straschil
Hello! > (1) make A or B a mixin class that doesn't need __init__ called, or Would be a solution for classes that just give functionality, no data-structures. In that case, i would use functions, no classes ;-) I've seen code where there are classes without init and the hope that self has wh

Multiple inheritance: Interface problem workaround, please comment this

2005-04-07 Thread Axel Straschil
Hello! I'm working on an HTML/Cgi widget's class where multiple inheritance well be sometime a great thing. I solved all my problems for pythons multiple inheritance with this ng, thaks to all again, but there is one think I still dislike: class A(object): def __init__(self, a=None, **__

Re: Python IDE like NetBeans/Delphi IDE

2005-04-05 Thread Axel Straschil
Hello! > WingIDE (commercial, slower than PythonWin but has many features) You can use and reactivate a trial licence for WingIDE for a realy long term, give it a try, i bought a licence last week and realy love it! Lg, AXEL. -- "Aber naja, ich bin eher der Forentyp." Wolfibolfi's outing in ht

Re: Generating RTF with Python

2005-03-31 Thread Axel Straschil
Hello! > I looked at this a while ago, which might be a starter. > http://pyrtf.sourceforge.net/ Don't remember why I didn't spent much time on that. Sombody has experience with pyrtf on an production project (is it stable ;-)) Lg, AXEL. -- "Aber naja, ich bin eher der Forentyp." Wolfibolfi's o

Re: Generating RTF with Python

2005-03-31 Thread Axel Straschil
Hello! > does anyone know of a high-level solution to produce RTF from Python=20 > (something similar to > Reportlab for producing PDF)? Spend hours of googeling and searching, also in this NG, about two months ago. My conclusion is: On windwos, maybe you can include some hacks with dll's, under

Re: Calling __init__ with multiple inheritance

2005-03-29 Thread Axel Straschil
Hello! >> Also, lool at that: >> class Mother(object): >> def __init__(self, param_mother='optional', **eat): >> print 'Mother' >> class Father(object): >> def __init__(self, param_father='optional', **eat): >> print 'Father' >> class Child(Mother, Father): >> def __init__(self, **ham): >> super(C

Re: Calling __init__ with multiple inheritance

2005-03-28 Thread Axel Straschil
Hello! Thanks to all for the very interesting postings! I came to the following: For single inheritance, super is a nice tool if you will recfactoring the class later. For multiple inheritance, if you want to use super, you have to have very much knowledge of the classes you inheritance. For m

Calling __init__ with multiple inheritance

2005-03-28 Thread Axel Straschil
Hello! Im working with new (object) classes and normaly call init of ther motherclass with callin super(...), workes fine. No, I've got a case with multiple inherance and want to ask if this is the right and common case to call init: class Mother(object): def __init__(self, param_mother)

Re: Generating modul classes with eval

2005-02-03 Thread Axel Straschil
Hello! > After the loop has finished, the global variable TmpClass will be bound to > whatever class was created last, and the variable class_base will be bound > to that the base class of that same TmpClass. Therefore only this last class > is guaranteed to work as expected. Great, now it workes

Re: Generating modul classes with eval

2005-02-03 Thread Axel Straschil
Hello! > Note that we don't need eval anywhere. Uuups, that looks realy cool! Thanks for that! Im fooling around with generating html-tags. As there are only two kind of html tags, one who can nest chields, and one who cant, i wantet to play arround with something like: I've got two base classe

Generating modul classes with eval

2005-02-02 Thread Axel Straschil
Hello! I was fooling around with creating classes for a module with eval, something like: MyModule.py: class Base: init(self, name): self._name = name for myclass in ['A', 'B', 'C']: code="class %s(Base):\n\tinit(self, name='%s')\n\t\tsuper(%s, self).__in

Re: Html or Pdf to Rtf (Linux) with Python

2004-12-17 Thread Axel Straschil
Hello! > You might take a look at PyRTF in PyPI. It's still in beta, I think PyRTF would be the right choice, thanks. Yust had a short look at it. Lg, AXEL. -- The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in thi

Re: Html or Pdf to Rtf (Linux) with Python

2004-12-16 Thread Axel Straschil
Hello! > I've been able to successfully get konqueror to generate a pdf from a > html file via dcop. It's something along the lines of: For that stuff, I'm using htmloc (http://www.htmldoc.org/). Lg, AXEL. -- The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD

Re: Html or Pdf to Rtf (Linux) with Python

2004-12-16 Thread Axel Straschil
Hello! > That's easy. Load the HTML in MS Word, and save it as RTF. Script it > via COM using the python win32all (I think that's what it's now > called) package. As I wrote in my posting and the subject: linux ;-) I could try to do this with open office, by I'm afraid this will not be a performa

Re: Html or Pdf to Rtf (Linux) with Python

2004-12-15 Thread Axel Straschil
Hallo! However, our company's product, PDFTextStream does do a phenomenal job of extracting text and metadata out of PDF documents. It's crazy-fast, has a clean API, and in general gets the job done very nicely. It presents two points of compromise from your idea situation: 1. It only produces

Re: Html or Pdf to Rtf (Linux) with Python

2004-12-14 Thread Axel Straschil
Hello! Sorry Cameron, I was replying, now my folloup ;-): > Are you trying to convert one document in particular, or automate the > process of conveting arbitrary HTML documents? I have an small CMS System where the customer has the posibility to view certain Html-Pages as Pdf, the CMS ist Pytho