Re: [Twisted-Python] Question about FileDescriptor.loseConnection() signature found by mypy

2020-06-16 Thread Craig Rodrigues
twisted.internet.abstract.FileDescriptor.loseConnection() was changed here in 2004: https://github.com/twisted/twisted/commit/081d393ab03da92d744d8fb2b5d77705662a0caa This change was done so long ago, but I think changing the signature like that was wrong. I took a guess at how to fix this and su

Re: [Twisted-Python] Question about FileDescriptor.loseConnection() signature found by mypy

2020-06-16 Thread Patrick Cloke
On 6/15/20 11:43 PM, Craig Rodrigues wrote: In twisted.internet.abstract.FileDescriptor.loseConnection, the loseConnection method is defined like:     def loseConnection(self, _connDone=failure.Failure(main.CONNECTION_DONE)): while in twisted.internet._newtls.ConnectionMixin , we have:   d

Re: [Twisted-Python] Question about FileDescriptor.loseConnection() signature found by mypy

2020-06-16 Thread Maarten ter Huurne
On Tuesday, 16 June 2020 10:51:21 CEST Glyph wrote: > > On Jun 15, 2020, at 8:43 PM, Craig Rodrigues > > wrote: > > > > In twisted.internet.abstract.FileDescriptor.loseConnection, the > > loseConnection method> > > is defined like: > > def loseConnection(self, _connDone=failure.Failure(main

Re: [Twisted-Python] Question about FileDescriptor.loseConnection() signature found by mypy

2020-06-16 Thread Glyph
> On Jun 15, 2020, at 8:43 PM, Craig Rodrigues wrote: > > In twisted.internet.abstract.FileDescriptor.loseConnection, the > loseConnection method > is defined like: > > def loseConnection(self, _connDone=failure.Failure(main.CONNECTION_DONE)): I think this signature might just be... wron

[Twisted-Python] Question about FileDescriptor.loseConnection() signature found by mypy

2020-06-15 Thread Craig Rodrigues
In twisted.internet.abstract.FileDescriptor.loseConnection, the loseConnection method is defined like: def loseConnection(self, _connDone=failure.Failure(main.CONNECTION_DONE)): while in twisted.internet._newtls.ConnectionMixin , we have: def loseConnection(self): If I run *tox -e mypy*

Re: [Twisted-Python] Question regarding patch submission

2017-06-26 Thread Glyph
> On Jun 26, 2017, at 10:46 PM, Jason Litzinger wrote: > > On Mon, Jun 26, 2017 at 02:23:24PM -0400, Glyph wrote: >> The comment about rebasing predates our current process; it was from the >> days when we were using SVN. Nowadays we usually just merge trunk in to the >> branch. > > Yikes, d

Re: [Twisted-Python] Question regarding patch submission

2017-06-26 Thread Jason Litzinger
On Mon, Jun 26, 2017 at 02:23:24PM -0400, Glyph wrote: > The comment about rebasing predates our current process; it was from the days > when we were using SVN. Nowadays we usually just merge trunk in to the > branch. Yikes, definitely didn't do that on the PR above, will from now on. If that

Re: [Twisted-Python] Question regarding patch submission

2017-06-26 Thread Glyph
> On Jun 25, 2017, at 11:34 PM, Jason Litzinger wrote: > > Hello, > Quick question regarding #15 of > https://twistedmatrix.com/trac/wiki/TwistedDevelopment#SubmittingaPatch. > > The step indicates that history shouldn't be re-written and the branch > should be rebased over trunk. Pretty strai

Re: [Twisted-Python] Question regarding patch submission

2017-06-25 Thread Tristan Seligmann
On Mon, 26 Jun 2017 at 05:34 Jason Litzinger wrote: > However, after incorporating review comments in new commits and, > force-pushing the feature branch, is it expected that the review comments > may > be damaged? > I think this is expected; this is just an unfortunate shortcoming of GitHub PR

[Twisted-Python] Question regarding patch submission

2017-06-25 Thread Jason Litzinger
Hello, Quick question regarding #15 of https://twistedmatrix.com/trac/wiki/TwistedDevelopment#SubmittingaPatch. The step indicates that history shouldn't be re-written and the branch should be rebased over trunk. Pretty straightforward, introduce new commits, don't mess with the old ones. Howeve

[Twisted-Python] Question about twistedchecker failures

2016-06-21 Thread Craig Rodrigues
Hi, Why did this twistedchecker build succeed: https://buildbot.twistedmatrix.com/builders/twistedchecker/builds/341 and this one fail: https://buildbot.twistedmatrix.com/builders/twistedchecker/builds/342 I don't understand what is causing the failure. I looked at: https://github.com/twisted-i

Re: [Twisted-Python] Question for obtaining mac-address

2015-11-26 Thread Cory Benfield
> On 26 Nov 2015, at 13:29, Pavel Zverev wrote: > > Have nice day, developers! > > I am a beginner python developer, and recently I came across the Twisted > framework, I was interested in whether I get the MAC-address of the client > connected to the network, similar twisted.web.http.Request

[Twisted-Python] Question for obtaining mac-address

2015-11-26 Thread Pavel Zverev
Have nice day, developers! I am a beginner python developer, and recently I came across the Twisted framework, I was interested in whether I get the MAC-address of the client connected to the network, similar twisted.web.http.Request.getClientIP. Thanks. __

[Twisted-Python] question on twisted

2014-07-02 Thread Pratik Prajapati
Hi, I have posted a question about twisted udp on stackoverflow http://stackoverflow.com/questions/24531442/get-media-renderer-devices-from-all-networks-connected-to-a-machine-using-twiste Please reply. ___ Twisted-Python mailing list Twisted-Python@twi

Re: [Twisted-Python] Question on log time stamp precision

2014-01-20 Thread exarkun
On 02:16 am, dus...@v.igoro.us wrote: On Sun, Jan 19, 2014 at 8:55 PM, wrote: On 19 Jan, 11:47 pm, dus...@v.igoro.us wrote: From what I can tell in a few old bugs and the API docs, the key is to monkey-patch log.FileLogObserver.timeFormat. Or just politely set it on the instance of Fil

Re: [Twisted-Python] Question on log time stamp precision

2014-01-19 Thread Dustin J. Mitchell
On Sun, Jan 19, 2014 at 8:55 PM, wrote: > On 19 Jan, 11:47 pm, dus...@v.igoro.us wrote: >>> >>> From what I can tell in a few old bugs and the API docs, the key is to >> >> monkey-patch log.FileLogObserver.timeFormat. > > > Or just politely set it on the instance of FileLogObserver your applicati

Re: [Twisted-Python] Question on log time stamp precision

2014-01-19 Thread exarkun
On 19 Jan, 11:47 pm, dus...@v.igoro.us wrote: From what I can tell in a few old bugs and the API docs, the key is to monkey-patch log.FileLogObserver.timeFormat. Or just politely set it on the instance of FileLogObserver your application creates so as to avoid global side-effects. :) Jean-P

Re: [Twisted-Python] Question on log time stamp precision

2014-01-19 Thread Dustin J. Mitchell
>From what I can tell in a few old bugs and the API docs, the key is to monkey-patch log.FileLogObserver.timeFormat. Dustin ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

[Twisted-Python] Question on log time stamp precision

2014-01-19 Thread Bob Novas
The log is very valuable to me for debugging, but I'd love to know how to improve the precision of the time stamp. My log shows stuff like this: 2014-01-19 12:44:37-0500 [-] 'SCPProtocol.ackNotReceived: aa23827e20547c6aca71ecfcdeb486a99fe6cf314e1b84e687296821a8ca423a' 2014-01-19 12:44:37-0

Re: [Twisted-Python] question : use existing tac file with tap.

2013-11-17 Thread Sayid Munawar
Hi Bino, i _never_ write code using twisted (yet, i hope), but reading your question lead me to one (i think) example: https://github.com/praekelt/vumi/blob/develop/vumi/servicemaker.py#L174 hope it helps -- Sayid Munawar Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Monday, 1

[Twisted-Python] question : use existing tac file with tap.

2013-11-11 Thread bino
Dear All. Currently I have a single '.tac' file that use MultiService() Ended with #Create Application print 'create application' application = service.Application("Serial MultiService Example") #Creating Multi Service multiService = service.MultiService() ... ... multiService.s

Re: [Twisted-Python] question about subprocess

2013-10-02 Thread Jonathan Vanasco
been too busy to work on this, but... 1) Ok, I will avoid subprocess and stick with twisted. Thanks! 2) I will absolutely document where things got annoying to share! On Sep 27, 2013, at 12:35 AM, Matt Haggard wrote: > > On Sep 26, 2013 8:18 PM, "Glyph" wrote: > > > > > > On Sep 26, 2013, a

