[Twisted-Python] keyword changed API
This fixes a little runtime issue with the new python version: --- ./python/htmlizer.py.~1~ 2004-11-28 05:00:05.000000000 +0100 +++ ./python/htmlizer.py 2004-12-04 18:06:06.329802464 +0100 @@ -22,7 +22,7 @@ class TokenPrinter: type = "identifier" self.parameters = 1 elif type == tokenize.NAME: - if keyword.kwdict.has_key(token): + if keyword.iskeyword(token): type = 'keyword' else: if self.parameters: Not sure what's the right way to fix these things to retain backwards compatibility (perhaps checking sys.version_info?).
On Sat, 4 Dec 2004 18:10:19 +0100, Andrea Arcangeli <andrea@cpushare.com> wrote:
This fixes a little runtime issue with the new python version:
--- ./python/htmlizer.py.~1~ 2004-11-28 05:00:05.000000000 +0100 +++ ./python/htmlizer.py 2004-12-04 18:06:06.329802464 +0100 @@ -22,7 +22,7 @@ class TokenPrinter: type = "identifier" self.parameters = 1 elif type == tokenize.NAME: - if keyword.kwdict.has_key(token): + if keyword.iskeyword(token): type = 'keyword' else: if self.parameters:
Not sure what's the right way to fix these things to retain backwards compatibility (perhaps checking sys.version_info?).
keyword.iskeyword existed in Python 2.2.0, so there seem to be no backwards compatibility problems with just switching to that. Thanks. Jp
Dear All, I want to know about the following concept "Asynchronous networked applications". Actuall meaning of twisted. " it is a framework for Asynchronous networked applications ". So I want to know specially about Asynchronous networked applications. If anybody know regarding this please clear doubts with small example. I have confusion regarding this. regards Prabahar ________________________________________________________________________ Yahoo! India Matrimony: Find your life partner online Go to: http://yahoo.shaadi.com/india-matrimony
praba mosas wrote:
I want to know about the following concept "Asynchronous networked applications". Actuall meaning of twisted. " it is a framework for Asynchronous networked applications ". So I want to know specially about Asynchronous networked applications. If anybody know regarding this please clear doubts with small example. I have confusion regarding this.
Hi Praba, In general "asynchronous" would mean "event-driven" as in comparison to "polling". A simple example I can think of would be the way that in all modern GUI frameworks (for example Microsoft's MFC) you do not have to poll the keyboard or mouse port for input but rather write code in event handlers that responds to events that are automatically generated by the GUI framework. In the same way - in Twisted you are coding event-handlers rather than writing polling routines that would for example poll a network socket for data. Eugene Coetzee Web -> www.reedflute.com ===============================================
My PyGTA presentation from a few months ago tries to provide some background on what asynchronous programming in Twisted is. It contrasts asynchronous programming models with various other approaches to parallelising code: http://www.vrplumber.com/programming/twistedlowlevel05.pdf In short, Twisted represents one of many possible approaches to the problem of "waiting in parallel", that is, multiplexing events so that while a given process is blocked on (for instance) input/output/network operations, other operations can continue. Good luck, Mike praba mosas wrote:
Dear All,
I want to know about the following concept "Asynchronous networked applications". Actuall meaning of twisted. " it is a framework for Asynchronous networked applications ". So I want to know specially about Asynchronous networked applications. If anybody know regarding this please clear doubts with small example. I have confusion regarding this.
regards Prabahar
________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com
On Wed, Dec 15, 2004 at 10:43:08AM -0500, Mike C. Fletcher wrote:
My PyGTA presentation from a few months ago tries to provide some background on what asynchronous programming in Twisted is. It contrasts asynchronous programming models with various other approaches to parallelising code: http://www.vrplumber.com/programming/twistedlowlevel05.pdf In short, Twisted represents one of many possible approaches to the problem of "waiting in parallel", that is, multiplexing events so that while a given process is blocked on (for instance) input/output/network operations, other operations can continue.
This is a great overview, and makes the "why's" of Twisted more concrete. An HTML version would be a good addition to the Twisted Howtos. -- -Mike Orr (aka. Sluggo), mso@oz.net (iron@sense-sea-MegaSub-1-465.oz.net) http://sluggo.kicks-ass.org/ Cxu vi parolas Esperante?
Dear all I am new in this group. I have a task which name is "Web based file manager Twisted Module". I know all the concepts about twisted But I didn't know anything about Twisted in Technically. I am well fluent in python. So what are the things I need to do for this?. What are the things require for this task?. I expect details regarding software requirements. I have only Python software in my system. Is it enough. I don't know how to import the twisted packages into my system. Please mail me as early as possible. regards T.Mosas Prabahar ________________________________________________________________________ Yahoo! India Matrimony: Find your life partner online Go to: http://yahoo.shaadi.com/india-matrimony
participants (6)
-
Andrea Arcangeli
-
Eugene Coetzee
-
Jp Calderone
-
Mike C. Fletcher
-
Mike Orr
-
praba mosas