[issue6589] smtpd.SMTPServer can cause asyncore.loop to enter infinite event loop

2010-06-29 Thread Casey McGinty
Casey McGinty casey.mcgi...@gmail.com added the comment: I attached a simple script that reproduces the report issue. I hope it helps. -- Added file: http://bugs.python.org/file17807/smtp_test.py ___ Python tracker rep...@bugs.python.org http

[issue6589] smtpd.SMTPServer can cause asyncore.loop to enter infinite event loop

2010-06-28 Thread Casey McGinty
Casey McGinty casey.mcgi...@gmail.com added the comment: This is how it gets in an invalid state. Not sure why you can't look at the code and see the mistake. There is no code in the SMTPServere.__init__ method that catches the exception raised, caused by the failed bind attempt. After

[issue6605] smtplib.SMTP.sendmail() rejected after quit(), connect() sequence, no HELO

2009-07-30 Thread Casey McGinty
New submission from Casey McGinty casey.mcgi...@gmail.com: The smtplib.SMTP.quit() method does not reset the 'helo_resp' and 'ehlo_resp' instance attributes. During the next smtplib.SMTP.sendmail(), the HELO/EHLO commands are not sent, and may cause the remote SMTP service to reject the message

[issue6605] smtplib.SMTP.sendmail() rejected after quit(), connect() sequence, no HELO

2009-07-30 Thread Casey McGinty
Casey McGinty casey.mcgi...@gmail.com added the comment: Sorry, duplicate of #4142 -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6605

[issue6589] smtpd.SMTPServer can cause asyncore.loop to enter infinite event loop

2009-07-27 Thread Casey McGinty
New submission from Casey McGinty casey.mcgi...@gmail.com: When subclass of smtpd.SMTPServer, it is possible the get asyncore.loop to enter an infinite loop where the following output is shown: . warning: unhandled write event warning: unhandled read event warning: unhandled write event

SMTPlib and SMTPd Performance Issues

2009-07-21 Thread Casey McGinty
Hi, I just wanted mention a few workarounds I've come up with for the Python SMTP modules in regards to performance. Before I started, I was getting about 15MB/s while sending e-mail from smtplib to smptd over a local connection. (i.e. both client/server running on the same machine). After the

[issue3518] multiprocessing: BaseManager.from_address documented but doesn't exist

2009-07-09 Thread Casey McGinty
Casey McGinty casey.mcgi...@gmail.com added the comment: I would like to open this ticket back up. Python 2.6.2 docs still reference unimplemented 'from_address' method. http://docs.python.org/library/multiprocessing.html#multiprocessing.managers.BaseManager.from_address BaseManager

[issue5862] multiprocessing 'using a remote manager' example errors and possible 'from_address' code leftover

2009-07-09 Thread Casey McGinty
Changes by Casey McGinty casey.mcgi...@gmail.com: -- nosy: +cmcginty ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5862 ___ ___ Python-bugs-list

Re: Free place to host python files?

2009-01-07 Thread Casey McGinty
Check out nearlyfreespeech.net for a free account. You could store hundreds of scripts on there for about 12 cents a year. -- http://mail.python.org/mailman/listinfo/python-list

Re: Project structure - Best practices

2008-12-05 Thread Casey McGinty
discussion to organize thoughts and see if any new ideas come out. As a starting point, what is a good markup language to use for some slick HTML and PDF output? - Casey McGinty [1] http://www.python.org/dev/peps/pep-0008/ -- http://mail.python.org/mailman/listinfo/python-list

[issue4544] textwrap: __all__ atribute missing 'dedent' functino

2008-12-05 Thread Casey McGinty
New submission from Casey McGinty [EMAIL PROTECTED]: From textwrap.py: 46863 2006-06-11 19:42:51Z tim.peters The __all__ define in this module is missing the helper function 'dedent'. This causes pydoc to not the list the function correctly. Secondly, it also prevents 'dedent' from being

[issue4544] textwrap: __all__ atribute missing 'dedent' function

2008-12-05 Thread Casey McGinty
Changes by Casey McGinty [EMAIL PROTECTED]: -- title: textwrap: __all__ atribute missing 'dedent' functino - textwrap: __all__ atribute missing 'dedent' function ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4544

Re: Reverse zip() ?