Re: [Twisted-Python] question about subprocess

2013-09-27 Thread Phil Mayers
On 09/27/2013 02:51 AM, Jonathan Vanasco wrote: i was looking at reactor.SpawnProcess -- which I know is more correct. it just seems to be a bit annoying to use Are you aware of twisted.internet.utils.getProcessOutputAndValue? For simple spawn/check cases, that's pretty much always the best

Re: [Twisted-Python] question about subprocess

2013-09-26 Thread Matt Haggard
On Sep 26, 2013 8:18 PM, "Glyph" wrote: > > > On Sep 26, 2013, at 6:51 PM, Jonathan Vanasco wrote: > > Could you write up why you feel it's "annoying"? Maybe we can improve spawnProcess so it works better for you in the future. I'm also interested in what you feel is annoying. Please write this

Re: [Twisted-Python] question about subprocess

2013-09-26 Thread Glyph
On Sep 26, 2013, at 6:51 PM, Jonathan Vanasco wrote: > > Quick question about (sub)processes in twisted : > > how bad is it to use the subprocess module ? ( in general / in this > application ) It's pretty bad ;-). > I have the following setup : > > - Twisted Daemon that does

[Twisted-Python] question about subprocess

2013-09-26 Thread Jonathan Vanasco
Quick question about (sub)processes in twisted : how bad is it to use the subprocess module ? ( in general / in this application ) I have the following setup : - Twisted Daemon that does 5 things (very well!) - A new requirement -- to execute 2 scripts on the commandli

