get date from email

2011-12-01 Thread Thomas Guettler
.mktime_tz(date_tuple)) if date: ... # valid date found Somehow this looks too complicated. Any chance to integrate the datetime module into the email module? related: http://stackoverflow.com/questions/1790795/python-parsing-date-with-timezone-from-an-email -- Thomas Guettler, http://

Re: HeaderParseError

2011-07-05 Thread Thomas Guettler
On 04.07.2011 13:20, Peter Otten wrote: > Thomas Guettler wrote: > >> On 04.07.2011 11:51, Peter Otten wrote: >>> Thomas Guettler wrote: >>> >>>> I get a HeaderParseError during decode_header(), but Thunderbird can >>>> display the nam

Re: HeaderParseError

2011-07-04 Thread Thomas Guettler
On 04.07.2011 11:51, Peter Otten wrote: > Thomas Guettler wrote: > >> I get a HeaderParseError during decode_header(), but Thunderbird can >> display the name. >> >>>>> from email.header import decode_header >>>>> > decode_header('=?i

HeaderParseError

2011-07-04 Thread Thomas Guettler
"", line 1, in File "/usr/lib64/python2.6/email/header.py", line 101, in decode_header raise HeaderParseError email.errors.HeaderParseError How can I parse this in Python? Thomas Same question on Stackoverflow: http://stackoverflow.com/questions/6568596/heade

Re: Is the Usenet to mailing list gateway borked?

2011-06-30 Thread Thomas Guettler
responsible *please* fix this? I am willing to provide > assistance, see also my suggestion in > <news:5337093.9j7nak4...@pointedears.de>. Hi, Who is responsible? I think in the past there were not many broken threads. I wonder what changed this. Thomas -- Thomas Guettler, http

coverage.py: Highlight hot spots in source code

2011-06-22 Thread Thomas Guettler
don't have a nice HTML output for every python source file. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: best book about Webdesign with Django

2011-06-09 Thread Thomas Guettler
h about CSS and Javascript. I guess you need buy two books :-) Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: hashlib in one line

2010-11-29 Thread Thomas Guettler
Thank you, I was blind: See "condensed": http://docs.python.org/library/hashlib.html Stefan Sonnenberg-Carstens wrote: > Am 29.11.2010 14:50, schrieb Thomas Guettler: >> Hi, >> >> I think it would be nice if you could use the hashlib in one line: >> >&g

hashlib in one line

2010-11-29 Thread Thomas Guettler
Hi, I think it would be nice if you could use the hashlib in one line: hashlib.sha256().update('abc').hexdigest() Unfortunately update() returns None. Is there a way to convert a string to the hexdigest of sha256 in one line? Thomas -- Thomas Guettler, http://www.thomas-guet

Re: non-blocking IO EAGAIN on write

2010-07-26 Thread Thomas Guettler
John Nagle wrote: > On 7/23/2010 1:45 AM, Thomas Guettler wrote: >> Hi, >> >> I use non-blocking io to check for timeouts. Sometimes I get EAGAIN >> (Resource temporarily unavailable) >> on write(). My working code looks like this. But I am unsure how many >>

non-blocking IO EAGAIN on write

2010-07-23 Thread Thomas Guettler
lt) else: raise Exception('Too many EAGAIN on write %s %s' % (cmd, exc), exc_info=True) Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: Imports again...

2010-04-09 Thread Thomas Guettler
ject, and/or > how I can clean up the file structure and imports to avoid problems > like this in the future? Thanks in advance for any help, and I > apologize for the broken link the other day. > -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guet

crypto: verify external pkcs7 signature

2010-03-24 Thread Thomas Guettler
.load_pkcs7('secKey.pkcs7') try: print s.verify(p7, File(open(file))) except (M2Crypto.SMIME.PKCS7_Error, M2Crypto.SMIME.SMIME_Error), exc: print '%s failed: %s' % (file, str(exc).strip()) return False return True }}} -- Thomas Guettler, h

Re: Parsing Email Headers

