Suitable libraries for implementing a push-type matching engine?

2008-04-11 Thread Andrew Warkentin
I am trying to write a matching engine for a matching language for a filtering proxy compatible with that of The Proxomitron. The matching language is basically an extended superset of shell-style globs, with functionality comparable to regexps (see

Re: Adding classes to modules at runtime from outside that module

2008-04-10 Thread Andrew Warkentin
[EMAIL PROTECTED] wrote: In Python, is it possible to add classes to a module at run-time? Say I have a module foo and a module bar. Foo has class A and B, and bar has class C. I want to add class C to foo so I can access it as foo.C, but i want to do it without modifying foo's source. Is

Re: Best way to check if string is an integer?

2008-04-05 Thread Andrew Warkentin
[EMAIL PROTECTED] wrote: which is the best way to check if a string is an number or a char? could the 2nd example be very expensive timewise if i have to check a lot of strings? this value = raw_input() try: value = int(value) except ValueError: print value is not an integer or:

Re: ActiveX in Webpage?

2008-03-05 Thread Andrew Warkentin
Michael Wieher wrote: Hello, I'm trying to design a python-based web-app from scratch, based on a standalone MFC application. Obviously I'll be wrapping a lot of C++ functionality in custom extensions, but is anyone aware of any documentation/techniques that could help me drop an

Python-based regular expression parser that allows patterns to call functions?

2008-03-02 Thread Andrew Warkentin
I am writing a filtering HTTP proxy (the site is http://xuproxy.sourceforge.net/). I want it to be compatible with Proxomitron (http://proxomitron.info/) filters. I need a regular expression parser that allows patterns to call functions (or more likely, class methods), to implement matching

Re: Best architecture for proxy?

2007-07-11 Thread Andrew Warkentin
On Jul 10, 8:19 pm, Steve Holden [EMAIL PROTECTED] wrote: Bjoern Schliessmann wrote: Andrew Warkentin wrote: I am going to write a general-purpose modular proxy in Python. It will consist of a simple core and several modules for things like filtering and caching. I am not sure whether

Best architecture for proxy?

2007-07-10 Thread Andrew Warkentin
I am going to write a general-purpose modular proxy in Python. It will consist of a simple core and several modules for things like filtering and caching. I am not sure whether it is better to use multithreading, or to use an event-driven networking library like Twisted or Medusa/ Asyncore. Which