Re: [Twisted-Python] question : How to listen to USB-HID

2013-05-18 Thread Werner Thie
Hi Maybe you get some clues about twisted with USB/serial stuff from http://code.google.com/p/pywws/source/browse/trunk/pywws/WeatherStation.py?r=504 which is a twistification of the pywws weather station code. HTH, Werner On 5/18/13 10:50 AM, b...@indoakses-online.com wrote: > Dear All > C/Q

Re: [Twisted-Python] question : How to listen to USB-HID

2013-05-18 Thread bino
Dear All C/Q Tim Allen I really appreciate your response > There's no (easy) way to hook a Twisted program up to an arbitrary > USB-HID device; the best you could do would be to write a Twisted > program that communicates with stdin/stdout, then run that program in > a window and remember not to Al

Re: [Twisted-Python] question : How to listen to USB-HID

2013-05-17 Thread Tim Allen
On Fri, May 17, 2013 at 02:54:47PM +0700, b...@indoakses-online.com wrote: > But I plan to replace arduino with digispark ( > http://digistump.com/products/1 ) > > Problem is I just realize that this device will recognized as USB-HID >From this page: http://digistump.com/wiki/digispark/tutor

[Twisted-Python] question : How to listen to USB-HID

2013-05-17 Thread bino
Dear All ... Currently I have a twistd script that listen to arduino dev board. Arduino recognized as plain usb-serial, so I can do it using LineReceiver as simple as : --> class ArduinoReceiver(LineReceiver) And make it SerialService as told by http://www.mentby.com/lucas-taylor/serialport-proto

Re: [Twisted-Python] question : txdbus and dbus-send

2013-04-23 Thread bino
Dear Tom > > --session means you're using the session bus instead of the system bus > (which requires a .service file in a different directory and, possibly, an > entry in /etc/dbus-1/..). The --dest flag, similar to the Name of the > .service file, refers to the bus name rather than the object. '/

Re: [Twisted-Python] question : txdbus and dbus-send

2013-04-22 Thread Tom Cocagne
On Mon, Apr 22, 2013 at 2:25 AM, wrote: > Dear All > I take > > https://github.com/cocagne/txdbus/blob/master/doc/tutorial_examples/simple_server > and save it to /home/bino/Documents/mbink/pythons/coretac/dbus00.py > > It's work as expected when 'called' using > > https://github.com/cocagne/txdb

[Twisted-Python] question : txdbus and dbus-send

2013-04-22 Thread bino
Dear All I take https://github.com/cocagne/txdbus/blob/master/doc/tutorial_examples/simple_server and save it to /home/bino/Documents/mbink/pythons/coretac/dbus00.py bino@bino-pata:~$ ls -la /home/bino/Documents/mbink/pythons/coretac |grep dbus -rwxrwxr-x 1 bino bino 1026 Apr 22 12:08 dbus00.py

Re: [Twisted-Python] question : dbus for twistd application framework

2012-05-31 Thread Barry Warsaw
On May 30, 2012, at 05:35 PM, Jasper St. Pierre wrote: >> regularly.  For example, as of 1.0, dbus-python supports Python 3.  There >> are also legitimate reasons not to want to use GDBus. > >What would those be? A simple, pure-Python server for example. You can do that with dbus-python and mini

Re: [Twisted-Python] question : dbus for twistd application framework

2012-05-30 Thread bino oetomo
On 05/31/2012 09:43 AM, Daniel Bryan wrote: > Here's an example based on an application that I have in production. > It's a bit amateurish - and I'm going to mangle the language - but you > should get the idea. > > This is an extract from the main script: > > === > Class Handler(Resource): >

Re: [Twisted-Python] question : dbus for twistd application framework

2012-05-30 Thread Daniel Bryan
Here's an example based on an application that I have in production. It's a bit amateurish - and I'm going to mangle the language - but you should get the idea. This is an extract from the main script: === Class Handler(Resource): pass # application code goes here - HTTP request handling,

Re: [Twisted-Python] question : dbus for twistd application framework

2012-05-30 Thread bino oetomo
Dear All c/q Itamar, I really appreciate your enlightment On 05/29/2012 09:14 PM, Itamar Turner-Trauring wrote: > > Applications are just a *deployment* method, providing startup and > shutdown notification; they're not really relevant to how you interact > with dbus. See > http://twistedmatrix.co

Re: [Twisted-Python] question : dbus for twistd application framework

2012-05-30 Thread Jasper St. Pierre
On Wed, May 30, 2012 at 5:24 PM, Barry Warsaw wrote: > On May 28, 2012, at 11:22 PM, Jasper St. Pierre wrote: > >>Note that dbus-python (and libdbus-1, and libdbus-glib) is deprecated. >>The recommended solution is to use GDBus. > > Is it?  dbus-python seems like a healthy project, getting new rel

Re: [Twisted-Python] question : dbus for twistd application framework

2012-05-30 Thread Barry Warsaw
On May 28, 2012, at 11:22 PM, Jasper St. Pierre wrote: >Note that dbus-python (and libdbus-1, and libdbus-glib) is deprecated. >The recommended solution is to use GDBus. Is it? dbus-python seems like a healthy project, getting new releases fairly regularly. For example, as of 1.0, dbus-python s

Re: [Twisted-Python] question : dbus for twistd application framework

2012-05-29 Thread Itamar Turner-Trauring
On 05/28/2012 11:03 PM, bino oetomo wrote: > Dear all ... > > I need my twistd script to also 'listen' to dbus. > The only example that I found so far is : > http://twistedmatrix.com/trac/attachment/ticket/1352/dbus-twisted.py > Buit that example not using some thing like : > application = service.

Re: [Twisted-Python] question : dbus for twistd application framework

2012-05-28 Thread Jasper St. Pierre
All you should need to do is install the glib reactor. Note that dbus-python (and libdbus-1, and libdbus-glib) is deprecated. The recommended solution is to use GDBus. See http://developer.gnome.org/gio/stable/ch30.html On Mon, May 28, 2012 at 11:03 PM, bino oetomo wrote: > Dear all ... > > I ne

[Twisted-Python] question : dbus for twistd application framework

2012-05-28 Thread bino oetomo
Dear all ... I need my twistd script to also 'listen' to dbus. The only example that I found so far is : http://twistedmatrix.com/trac/attachment/ticket/1352/dbus-twisted.py Buit that example not using some thing like : application = service.Application("MyApp") Is there any example of dbus impl

Re: [Twisted-Python] question : json.loads failed using LineReceiver data

2012-05-14 Thread exarkun
On 08:53 am, b...@indoakses-online.com wrote: >Dear All .. > >I'm trying to received json formated text using LineReceiver > >Here is my code >START >class ArduinoReceiver(LineReceiver): > def __init__(self): > print 'INIT : ArduinoReceiver' > > def lineReceived(self, line):

Re: [Twisted-Python] question : json.loads failed using LineReceiver data

2012-05-14 Thread Itamar Turner-Trauring
On 05/14/2012 04:53 AM, bino oetomo wrote: > Kindly please tell me why the 'json.loads' is failed in my tac file > while it work in python console. > Perhaps the JSON spans more than one line? Printing out the repr() of the lines you're receiving may be informative. __

[Twisted-Python] question : json.loads failed using LineReceiver data

2012-05-14 Thread bino oetomo
Dear All .. I'm trying to received json formated text using LineReceiver Here is my code START class ArduinoReceiver(LineReceiver): def __init__(self): print 'INIT : ArduinoReceiver' def lineReceived(self, line): line = line.strip() print 'Received li

[Twisted-Python] question : SerialService and an autostart application of autologin user, strange behaviour

2012-04-09 Thread bino oetomo
Dear All .. My system is an ubuntu box with openbox and Slim. in my tac file with a SerialService, I have this line serial = SerialPort(ArduinoReceiver(), '/dev/arduino', reactor,baudrate=4800) This tac file always run well when I start it manualy from xterm. I call it using an sh script : --

[Twisted-Python] question : redis and twisteD application service framework

2012-04-03 Thread bino oetomo
Dear all Currently I use wokkel to bridge SerialService to my Pub/Sub system (currently based on Jabber XMPP) my co-worker is PHP guys, so it's hard to get access to XMPP from PHP. he told me about Redis, and I found txredis and TxRedisapi I want my application basically : 1. Send whatever recei

[Twisted-Python] Question : Listen to GPSD

2012-04-03 Thread bino oetomo
Dear all. Recently, for my MDT project I use 2 twisted script. one for the core process (XMPP, LineReceiver, SerialService), and one for displaying msg (twisted with WxPython) I need 2 of them .. since I cannot combine them in single script. I Only familiar with 'service.Application' method. Know

Re: [Twisted-Python] Question : PyNotify call from twist daemon

2012-03-06 Thread bino oetomo
Argh ignore my post about this problem. I just need to add --> mynotify.show() to fix it. BTW it's not needed when we are not in twisted. Sincerely -bino- On 03/06/2012 05:38 PM, bino oetomo wrote: > Dear Phil > On 03/06/2012 04:33 PM, Phil Mayers wrote: >> So pynotify is a GTK thing? >> > I

Re: [Twisted-Python] Question : PyNotify call from twist daemon

2012-03-06 Thread Phil Mayers
On 06/03/12 10:38, bino oetomo wrote: > Dear Phil > On 03/06/2012 04:33 PM, Phil Mayers wrote: >> >> So pynotify is a GTK thing? >> > I don't know >> Are you using the GTK reactor? >> > Ooopss .. no ... > Could you please tell me how to do it with MultiService ? > I still need run my script using t

Re: [Twisted-Python] Question : PyNotify call from twist daemon

2012-03-06 Thread bino oetomo
Dear Phil On 03/06/2012 04:33 PM, Phil Mayers wrote: > > So pynotify is a GTK thing? > I don't know > Are you using the GTK reactor? > Ooopss .. no ... Could you please tell me how to do it with MultiService ? I still need run my script using twistd Sincerely -bino- > _

Re: [Twisted-Python] Question : PyNotify call from twist daemon

2012-03-06 Thread Phil Mayers
On 03/06/2012 08:56 AM, bino oetomo wrote: > > import pygtk > pygtk.require('2.0') > import pynotify So pynotify is a GTK thing? Are you using the GTK reactor? ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/c

[Twisted-Python] Question : PyNotify call from twist daemon

2012-03-06 Thread bino oetomo
Dear All ... I have a Serial service in my twisted script Inside my 'class ArduinoReceiver(LineReceiver):' , I have a function like : ---START def setdisplay(self, dispmode): global mynotify self.ntf_title = 'TOMBOL' self.ntf_body = 'Coba aja' try :

Re: [Twisted-Python] Question : Failed to read gpsfake

2012-02-23 Thread Itamar Turner-Trauring
On 02/23/2012 04:22 AM, bino oetomo wrote: > Dear All ... > > I try to simulate a gps with gpsfake. > gpsfake create virtual port at /dev/pts/4 > > my code is posted at : http://pastebin.com/j2wn1aXh > > It's never reach the 'lineReceived' part. > I Got no error msg. > > The log only said > > 2012-

[Twisted-Python] Question : Failed to read gpsfake

2012-02-23 Thread bino oetomo
Dear All ... I try to simulate a gps with gpsfake. gpsfake create virtual port at /dev/pts/4 my code is posted at : http://pastebin.com/j2wn1aXh It's never reach the 'lineReceived' part. I Got no error msg. The log only said 2012-02-23 16:02:50+0700 [-] Log opened. 2012-02-23 16:02:50+0700 [-]

Re: [Twisted-Python] question about twisted+wxPython : How to migrate to twistd ?

2012-01-11 Thread Glyph
On Jan 9, 2012, at 8:14 PM, bino oetomo wrote: > And if it not to much ... i prefer using twisted .tac file and > service.MultiService() and service.Application(). As far as I can tell, you're completely on the right track for what you want to do. I personally wouldn't use twistd for this, bu

Re: [Twisted-Python] question about twisted+wxPython : How to migrate to twistd ?

2012-01-09 Thread bino oetomo
Dear Glyph and All I see a reply to my question via http://twistedmatrix.com/pipermail/twisted-python/2012-January/025076.html but I didn't receive it in my mail box (is there a problem with this list). Thankyou for your reply. Yes, I want it to run that script as .tac file. Actualy I just n

Re: [Twisted-Python] question about twisted+wxPython : How to migrate to twistd ?

2012-01-09 Thread Glyph
Hi Bino, On Jan 9, 2012, at 12:39 AM, bino oetomo wrote: > How to migrate that script to twistd, something like : First of all, it's probably not appropriate to launch a WX GUI with twistd. It's possible, but you don't get a lot of benefit. If you are running in a GUI environment, your users

[Twisted-Python] question about twisted+wxPython : How to migrate to twistd ?

2012-01-08 Thread bino oetomo
Dear All ... I just copy and paste the code from http://code.activestate.com/recipes/298985/ and adding lines : -- self.allowNone = True self.useDateTime = False -- just before line# 45, and it work great. I need to adopting that script to my applicatio

Re: [Twisted-Python] Question : Combining wokel XMPP and twisted.internet.serial

2011-12-25 Thread bino oetomo
Dear Tim Allen and Jean-Paul I realy appreciate your enlightment .. i try it and it works Sincerely -bino- On 12/23/2011 11:15 AM, Tim Allen wrote: > It looks like "self.writethis" is an Element, not a string. Python's > print statement will automatically call str() on things before it prints > th

Re: [Twisted-Python] Question : Combining wokel XMPP and twisted.internet.serial

2011-12-22 Thread Tim Allen
On Fri, Dec 23, 2011 at 11:09:32AM +0700, bino oetomo wrote: > the "print self.writethis" do as told > > but the "self.serial.write(self.writethis)" line raise an exceptions > --START- >File "./mytac01.tac", line 44, in onMessage > self.serial.write(self.writet

Re: [Twisted-Python] Question : Combining wokel XMPP and twisted.internet.serial

2011-12-22 Thread bino oetomo
Dear Jean-Paul Thankyou for your help. On 12/23/2011 09:57 AM, exar...@twistedmatrix.com wrote: > > A SerialPort doesn't have a transport. It is a transport. Instead of: > > self.serial.transport.write(foo) > > try > > self.serial.write(foo) > Here is my function (edited) ---START-

Re: [Twisted-Python] Question : Combining wokel XMPP and twisted.internet.serial

2011-12-22 Thread exarkun
On 02:50 am, b...@indoakses-online.com wrote: >[snip] >The problem is when there is msg coming from XMPP part >It's received by the xmpp client part, but script complaining about >'SerialPort' object has no attribute 'transport' >I tried to send text from another xmppclient (pidgin) A SerialPort d

Re: [Twisted-Python] Question : Combining wokel XMPP and twisted.internet.serial

2011-12-22 Thread bino oetomo
Dear Lucas I realy appreciate your pastebin On 12/22/2011 01:12 PM, Lucas Taylor wrote: > > > ...and an update to your pastebin that may be helpful for context: > http://pastebin.com/2EJ22wXa > When I first try to adapt your script, there is error complaining about that "serial" have no "setParen

Re: [Twisted-Python] Question : Combining wokel XMPP and twisted.internet.serial

2011-12-21 Thread bino oetomo
Dear Lucas Taylor Thankyou for your fast enlightment. It's time for me to re-build my ejabberd turnkey linux Sincerely -bino- On 12/22/2011 01:12 PM, Lucas Taylor wrote: > > > This is a relevant FAQ for this situation: > http://twistedmatrix.com/trac/wiki/FrequentlyAskedQuestions#HowdoImakeinpu

Re: [Twisted-Python] Question : Combining wokel XMPP and twisted.internet.serial

2011-12-21 Thread Lucas Taylor
On Dec 21, 2011, at 9:52 PM, bino oetomo wrote: Dear All .. A year ago, I need send some defined message to a jabber conference. The message content will depend on a "button-press". My trick is to use ttyctrl (http://ttyctrl.sourceforge.net/). So basicaly my "system" is builded from several p

[Twisted-Python] Question : Combining wokel XMPP and twisted.internet.serial

2011-12-21 Thread bino oetomo
Dear All .. A year ago, I need send some defined message to a jabber conference. The message content will depend on a "button-press". My trick is to use ttyctrl (http://ttyctrl.sourceforge.net/). So basicaly my "system" is builded from several parts: 1. TTYCTRL : I made some small python XMLRPC c

Re: [Twisted-Python] Question about "starving" the reactor

2011-09-29 Thread Croepha
On Mon, Jun 20, 2011 at 11:23 AM, Luke Marsden < luke-li...@hybrid-logic.co.uk> wrote: > On Mon, 2011-06-20 at 11:09 -0400, Glyph Lefkowitz wrote: > > On Jun 20, 2011, at 7:39 AM, Phil Mayers wrote: > > > On 20/06/11 11:29, Orestis Markou wrote: > > >> It might be there's no way to do guarantee so

Re: [Twisted-Python] question : Twistar

2011-07-15 Thread gelin yan
hi... you can try to use host to indicate which server you want to connect with.. like: adbapi.ConnectionPool('xxx', host='localhost', user='twww',pwd='eee') On Wed, Jul 13, 2011 at 9:08 AM, bino oetomo wrote: > Dear All .. > > Base on a need, I need to build a JSON-RPC to Postgres "bridge"

[Twisted-Python] question : Twistar

2011-07-12 Thread bino oetomo
Dear All .. Base on a need, I need to build a JSON-RPC to Postgres "bridge". For now, I try to take the ORM way, so I'm looking for ORM "engine" that work well with Twisted and support for Postgres as it's backend. First try I look into SqlAlchemy ... but there is a lot of talk that SqlAlchemy

Re: [Twisted-Python] Question about "starving" the reactor

2011-06-20 Thread Terry Jones
I posted to the mailing list a few years back with a Deferred class that can log what callbacks were called, what result they returned, etc. It would be very easy to add callback timing information to that. You'd just insert a callback into the chain of any deferred you wanted to monitor to have it

Re: [Twisted-Python] Question about "starving" the reactor

2011-06-20 Thread Luke Marsden
On Mon, 2011-06-20 at 11:09 -0400, Glyph Lefkowitz wrote: > On Jun 20, 2011, at 7:39 AM, Phil Mayers wrote: > > On 20/06/11 11:29, Orestis Markou wrote: > >> It might be there's no way to do guarantee something like that, so it > >> might be just that everyone should be careful about this. > > > >

Re: [Twisted-Python] Question about "starving" the reactor

2011-06-20 Thread Glyph Lefkowitz
On Jun 20, 2011, at 7:39 AM, Phil Mayers wrote: > On 20/06/11 11:29, Orestis Markou wrote: > >> By "server" I mean my application's API, by "client" I mean someone >> else that will go and attach callbacks to deferreds I will return. I >> guess the question is, what is the best way to guard my ap

Re: [Twisted-Python] Question about "starving" the reactor

2011-06-20 Thread Phil Mayers
On 20/06/11 11:29, Orestis Markou wrote: > By "server" I mean my application's API, by "client" I mean someone > else that will go and attach callbacks to deferreds I will return. I > guess the question is, what is the best way to guard my application > against callbacks that are doing a lot of wo

Re: [Twisted-Python] Question about "starving" the reactor

2011-06-20 Thread Orestis Markou
>> reactor.callLater(0, d.callback, arg) > > That can help in some cases. Specifically if you're receiving datagrams, > you might want to service the read() loop as much as possible before > packets start to get dropped. But if d.callback is going to do a lot of > work, it doesn't solve the pro

Re: [Twisted-Python] Question about "starving" the reactor

2011-06-20 Thread Phil Mayers
On 06/20/2011 10:04 AM, Orestis Markou wrote: > Hello, > > I have a question about the "best practices" on making callbacks and > making sure you don't hog the reactor. > > So you pass a deferred to a client, who attaches a chain of callbacks Who is "you" and who is "client"? > that might probabl

[Twisted-Python] Question about "starving" the reactor

2011-06-20 Thread Orestis Markou
Hello, I have a question about the "best practices" on making callbacks and making sure you don't hog the reactor. So you pass a deferred to a client, who attaches a chain of callbacks that might probably do some CPU intensive stuff. How should one guard for that? The obvious solution to me fo

Re: [Twisted-Python] Question about using the adbapi

2011-05-10 Thread Albert Brandl
On Mon, May 09, 2011 at 02:15:04PM +0300, Pandelis Theodosiou wrote: > a) keep the last (longitude, latitude) pair for every receiver stored > in your script, too, besides the db. When a new pair of values > arrives, compare it with the current and only if it is different, send > the "INSERT" q

Re: [Twisted-Python] Question about using the adbapi

2011-05-10 Thread Albert Brandl
On Mon, May 09, 2011 at 11:03:12AM -, exar...@twistedmatrix.com wrote: > > d.addCallback(f, x, y) will result in f(resultOfD, x, y) Cool - no need to wrap the method call :-). The documentation for runQuery does not mention this feature, though: "Returns a Deferred which will fire the return

Re: [Twisted-Python] Question about using the adbapi

2011-05-09 Thread Pandelis Theodosiou
I see 2 other options: a) keep the last (longitude, latitude) pair for every receiver stored in your script, too, besides the db. When a new pair of values arrives, compare it with the current and only if it is different, send the "INSERT" query to the database. b) When a new pair of values arriv