2010-03-12 Thread Thomas Guettler
e! You retrieve the whole message (you don't save bandwith), but maybe that's what you want. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: os.rename [Errno 31] Too many links

2010-03-10 Thread Thomas Guettler
ook at the open file descriptors of a running process like this: ls -l /proc/PID/fd/ But I guess it is a limitation of your filesystem. What do you use? I once had this problem with ext2. It has a low limit for subdirectories. With xfs the limits are much greater. Thomas -- Thomas Guettler, h

SMTPException: No suitable authentication method found (Server: Microsoft ESMTP MAIL Service)

2010-01-14 Thread Thomas Guettler
50-8BITMIME 250-BINARYMIME 250 CHUNKING The same happens if I use TLS. Any hints? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

'classmethod' object has only read-only attributes

2009-11-25 Thread Thomas Guettler
/tmp/t.py", line 1, in class Foo(object): File "/home/user/tmp/t.py", line 5, in Foo bar.myattr='test' TypeError: 'classmethod' object has only read-only attributes (assign to .myattr) -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettl

Re: PyGTK problems after Linux update...

2009-08-28 Thread Thomas Guettler
Looks like your pygtk package does not fit to the installed python package. > from glib._glib import * > ImportError: /usr/lib/python2.6/site-packages/gtk-2.0/glib/_glib.so: > undefined symbol: PyUnicodeUCS4_DecodeUTF8 -- Thomas Guettler, http://www.thomas-guettler.d

Re: os.popen output different from native shell output

2009-08-25 Thread Thomas Guettler
In one of the first chapters of "Advanced programming in the unix environment (second edition)" there is explained how a unix shell works. You could write you own shell using python. This way the python interpreter gets stared only once, and not for every call to "ls". Have fun, Thomas nickn

Re: os.popen output different from native shell output

2009-08-25 Thread Thomas Guettler
the ls command natively > from the shell (not via python). I display the ouput via python by > using the print function on the variable that accepts the os.popen > ().read() function. ... Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --

Re: best way to display photos

2009-08-24 Thread Thomas Guettler
caling to fit my screen? > How is its performance? Is there any other possibilities that I've > missed? Thanks. -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: Workflow Libraries (DB vs Code)

2009-07-22 Thread Thomas Guettler
Diez B. Roggisch schrieb: > Thomas Guettler wrote: > >> Hi, >> >> I need to write some simple workflows with web interface. >> >> For the web stuff I will use django, but I am not sure how >> to do the workflow part. > > Did you consider using

Workflow Libraries (DB vs Code)

2009-07-21 Thread Thomas Guettler
I prefer python. Feedback welcome, Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: Mutable Strings - Any libraries that offer this?

2009-07-21 Thread Thomas Guettler
ers. It would not be difficult to implement this as a class with all fancy methods like startswith() ... Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: logging of strings with broken encoding

2009-07-03 Thread Thomas Guettler
Stefan Behnel schrieb: > Thomas Guettler wrote: >> My quick fix is this: >> >> class MyFormatter(logging.Formatter): >> def format(self, record): >> msg=logging.Formatter.format(self, record) >> if isinstance(msg, str): >>

Re: logging of strings with broken encoding

2009-07-02 Thread Thomas Guettler
see any logging messages. Thomas Thomas Guettler schrieb: > Hi, > > I have bug in my code, which results in the same error has this one: > ... -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

logging of strings with broken encoding

2009-07-02 Thread Thomas Guettler
;view=markup I think msg.encode("UTF-8", 'backslashreplace') would be better here. What do you think? Should I fill a bugreport? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: Advanced Python books?

2009-05-19 Thread Thomas Guettler
magic of all web apps into one chapter. GUI-apps: You can use tkinter, qt or gtk again it would be hard to put something useable into one chapter. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: file locking...

2009-03-02 Thread Thomas Guettler
arallel, in that I'd > like to have multiple processes each access a unique group of files from the > given dir as fast as possible. > > So.. Any thoughts/pointers/comments would be greatly appreciated. Any > pointers to academic research, etc.. would be useful. > > tha

Re: OT: handling multiple software repositories

2009-02-27 Thread Thomas Guettler
t. But the page looks like it is not ready for public. But it looks promising. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

OT: handling multiple software repositories

2009-02-26 Thread Thomas Guettler
http://trac.edgewall.org/wiki/MultipleRepositorySupport -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: Start Python at client side from web app

2009-01-22 Thread Thomas Guettler
Paul Rubin schrieb: > Thomas Guettler writes: >> 1. The user pushes a button in the web app. >> 2. Webserver sends signed python code to the client with own mime type >> 3. IE sends code to the python application. >> 4. Signature gets checked, Python code on the client

Re: Start Python at client side from web app

2009-01-22 Thread Thomas Guettler
guess that's not very easy, since I am not used to windows programming. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: Start Python at client side from web app

2009-01-22 Thread Thomas Guettler
Bryan Olson schrieb: > Thomas Guettler wrote: >> Sorry, I described my problem not well. Here is more information: > > Actually you did pretty well. > > [...] >> The main application is the intranet web application used with IE (ms >> windows client). > >

Re: Start Python at client side from web app

2009-01-21 Thread Thomas Guettler
pp. 2. Webserver sends signed python code to the client with own mime type 3. IE sends code to the python application. 4. Signature gets checked, Python code on the client gets executed. 5. Maybe send some data to the server with http. Thomas Server runs Linux with Django and Postgres. Thomas Gue

Start Python at client side from web app

2009-01-21 Thread Thomas Guettler
refer to use some open source project, if it exists. Thanks in advance, Thomas Güttler -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: Force exception on attribute write access only one object

2009-01-09 Thread Thomas Guettler
"/localhome/modw/django/forms/models.py", line 315, in save if self.instance.pk is None: File "/localhome/modw/django/db/models/base.py", line 292, in _get_pk_val return getattr(self, meta.pk.attname) AttributeError: 'MyAction' object has no attribute

Force exception on attribute write access only one object

2009-01-08 Thread Thomas Guettler
now where. -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: eval('07') works, eval('08') fails, why?

2009-01-08 Thread Thomas Guettler
Hi, 07 is octal. That's way 08 is invalid. Try this: ===> python >>> print 011 9 >>> print int('011') 11 -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: What would you like to see in a book about Matplotlib?

2009-01-07 Thread Thomas Guettler
anted to see grouped up but couldn't find? The API is not good documented. It was very hard for me to understand what was going on the source. > - what would you like to see in a book about matplotlib? How to use the API. Thomas -- Thomas Guettler, http://www.thomas-guettler.de

Re: Which PostgreSQL adapter to use?

2008-11-04 Thread Thomas Guettler
Hussein B schrieb: > Hey, > Which Adapter to use with PostgreSQL: > PyPgSQL, psycopg or PyGreSQL? > Thanks. I think psycopg2 is a good choice. Never tried anything else. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler

urlencode() doseq and Python 3.0

2008-10-30 Thread Thomas Guettler
t really wants this: >>> urllib.urlencode({'key': ['value1', 'value2']}) 'key=%5B%27value1%27%2C+%27value2%27%5D' I think this is what most people want: >>> urllib.urlencode({'key': ['value1', 'value2']}, doseq

Re: parse a table in HTML page.

2008-10-28 Thread Thomas Guettler
y > > It works fine aside from link in href. > > Example: > > String to parse: > elognormal text > > Output: > [[['elog', 'normal text']]] > > as you can see it misses the info about href... > how can get this information 'vaff

Re: Python Imaging Library Question

2008-10-23 Thread Thomas Guettler
ay to overload the Ghostcript function in the > EpsImagePlugin.py file or to overload the plugin or to write a custom > plugin without interfering with the PIL? > The question hopefully seems trivial to a python programmer.. Hi, you can call gs yourself with e.g. the module subprocess. Th

Re: Event-driven framework (other than Twisted)?

2008-10-01 Thread Thomas Guettler
I'm looking for alternatives. Please explain what you want to do. Maybe the spread toolkit can help you: http://www.spread.org/index.html HTH, Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: Python script for tracert

2008-10-01 Thread Thomas Guettler
;www.microsoft.com' p = subprocess.Popen(["tracert", '-d', '-w', '100', host], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) while True: line = p.stdout.readline() if not line: break print '-->',line, p.wait() -- Thomas Guettler,

Re: Better error message on recursive import

2008-09-12 Thread Thomas Guettler
ost recent call last): File "one.py", line 1, in from two import testtwo File "/mnt/home/tguettler/tmp/rec/two.py", line 1, in import one File "/mnt/home/tguettler/tmp/rec/one.py", line 1, in from two import testtwo ImportError: cannot import name tes

Better error message on recursive import

2008-09-11 Thread Thomas Guettler
Hi, why does Python only raise ImportError if it fails caused by a recursive import? I know what's wrong. But I guess many beginner don't know what's wrong. I don't want much, just "RecursiveImportError" instead of "ImportError". Is this possi

Re: Trying ZODB, background in Relational: mimic auto_increment?

2008-08-14 Thread Thomas Guettler
witched from ZODB to Postgres. HTH, Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: DB-API corner case (psycopg2)

2008-08-01 Thread Thomas Guettler
eturn self.cursor.execute(sql) What do you think? Thomas Thomas Guettler schrieb: > Hi, > > I discovered this: > > import psycopg2 > connection=psycopg2.connect("dbname='...' user='...'") > cursor=connection.cursor() > cursor.execute(&#

DB-API corner case (psycopg2)

2008-08-01 Thread Thomas Guettler
#x27; ''', ()) # Does fail Traceback (most recent call last): File "/localhome/modw/tmp/t.py", line 5, in cursor.execute('''SELECT '%' ''', ()) # Does fail IndexError: tuple index out of range Is this a bug in psycopg2? How d

Re: Standard module for parsing emails?

2008-07-30 Thread Thomas Guettler
Phillip B Oldham schrieb: Is there a standard library for parsing emails that can cope with the different way email clients quote? What do you mean with "quote" here? 1. Encode utf8/latin1 to ascii 2. Prefix of quoted text like your text above in my mail Thomas -- Thomas Guet

Re: Scripting SAP GUI (Windows)

2008-07-02 Thread Thomas Guettler
I just got this link in a german newsgroup: http://pywinauto.openqa.org/ Seems to be what I was looking for. Nevertheless feedback still welcome. Thomas Guettler schrieb: Hi, I need to script SAP GUI running on MS-Windows: Open SAP GUI window, if it is not already open, and then batch input

Scripting SAP GUI (Windows)

2008-07-02 Thread Thomas Guettler
. - pyHook - user pywin32 and SetWindowsHookEx I develop with python since seven years, but only on linux. Any hints? -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: Image Processing (batch)

2008-06-04 Thread Thomas Guettler
Weinhandl Herbert schrieb: Thomas Guettler schrieb: Hi, I tried PIL for image batch processing. But somehow I don't like it - Font-Selection: You need to give the name of the font file. - Drawing on an image needs a different object that pasting and saving. - The handbook is from Dec.

Image Processing (batch)

2008-06-03 Thread Thomas Guettler
there are these alternatives: - Python binding for image magick - python-gtk - python-gdk-imlib - call convert (imagemagick) with subprocess. This is how I did it up to now. But I want to avoid it. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-gue

Re: xml.etree Syntax of path?

2008-05-09 Thread Thomas Guettler
Stefan Behnel schrieb: Thomas Guettler wrote: I think the documentation of xml.etree is missing something[1]. {{{ find(path) Finds the first toplevel element with given tag. Same as getroot().find(path). path is the element to look for. }}} According to the source etree has limited

xml.etree Syntax of path?

2008-05-09 Thread Thomas Guettler
documented what 'path' should look like to. [1] http://docs.python.org/lib/elementtree-elementtree-objects.html -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

How to get inner exception traceback

2008-04-24 Thread Thomas Guettler
y the real error is hard to find. Sometimes I help myself and change (in this example) ImportError to e.g. IOError and then I can see the real root of the problem. But maybe there is a way to get the inner exception and its traceback. This could be displayed in the debug view. Thomas -- Thomas Guet

Re: is file open in system ? - other than lsof

2008-04-17 Thread Thomas Guettler
'fd') for file in os.listdir(fd_dir): try: link=os.readlink(os.path.join(fd_dir, file)) except OSError: continue print pid, link -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: Destructor?

2008-04-08 Thread Thomas Guettler
Duncan Booth schrieb: > [*] except of course for things like power failure. You simply cannot > catch *all* terminations. And 'kill -SIGKILL' can't be caught, since this signal never reaches the process. The os just removes the processes. Thomas -- Thomas Guettl

Re: wsdl (soap) without code generation

2008-04-04 Thread Thomas Guettler
... Thank you for your answers. I tried to parse the wsdl with two libraries. (axis2 (java) and SOAPPy). Both fail because there is no entry for 'service'. The wsdl is from SAP XI. Has someone hints? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli

wsdl (soap) without code generation

2008-04-02 Thread Thomas Guettler
ith my eyes and make a fitting soap call... Any thoughts? -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: simple web-server

2008-03-28 Thread Thomas Guettler
ted seems to be able to do a lot, so probably not the simple thing > I'm looking for. CherryPy looks promising, however it is still 89 > files (including some that can be removed). > > If CGIHTTPServer is a good answer, could you point me to a good > (nontrivial) example? >

Re: Web site for comparing languages syntax

2008-02-26 Thread Thomas Guettler
a, but it's good: http://pleac.sourceforge.net/ The Perl Cookbook gets translated to several other languages. -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: psycopg2: connect copy_from and copy_to

2008-02-20 Thread Thomas Guettler
[EMAIL PROTECTED] schrieb: > On Feb 19, 8:06 am, Thomas Guettler <[EMAIL PROTECTED]> wrote: >> Any suggestions? > > If you don't mind trying out some beta quality software, you can try > my pg_proboscis driver. It has a DBAPI2 interface, but for you to use &

Re: psycopg2: connect copy_from and copy_to

2008-02-19 Thread Thomas Guettler
> Doesn't PostGres come with Export/Import apps ? That would be easiest > (and faster). Yes, you can use "pg_dump production ... | psql testdb", but this can lead to dead locks, if you call this during a python script which is in the middle of a transaction. The python script locks a table, so tha

psycopg2: connect copy_from and copy_to

2008-02-19 Thread Thomas Guettler
Hi, I want to copy data from a production database to a testing database. Up to now I used psycopg2 and copy_from and copy_to with two cursors and a temporary file. This works, but it would be better, if the data gets piped from one cursor to the next without a temporary file. The psycopg2 metho

Resetting Signal Mask

2008-01-04 Thread Thomas Guettler
Hi, with mod_wsgi (apache2) a process created with os.system() has a modified signal mask, that SIGPWR gets ignored. A small wrapper (see bottom) resets the signal mask and uses execv to run the programm. Unfortunately python does not support sigprocmask. Is there any other way to reset the sign

Re: Different kinds of Import Errors

2007-12-04 Thread Thomas Guettler
Graham Dumpleton schrieb: > What example did you use to test it? What version of Python are you > using? Yes, this changed. Python 2.3 includes the half imported module. Python 2.4 does not. But the traceback of the exception contains the needed information: Here are the two example files: # fo

Re: Different kinds of Import Errors

2007-11-30 Thread Thomas Guettler
raham Dumpleton schrieb: > On Nov 28, 12:35 am, Thomas Guettler <[EMAIL PROTECTED]> wrote: >> If you look at this code, you see there are two kind of ImportErrors: >> >> 1. app_name has no attribute or file managment.py: That's OK. >> 2. managment.py exis

Re: Running unmodified CGI scripts persistently under mod_wsgi.

2007-11-28 Thread Thomas Guettler
Istvan Albert schrieb: > It will be awesome if mod_wsgi can run CGI without invoking python on > each access. For SCGI there is something like this: cgi2scgi: it is small executable written in C, which connects to a running SCGI server. Executing this small binary on every request is no big over

tcp traceroute

2007-11-28 Thread Thomas Guettler
Hi, I want to write a small tcp traceroute script. I works, but how can I get the IP of the hop that send 'no route to host'? Result: python tmp/tcptraceroute.py a.b.c.d 80 ttl=01: (113, 'No route to host') ttl=02: (113, 'No route to host') ttl=03: (113, 'No route to host') ttl=04: timed out ttl=

Different kinds of Import Errors

2007-11-27 Thread Thomas Guettler
If you look at this code, you see there are two kind of ImportErrors: 1. app_name has no attribute or file managment.py: That's OK. 2. managment.py exists, but raises an ImportError: That's not OK: reraise # Import the 'management' module within each installed app, to register # d

email.get_filename() with newline

2007-11-09 Thread Thomas Guettler
Hi, if I use part.get_filename() with the following email part: --_=_NextPart_001_01C81B11.52AB8006 Content-Type: application/vnd.ms-excel; name="=?iso-8859-1?Q?30102007=28aktualisiert=29=5FK=FCndigungen_enviaM=5FErdgas?= =?iso-8859-1?Q?_S=FCds__GmbH=2Exls?=" Content-Disposit

CGI Server that supports redirects

2007-10-19 Thread Thomas Guettler
-CGIHTTPServer.html [2]http://trac.saddi.com/flup -- Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: How popular is Django ?

2007-10-01 Thread Thomas Guettler
of comp.lang.python users can only be guessed. BTW: I think django is popular. There is a lot of traffic on the list. I like django, too. Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] --

