Finding email threads with mailbox.mbox

2010-09-23 Thread Skye
look like anything in the standard Python library will help me with that. I suppose I could yank some code from Mailman's pipermail or something for identifying discussion threads, but I was wondering if anyone had any other suggestions before I reinvent the wheel. Thanks, Skye -- http://mail.pyt

Re: Am I doing this wrong? Why does this seem so clumsy (time, datetime vs. DateTime)

2009-09-19 Thread Skye sh...@#$
On Sep 19, 7:22 pm, Schif Schaf wrote: > The other day I needed to convert a date like "August 2009" into a > "seconds-since-epoch" value (this would be for the first day of that > month, at the first second of that day). You could use Time::Piece: [ss...@localhost ~]$ perl -lMTime::Piece -e'$t=

Re: Question by someone coming from C...

2008-06-09 Thread Skye
Very cool - I'm liking the pythonic way of doing things more and more. The logger namespace/singleton idea makes great sense! I see how the module variables make globals irrelevant, thanks! Skye -- http://mail.python.org/mailman/listinfo/python-list

Re: Question by someone coming from C...

2008-06-09 Thread Skye
s.python.org/lib/module-logging.html Thanks! It looks like subclassing the logging module would be a much better idea :) Skye -- http://mail.python.org/mailman/listinfo/python-list

Re: Question by someone coming from C...

2008-06-09 Thread Skye
OK, sounds good. So if not bitfields, what would be a good Python-y way to do it? Flip booleans in a "debug config" dictionary or something? Skye -- http://mail.python.org/mailman/listinfo/python-list

Question by someone coming from C...

2008-06-09 Thread Skye
_GENERAL 0x0001 #define DEBUG_CONFIG 0x0002 #define DEBUG_OPTIONS 0x0004 etc etc So I guess my questions are: 1. there doesn't seem to be a way to define global constants like in other languages? 2. any special voodoo to use bitfields in Python? Thanks! Skye -- http://mail.python.org/mailman/listinfo/python-list

Re: Newb question: underscore

2008-06-05 Thread Skye
Ohh, it's a function _() call. Now it makes sense. Of course Python would be consistent... I was expecting trickery! It's actually from the Mailman source, def _(s) is a string function for i18n Thanks, Skye -- http://mail.python.org/mailman/listinfo/python-list

Newb question: underscore

2008-06-05 Thread Skye
What is this doing? print >> fd, _(__doc__) I'm guessing line-splitting __doc__ into a list, but what's that leading underscore do? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Access to sysctl on FreeBSD?

2008-05-20 Thread Skye
and the intended conversion to/from Python values. This can be used in handling binary data stored in files or from network connections, among other sources. I freakin' love Python!! Skye -- http://mail.python.org/mailman/listinfo/python-list

Re: Access to sysctl on FreeBSD?

2008-05-20 Thread Skye
uot; * size.value) libc.sysctlbyname("net.inet.ip.stats", buf, byref(size), None, 0) So now that I've got the data, can you point me towards docs explaining how to layout struct ipstat? Thanks, Skye -- http://mail.python.org/mailman/listinfo/python-list

Access to sysctl on FreeBSD?

2008-05-20 Thread Skye
How do I access the sysctl(3) call from Python on BSD? Specifically I want to retrieve: $ sysctl -d net.inet.ip.stats net.inet.ip.stats: IP statistics (struct ipstat, netinet/ip_var.h) So I'll need some way of getting to struct ipstat from Python as well Thanks, Skye -- http://mail.pytho

Re: get quote enclosed field in a line

2008-04-17 Thread Skye [EMAIL PROTECTED]
> [EMAIL PROTECTED] wrote: > > is there a simple way in perl, python, or awk/shell/pipe, that gets > > the user agent field in a apache log? > Something like: > # cut -d '"' -f 6 < httpd-access.log > ? > -- > mph Doesn't it feel like autosplit mode never gets any run time? perl -laF'"' -ne'print