Re: [Twisted-Python] Question about using the adbapi

2011-05-09 Thread exarkun
On 10:50 am, albert.bra...@weiermayer.com wrote: Hi! In the application I'm currently working on, we gather data from different sources and store them in a database, but only if the values have changed. One example is GPS information. We don't want to store hundreds of identical values that are

[Twisted-Python] Question about using the adbapi

2011-05-09 Thread Albert Brandl
Hi! In the application I'm currently working on, we gather data from different sources and store them in a database, but only if the values have changed. One example is GPS information. We don't want to store hundreds of identical values that are sent by the receiver, so we have to compare the

Re: [Twisted-Python] Question about StreamServerEndpointService

2011-04-28 Thread Albert Brandl
On Wed, Apr 27, 2011 at 04:50:17AM -0400, Glyph Lefkowitz wrote: > Thanks a lot. If you'd like to contribute a patch, of course, that would be > doubly appreciated :). I already thought about doing so. But my experience shows that patches usually take some rounds to be accepted, and I'd prefer to

Re: [Twisted-Python] Question about StreamServerEndpointService

2011-04-27 Thread Glyph Lefkowitz
On Apr 27, 2011, at 4:26 AM, Albert Brandl wrote: > Hi! > > On Wed, Apr 27, 2011 at 01:19:28AM -0400, Glyph Lefkowitz wrote: >> >> I haven't investigated too thoroughly, but it sounds like you have, and >> this does indeed sound like a bug. Could you write it up >> (