Re: AttributeError: How to list existing attributes?

2007-09-19 Thread Thomas Guettler
Diez B. Roggisch wrote: > Thomas Guettler wrote: > >> Hi, >> >> how can you list the attributes of an object if you catch an >> AttributeError? >> >> I couldn't find a reference in the exception object, which >> points to the object. >&

AttributeError: How to list existing attributes?

2007-09-19 Thread Thomas Guettler
g the stacktrace? Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

force unicode strings

2007-08-01 Thread Thomas Guettler
le to loop over all strings the interpreter has parsed? Pure ascii strings are OK. Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Broken pipe with os.popen3()

2007-04-10 Thread Thomas Guettler
ocrad') > si.write(frame) > si.close() > messagetext += so.read() If you use popen you should use *one* filehandle. The app hangs because the buffer is full. See http://docs.python.org/lib/popen2-flow-control.html -- Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/

Re: python linux distro

2007-02-08 Thread Thomas Guettler
tler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Running long script in the background

2007-02-06 Thread Thomas Guettler
) self.fd.flush() oldstdout = sys.stdout sys.stdout = FlushFile(sys.stdout) for i in range(5): print "Hello", time.sleep(0.5) print -- Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: thread and processes with python/GTK

2007-01-30 Thread Thomas Guettler
application. > Usually the behavior is not as expected and I cannot understand why. I > am wondering that it could be a constraint from the use of GTK > (mainloop() existence ???). > Is somebody aware about conflict between GTK use and unix mechanism. > > Thanks for you help -