2008-12-03 Thread Casey McGinty
The corner case is when dealing with empty lists and there aren't enough items to unpack. Another solution to zip(), with a slightly different behaviour for conner cases a = (1,2,3) b = (1,2,3) c = (1,2,3,4) zip(a,b) [(1, 1), (2, 2), (3, 3)] map(None,a,b) [(1, 1), (2, 2), (3, 3)]

Re: Google App Engine Code Challenge - write a tetris playing algorithm

2008-12-01 Thread Casey McGinty
On Sun, Nov 30, 2008 at 2:41 PM, russ.au [EMAIL PROTECTED] wrote: I've got more features to add, depending on how popular it is.. http://mail.python.org/mailman/listinfo/python-list Are you going to create a leader board to track the high scores? --

Re: Google App Engine Code Challenge - write a tetris playing algorithm

2008-12-01 Thread Casey McGinty
Well, I think its a cool idea. I might try it out if I can find some free cycles. And does the game logic assume the pieces come straight down? For example, what if you wanted to move a piece to the left or right after its past some vertical obstruction? For example If you place and upside down

Re: Inserting into a combo box

2008-08-05 Thread Casey McGinty
What toolkit are you using? -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I check nbr of cores of computer?

2008-07-29 Thread Casey McGinty
On Tue, Jul 29, 2008 at 12:53 PM, defn noob [EMAIL PROTECTED] wrote: How can I check how many cores my computer has? Is it possible to do this in a Python-app? -- http://mail.python.org/mailman/listinfo/python-list You can use the HAL interface from the DBUS module. See also the

Re: Pwnie awards

2008-07-26 Thread Casey McGinty
One more award from award winner Tim Neshman ... http://www.thenewsh.com/ -- http://mail.python.org/mailman/listinfo/python-list

DBUS/HAL Manager Interface Help

2008-07-25 Thread Casey McGinty
Can someone explain to me why this sample code does not work? I am trying to test if a device exists. dbus_test.py -- import dbus bus = dbus.SystemBus() proxy = bus.get_object( 'org.freedesktop.Hal', '/org/freedesktop/Hal/Manager' ) manager =

Re: Python Written in C?

2008-07-20 Thread Casey McGinty
On Sun, Jul 20, 2008 at 5:06 PM, Grant Edwards [EMAIL PROTECTED] wrote: On 2008-07-21, Dan Upton [EMAIL PROTECTED] wrote: Using punch-cards and paper-tape. Real programmers can edit their programs with a pointy stick and some home-made sticky-tape. Doesn't everyone know that REAL

Unit Testing Techniques

2008-07-10 Thread Casey McGinty
I'm familiar with the unittest module in Python, however I'm hoping someone can point me to some examples of more advanced usages of the framework. For example: 1. Using the framework to test a package with nested sub-packages and modules without having to hard code the location/name of each test

Re: Interest not met.

2008-07-07 Thread Casey McGinty
On Thu, Jul 3, 2008 at 5:01 AM, david odey [EMAIL PROTECTED] wrote: I write to inform you that the reason I subscribed to this web page is not been met. I want to be sent sample codes in programming languages especially python and an email tutorial on C#. I will be happy if these demands

Re: Help with Borg design Pattern

2008-06-30 Thread Casey McGinty
On Fri, Jun 27, 2008 at 5:25 PM, Maric Michaud [EMAIL PROTECTED] wrote: Yes it is, but it's rather unneeded in Python, we prefer simply create a module level dictionnary, these tricks are used in language like C++ or Java. In python : mymodule.py : ModuleOptions = {} othermodule.py :

Help with Borg design Pattern

2008-06-27 Thread Casey McGinty
Hi, I'm trying to implement a simple Borg or Singleton pattern for a class that inherits from 'dict'. Can someone point out why this code does not work? class MyDict( dict ): __state = {} def __init__(self): self.__dict__ = self.__state a = MyDict() a['one'] = 1 a['two'] = 2 print

Re: Help with Borg design Pattern

2008-06-27 Thread Casey McGinty
On Fri, Jun 27, 2008 at 3:21 PM, Casey McGinty [EMAIL PROTECTED] wrote: Hi, I'm trying to implement a simple Borg or Singleton pattern for a class that inherits from 'dict'. Can someone point out why this code does not work? class MyDict( dict ): __state = {} def __init__(self

Re: python-dbus example request

2008-06-26 Thread Casey McGinty
You will need this page to figure out the name of the device, and details on how to access it. However it is not python specific. http://people.freedesktop.org/~david/hal-spec/hal-spec.html -- http://mail.python.org/mailman/listinfo/python-list