Re: [Twisted-Python] Question about StreamServerEndpointService

2011-04-27 Thread Albert Brandl
Hi! On Wed, Apr 27, 2011 at 01:19:28AM -0400, Glyph Lefkowitz wrote: > > I haven't investigated too thoroughly, but it sounds like you have, and > this does indeed sound like a bug. Could you write it up > (), so it doesn't get lost? Sure - http://twi

Re: [Twisted-Python] Question about StreamServerEndpointService

2011-04-26 Thread Glyph Lefkowitz
On Apr 26, 2011, at 6:21 AM, Albert Brandl wrote: > I might be wrong, but this looks like a bug to me. Maybe I didn't > understand how to use this class, though... I haven't investigated too thoroughly, but it sounds like you have, and this does indeed sound like a bug. Could you write it up

[Twisted-Python] Question about StreamServerEndpointService

2011-04-26 Thread Albert Brandl
Hi! I have a question regarding `t.a.i.StreamServerEndpointService`. This class maintains an attribute `_waitingForPort` that holds the deferred returned by the `listen` method of the endpoint. If this attribute is None, the method `privilegedStartService` is called by `startService`, triggeri

Re: [Twisted-Python] Question regarding the working of twisted python with celery

2011-03-03 Thread Andrew Bennetts
Dinesh Kapoor wrote: [...] >4. When celery is run with concurrency of 2, then I tried printing out the >process ids of calling process in the reactor code, and I am getting 2 >different pids, so I am assuming there are two seperate copies of reactor >in those separate tasks. This s