Re: OpenOffice 2.0 UNO update Links; need help

2007-01-22 Thread Thomas Guettler
an image format, please use PNG. Jpeg is for images from a digital camera. Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: Capture traceback message to string?

2007-01-17 Thread Thomas Guettler
why I like this language. HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: IMAP SEARCH Error

2007-01-17 Thread Thomas Guettler
g with ethereal (wireshark) what other applications (KMail, getmail) do. getmail is like fetchmail, but written in Python. I found some hints by looking at its source. HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + d

Re: os.popen3 hangs in Windows XP SP1, SP2. Python 2.5 & 2.4. Consistent test case.

2006-12-12 Thread Thomas Guettler
-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

len() and PEP 3000

2006-12-06 Thread Thomas Guettler
-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: HTML Table-of-Content Extraction Script

2006-11-28 Thread Thomas Guettler
Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Pimping the 'cgi' module

2006-11-24 Thread Thomas Guettler
one else who can do this) will decide to choose one soon. Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: is mod_python borked?

2006-11-02 Thread Thomas Guettler
#x27;t use it with a different webserver. I use quixote with plain old CGI. It is fast enough for my stuff. If there is heavy load, I would try SCGI. Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL

Re: Problem: Python search path - module order

2006-10-17 Thread Thomas Guettler
code. -- Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

