[Twisted-Python] Simple bidirectional Socket Client

2013-06-14 Thread Raketenschnitzel
Hi there, i'm new to twisted, but i want to use it in a project for dealing with the socket connection to a server for receiving and sending data. I already did some projects in Delphi and there you have an build-in eventdriven socket class. Python itself lacks at this feature (afaik) and so i

Re: [Twisted-Python] Simple bidirectional Socket Client

2013-06-14 Thread Marco Giusti
On Fri, Jun 14, 2013 at 02:11:20PM +0200, Raketenschnitzel wrote: ... > class Communicator(ClientFactory): > protocol = ControllerProtocol > > def __init__(self, Host, Port): > if isinstance(Host, str) and isinstance(Port, int) : > self.myHost = Host > self.

Re: [Twisted-Python] Testing AMP-based code

2013-06-14 Thread Free Ekanayaka
|--==> On Wed, 12 Jun 2013 23:16:12 -, exar...@twistedmatrix.com said: > I think this is thinking in the right direction. Twisted generally > tries to be responsible for testing its own code, and the > serialization from commands to bytes (and the reverse) that AMP does > is part of T

Re: [Twisted-Python] logging

2013-06-14 Thread Christopher Armstrong
On Fri, Jun 14, 2013 at 1:41 AM, Jamu Kakar wrote: > Hi, > > On Thu, Jun 13, 2013 at 6:41 PM, Facundo Batista > wrote: >> Mmm... which is the problem with doing: >> >> log.msg("Foo happened. Relevant information includes: " >> "bar=%s baz=%s boz=%s", bar, baz, boz) >> >> Is way more

Re: [Twisted-Python] logging

2013-06-14 Thread exarkun
On 07:45 pm, ra...@twistedmatrix.com wrote: On Fri, Jun 14, 2013 at 1:41 AM, Jamu Kakar wrote: Hi, On Thu, Jun 13, 2013 at 6:41 PM, Facundo Batista wrote: Mmm... which is the problem with doing: log.msg("Foo happened. Relevant information includes: " "bar=%s baz=%s boz=%s", bar

Re: [Twisted-Python] logging

2013-06-14 Thread Christopher Armstrong
On Fri, Jun 14, 2013 at 4:47 PM, wrote: > On 07:45 pm, ra...@twistedmatrix.com wrote: >> I think both of these should be avoided because they require the user >> to specify string interpolation themselves. I'd prefer to avoid that >> entirely, by default. >> >> log.msg("Foo happened**", bar=bar,

Re: [Twisted-Python] logging

2013-06-14 Thread Glyph
On Jun 13, 2013, at 4:16 PM, Christopher Armstrong wrote: > On Thu, Jun 13, 2013 at 5:14 PM, Glyph wrote: >> >> Hello everybody. Today I'd like to talk about everyone's favorite subsystem >> within Twisted: logging. >> >> There are a number of problems with Twisted's logging system. > > Th

Re: [Twisted-Python] logging

2013-06-14 Thread Christopher Armstrong
On Fri, Jun 14, 2013 at 5:43 PM, Christopher Armstrong wrote: > If you're concerned about universal uniqueness, there are two ways I > can think of doing it, both of which should basically have a similar > API as far as where concerns are in your code: > > - make the event name hierarchical with a

[Twisted-Python] Announcing twisted-dev-tools

2013-06-14 Thread Tom Prince
http://labs.twistedmatrix.com/2013/06/announcing-twisted-dev-tools.html I'd like to announce the release of twisted-dev-tools. It is a project that collects various python scripts useful for developer working on twisted itself. Right now, it contains the following tools. - force-build: This

Re: [Twisted-Python] logging

2013-06-14 Thread Wilfredo Sánchez Vega
Christopher Armstrong wrote: logger.msg("scheduled-compaction-failed") I'm confused. You don't want to use English, but... why not change your hyphens to spaces and call it a day? Also, why did it fail? Here's a fuller example, modified to fit the API I'm using: from twisted.python.log

Re: [Twisted-Python] logging

2013-06-14 Thread Glyph
On Jun 14, 2013, at 3:43 PM, Glyph wrote: > I think that we can satisfy all of these requirements by expanding the notion > of an "identifier" a bit. In our last episode, I mentioned that an identifier should have several properties: human readable (and potentially non-unique) for ease of wr

Re: [Twisted-Python] Announcing twisted-dev-tools

2013-06-14 Thread Glyph
On Jun 14, 2013, at 3:45 PM, Tom Prince wrote: > http://labs.twistedmatrix.com/2013/06/announcing-twisted-dev-tools.html > > I'd like to announce the release of twisted-dev-tools. It is a project that > collects various python scripts useful for developer working on twisted > itself. Cool! I

Re: [Twisted-Python] logging

2013-06-14 Thread Christopher Armstrong
On Fri, Jun 14, 2013 at 6:20 PM, Wilfredo Sánchez Vega wrote: > Christopher Armstrong wrote: > > logger.msg("scheduled-compaction-failed") > > I'm confused. You don't want to use English, but… why not change your > hyphens to spaces and call it a day? Also, why did it fail? Because as soon as

Re: [Twisted-Python] logging

2013-06-14 Thread Christopher Armstrong
On Fri, Jun 14, 2013 at 6:40 PM, Glyph wrote: > > On Jun 14, 2013, at 3:43 PM, Glyph wrote: > > I think that we can satisfy all of these requirements by expanding the > notion of an "identifier" a bit. > > > In our last episode, I mentioned that an identifier should have several > properties: > >

Re: [Twisted-Python] logging

2013-06-14 Thread Christopher Armstrong
On Sat, Jun 15, 2013 at 12:43 AM, Christopher Armstrong wrote: > On Fri, Jun 14, 2013 at 6:20 PM, Wilfredo Sánchez Vega > wrote: >> Christopher Armstrong wrote: >> >> logger.msg("scheduled-compaction-failed") >> >> I'm confused. You don't want to use English, but… why not change your >> hyphen