Re: [Twisted-Python] Question regarding the working of twisted python with celery

2011-03-03 Thread Dinesh Kapoor
Thanks Reza and Jean-Paul for your response. Actually, I tried investigating a bit more that whether the reactor is in different process than the calling celery task, and it doesn't seem to be the case. The workflow that I am assuming is as follows: 1. Celery creates a worker process and assigns a

Re: [Twisted-Python] Question regarding the working of twisted python with celery

2011-03-02 Thread exarkun
On 09:42 am, dineshkapoo...@gmail.com wrote: >Hi, > > I have run into a weird performance issue while working with twisted >and >using celery to schedule tasks on it. Here is my setup: > >1. Celery schedules a task which makes a TCP connection to a server >running >FreeSwitch >2. Celery is runni

Re: [Twisted-Python] Question regarding the working of twisted python with celery

2011-03-02 Thread Reza Lotun
On Wed, Mar 2, 2011 at 9:42 AM, Dinesh Kapoor wrote: > 2. Celery is running with concurrency = 2. > 3. I have changed my code so that I call reactor.callfromthread for all > reactor based work. > 4. A lot of times once I schedule the celery task, I get delays ranging from > 3 - 30 seconds when I a

[Twisted-Python] Question regarding the working of twisted python with celery

2011-03-02 Thread Dinesh Kapoor
Hi, I have run into a weird performance issue while working with twisted and using celery to schedule tasks on it. Here is my setup: 1. Celery schedules a task which makes a TCP connection to a server running FreeSwitch 2. Celery is running with concurrency = 2. 3. I have changed my code so tha