stdout not flushed before os.execvp()

2006-10-17 Thread Thomas Guettler
homas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: what is the best practice to separate Pygtk and long running thread code

2006-09-25 Thread Thomas Guettler
thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: what is the best practice to separate Pygtk and long running thread code

2006-09-22 Thread Thomas Guettler
called if there are no actions in the event-loop. HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Threads and Progress Bar

2006-09-15 Thread Thomas Guettler
On Fri, 01 Sep 2006 21:43:46 +0530 Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote: > Hi, > > I have a small application, written in Python, that uses threads. > The application uses function foo() to download files from the web. As it > reads > data from the web server, it runs a progress bar by ca

Re: loop until keypress (Windows XP)

2006-08-10 Thread Thomas Guettler
Am Wed, 09 Aug 2006 22:19:24 -0700 schrieb placid: > Hi all, > > > Im using the cmd module and i have command that loops and keeps on > printing text, what i want to be able to do is loop until the user > presses a particular key, say Q/q ? I tried the following code; > There is a portable get

Re: do people really complain about significant whitespace?

2006-08-08 Thread Thomas Guettler
Am Mon, 07 Aug 2006 14:43:04 -0700 schrieb infidel: > Where are they-who-hate-us-for-our-whitespace? Are "they" really that > stupid/petty? Are "they" really out there at all? "They" almost sound > like a mythical caste of tasteless heathens that "we" have invented. > It just sounds like so muc

Re: Python is fun (useless social thread) ;-)

2006-06-15 Thread Thomas Guettler
improve? There are some things in Python I don't know very well: Decorators and generators. But somehow I don't think that I really need them. Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http:

  1   2   >