Re: ClassName.attribute vs self.__class__.attribute

2008-06-06 Thread Casey McGinty
On Thu, Jun 5, 2008 at 11:39 AM, Terry Reedy [EMAIL PROTECTED] wrote: If you want to access the attribute of a particular class, to read or write, use that class. SomeClass.attr Note that no instance is required or relevant. If you want to read the attrubute of the class of an instance

Re: Guide to organizing modules?

2008-06-06 Thread Casey McGinty
Yes, in the above post I meant to say package where I said module. Right now all my functions are in the __init__.py script, and I would consider separating them out into sub-packages, if it had any rhyme or reason, but right now that escapes me. That's mostly what I'm trying to ask for.

Re: ClassName.attribute vs self.__class__.attribute

2008-06-05 Thread Casey McGinty
On Thu, Jun 5, 2008 at 5:40 AM, Gabriel Rossetti [EMAIL PROTECTED] wrote: Hello everyone, I had read somewhere that it is preferred to use self.__class__.attribute over ClassName.attribute to access class (aka static) attributes. I had done this and it seamed to work, until I subclassed a

Re: Code execution in imported modules

2008-05-30 Thread Casey McGinty
On Thu, May 29, 2008 at 2:43 PM, Eric Wertman [EMAIL PROTECTED] wrote: So I'm working on some file parsing and building up a stack of regular expressions that I need to use. I was thinking of dropping them in an external module. I was wondering.. if I put them in a file called regex.py like

Re: Struct usages in Python

2008-05-27 Thread Casey McGinty
self.event[] = Event() *# Seems this is not allowed ?? * self.event = [Event()] - Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: finding icons for Apps

2008-05-25 Thread Casey McGinty
http://art.gnome.org/ http://www.gnome-look.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Organizing a Python project

2008-05-25 Thread Casey McGinty
On Sat, May 24, 2008 at 2:11 PM, Gabriel Genellina [EMAIL PROTECTED] wrote: 2. In the top of your package directory it is typical to have a module name '_package.py'. This is ideally where the main command line entry point for the package code should be placed. Why the underscore? And I

Re: Code correctness, and testing strategies

2008-05-24 Thread Casey McGinty
Seriously, 10 hours of testing for code developed in 10 hours? What kind of environment do you write code for? This may be practical for large companies with hordes of full-time testing QA staff, but not for small companies with just a handful of developers (and where you need to borrow

Re: Organizing a Python project

2008-05-21 Thread Casey McGinty
I'm starting work on what is going to become a fairly substantial Python project, and I'm trying to find the best way to organize everything. I'd like to add a follow up question. Are there any idioms for writing /usr/bin scripts to run installed package modules? For this I am assuming a

Making Variable Text Output More Pythonic?

2008-05-15 Thread Casey McGinty
Hi, I have some classes that print variable outputs depending on their internal state, like so: def __str__(self): out = [] if self.opt1: out += ['option 1 is %s' % self.opt1'] if self.opt2: out += ['option 2 is %s' % self.opt2'] return '\n'.join(out) Is there any way

Re: Sanitised Newsgroup Feeds?

2008-05-15 Thread Casey McGinty
On Wed, May 14, 2008 at 7:47 PM, Paddy [EMAIL PROTECTED] wrote: Hi, Does anyone do a sanitised newsgroup feed? Something like what mail filters do for email? http://mail.python.org/mailman/listinfo/python-list Hi, I used to read the summary emails and had the same problem. I think the best

test

2008-05-15 Thread Casey McGinty
test -- http://mail.python.org/mailman/listinfo/python-list

Getting PyUnit to run Package Test Modules

2008-04-22 Thread Casey McGinty
Hopefully this is an easy question for someone to answer. I have a directory structure like so: alltest.py prog.py ../package __init__.py mod1.py test_mod1.py modn. py (and so on...) Each test_mod*.py file contains some PyUnit test cases. I am using the following code in

Re: Getting PyUnit to run Package Test Modules

2008-04-22 Thread Casey McGinty
= __import__(name) components = name.split('.') for comp in components[1:]: print comp mod = getattr(mod,comp) alltests.addTest(unittest.findTestCases(mod)) return alltest On Tue, Apr 22, 2008 at 12:12 AM, Casey McGinty [EMAIL PROTECTED] wrote: Hopefully