Re: [Twisted-Python] Question about SerialPort

2011-01-20 Thread Jason Valenzuela
On 1/20/2011 9:42 PM, James Y Knight wrote: > On Jan 20, 2011, at 6:32 AM, Albert Brandl wrote: >> The main problem seems to be the specification of Modbus RTU. RTU >> messages are separated by time gaps that are at least 3.5 characters >> long. Unfortunately, this is the only reliable way for sepa

Re: [Twisted-Python] Question about SerialPort

2011-01-20 Thread Albert Brandl
On Thu, Jan 20, 2011 at 08:42:58AM -0500, James Y Knight wrote: > I don't think you'll ever be able to do this reliably in Python. At > 9600 baud, 3.5 characters is just about 275hz (9600/10/3.5). Linux > schedules process at around 500hz. Well, that's bad news - I'll have to communicate with t

Re: [Twisted-Python] Question about SerialPort

2011-01-20 Thread James Y Knight
On Jan 20, 2011, at 6:32 AM, Albert Brandl wrote: > The main problem seems to be the specification of Modbus RTU. RTU > messages are separated by time gaps that are at least 3.5 characters > long. Unfortunately, this is the only reliable way for separating > messages - there is no length header or

[Twisted-Python] Question about SerialPort

2011-01-20 Thread Albert Brandl
Hi! I am trying to read Modbus RTU messages over the serial line. There is a library called pyModbus which is very usable for Modbus TCP/IP, but the support for RTU is a bit lacking. The main problem seems to be the specification of Modbus RTU. RTU messages are separated by time gaps that are at

Re: [Twisted-Python] Question about XMLRPC, Sync and ASync

2010-08-07 Thread Andrew Bennetts
Andrew Francis wrote: [...] > I am a little confused about the basic.LineReceiver because I thought > that was used for creating server protocols? Why would you think that? It's a perfectly good basis for implementing the client or server side of a line-based protocol. For example, the SMTP serv

Re: [Twisted-Python] Question about XMLRPC, Sync and ASync

2010-08-07 Thread Andrew Francis
Hi Colin: > Message: 1 > Date: Fri, 06 Aug 2010 11:02:33 -0700 > From: Colin Fox > Subject: [Twisted-Python] Question about XMLRPC, Sync and > ASync > To: twisted-python@twistedmatrix.com > Message-ID: <4c5c4e39.6080...@gmail.com> > Content-Type: text/plain; charset

Re: [Twisted-Python] Question about XMLRPC, Sync and ASync

2010-08-06 Thread Jason Valenzuela
On 8/7/2010 2:02 AM, Colin Fox wrote: > I think that deferreds will play a part here, but I guess I must be > missing something, as I'm not sure how to proceed. Can I return a > deferred from my XMLRPC handler? You may indeed return a deferred from an RPC method. > And if so, how do I fire the

[Twisted-Python] Question about XMLRPC, Sync and ASync

2010-08-06 Thread Colin Fox
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi everyone. I'm relatively new to Twisted, though I have used parts of it for a while. What I'm trying to do now has me a little stumped -- I have two servers, one of which answers XMLRPC requests, and it calls another one using the twisted basic.Li

  1   2   >