Re: [Twisted-Python] XMPP server connection question

2008-12-05 Thread Ralph Meijer

On 2008-12-05 11:42, Phil Mayers wrote:

Christopher Zorn wrote:

Yeah, the t.w.p.j.xmlstream.XmlStreamFactory inherits from 
ReconnectingClientFactory, which is IMHO wrong.


See also:

http://twistedmatrix.com/trac/ticket/3492


Wrong? It was just a design choice for this particular factory, made 
more than five years ago. Since then, the code has been refactored in 
such a way that it is pretty straightforward to have a non-reconnecting 
XMPP client:


-8<-8<-8<-
from twisted.words.xish.xmlstream import BootstrapMixin
from twisted.internet import protocol

class NonReconnectingXmlStreamFactory(BootstrapMixin,
  protocol.ClientFactory):
"""
XmlStream factory that connects at most once.

@ivar authenticator: The authenticator to be associated with the
 XmlStream once a connection has been
 established.
"""

def __init__(self, authenticator):
xmlstream.BootstrapMixin.__init__(self)
self.authenticator = authenticator

def buildProtocol(self, addr):
"""
Create an instance of XmlStream and associate the authenticator.
"""
xs = self.protocol(authenticator)
self.installBootstraps(xs)
return xs
-8<-8<-8<-

You can then also override protocol.ClientFactory's
clientConnectionFailed and clientConnectionLost as desirable. You should
probably add bootstrap handlers for STREAM_AUTHD_EVENT,
INIT_FAILED_EVENT, STREAM_ERROR_EVENT somewhere.

I have a similar special client factory in Wokkel that fires a deferred
as soon as a connection was made and the stream is authenticated. See
wokkel.client.DeferredClientFactory.

ralphm


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] raw xml to element, char encoding/decoding error

2009-02-18 Thread Ralph Meijer

On 2009-02-18 12:14, Gabriel Rossetti wrote:

Hello,

I wrote some code to transform a raw XML string into a domish.Element, 
and I keep on getting char encoding/decoding errors :


[..]
   parser.parse(tmp.toXml())

> [..]

Parser input is expected to be a string, not unicode. Try this instead:

  parser.parse(tmp.toXml().encode('utf-8'))

ralphm

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] raw xml to element, char encoding/decoding error

2009-02-18 Thread Ralph Meijer

On 2009-02-18 14:57, Gabriel Rossetti wrote:

Ralph Meijer wrote:

On 2009-02-18 12:14, Gabriel Rossetti wrote:
[..]

>>

Parser input is expected to be a string, not unicode. Try this instead:

  parser.parse(tmp.toXml().encode('utf-8'))

ralphm


Hello Ralphm,

yes, I had fixed that in the code attached in my last msg, it only works 
in Eclipse though.


Ah, but in /that/ code, you typed:

res = rawXmlToElement("reçu")

While you should have:

res = rawXmlToElement(u"reçu")

ralphm

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] copy domish element

2009-06-08 Thread Ralph Meijer
On Mon, 2009-06-08 at 18:03 +0100, Phil Mayers wrote:
> Jack Bates wrote:
> > i have a domish element - when i try the following,
> > 
>  message = element
>  del message['from']
>  element['from']
> > 
> > - i get a key error
> 
> Well, yes. That's how python works ;o)
> 
> > 
> > to avoid this key error, i think i want to copy the element, so i can
> > drop the 'from' attribute from one copy without affecting the other?
> > 
> > but i didn't find anything to make a copy in the domish element api
> 
> I haven't tried it, but have you tried the python standard copy protocol:
> 
> import copy
> message = copy.deepcopy(element)

Deep copies of Element instances is probably not what you want here. See
issue #724.

I suspect from your example that you want to respond to an incoming XML
Stanza. In general, it is better to construct a new stanza from the old
one, keeping the addressing but in reverse. There is a utility function
for this: twisted.words.protocols.jabber.xmlstream.toResponse. For error
responses, you want to look at t.w.p.j.error.StanzaError and its
toResponse method.

-- 
Groetjes,

ralphm


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Twisted Words

2009-06-09 Thread Ralph Meijer
On Mon, 2009-06-08 at 11:33 -0400, Alex Patino wrote:
> I am looking for a chat system to add to my Django-based chat site.  I
> don't need something ready-made but I don't want to build it on a
> framework that is no longer supported.  What's the status of the
> Twisted Words project?

Although, as exarkun mentions, Twisted Words currently does not have a
complete web-based chat system, the great people at StanzIQ have built a
suite of products to support this, using Twisted and a piece of Django.

First off, there is Punjab, an implementation of XMPP over BOSH, that
allows browser-based javascript applications do XMPP over HTTP. Then,
there is Strophe, or more specifically strophe.js, a javascript library
to build browser-based XMPP applications, talking to Punjab (or other
XMPP over BOSH implementations).

For a group chat application, they have Speeqe, a client-side
implementation of the Multi-User Chat XMPP Extension using strophe.js
and some server-side Django. In turn you need a server-side
implementation as well, to hold the chat rooms, and for this they have
built Palaver on top of Twisted Words.

You can read up on all of this marvelous stuff at http://stanziq.com/
Also, be sure not to miss the (now still rather incomplete) list of
applications using strophe.js:
http://code.stanziq.com/strophe/wiki/UseCases .

-- 
Groetjes,

ralphm


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] twisted.names.error.DNSNameError on MacOsX but not on linux

2009-08-13 Thread Ralph Meijer
On Tue, 2009-08-11 at 18:30 +0200, Gabriel Rossetti wrote:
> [..]

Apparently you modified the original example here:

> [..]
> connector = XMPPClientConnector(reactor, "10.204.232.117", f)
> connector.connect()

This would never work properly. XMPPClientConnector is designed to do an
SRV record look up on the /domain/ provided as its second argument. You
pass an IP address here and that will just fail.

The original example passes client_jid.host. This extracts the domain
from the JID you want to connect with and then follows the procedure of
first trying to find xmpp-server SRV records for that domain, and if
that fails, try to connect to the host that the domain name resolves to,
using the default port (5222), as outlined in RFC 3920. Note that
XMPPClientConnector avoids the problems sketched in ticket #3456 that
was mentioned by Jean-Paul.

If you really want to connect to a specific host instead of following
the above procedure, you can do this instead of the code quoted above:

reactor.connectTCP("10.204.232.117", 5222, f)

-- 
Groetjes,

ralphm
-- 
Groetjes,

ralphm


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] An XMPP client with SSL support

2009-09-17 Thread Ralph Meijer
On Wed, 2008-08-27 at 17:31 -0400, Pedro Sanchez wrote:
> Hello,
> 
> I have a sample XMPP client with the following structure:
> 
> from twisted.words.protocols.jabber import client, jid
> from twisted.internet import reactor
> ...
> factory = client.basicClientFactory(myJid, myPasswd)
> reactor.connectTCP(host,5222,factory)
> reactor.run()
> 
> It works well, I can connect to the XMPP server. But I would appreciate
> if some one could give me some hints on what's required to get the
> client to connect using a secure SSL link.

Use client.XMPPClientFactory instead, and make sure you have pyOpenSSL
installed.

ralphm



___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] An XMPP client with SSL support

2009-09-17 Thread Ralph Meijer
On Thu, Sep 17, 2009 at 04:33:43PM +0200, Ralph Meijer wrote:
> On Wed, 2008-08-27 at 17:31 -0400, Pedro Sanchez wrote:

Oh, ahum. That's quite the latency...

-- 
Groetjes,

ralphm

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] twisted-wave?

2009-10-02 Thread Ralph Meijer
On Fri, 2009-08-21 at 11:40 -0400, Stephen Waterbury wrote:
> Just curious what the twisted minions think of google wave
> and whether anyone is considering or working on a twisted
> implementation of the federation protocol,
> .

In general, implementing the protocol is the easy part. It is 'just'
XMPP and Twisted has support for that. It uses the XMPP Publish
Subscribe extension protocol [1], for which Wokkel [2] has extensive
support that should move to Twisted proper.

The thing that is harder is interpreting all the commands and applying
the Operational Transformation [1] algorithms that are communicated
throught the rather easy federation protocol. Oh, and use Protocol
Buffers, of course.

ralphm

[1] http://xmpp.org/extensions/xep-0060.html
[2] http://wokkel.ik.nu/
[3] http://www.waveprotocol.org/whitepapers/operational-transform




___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] copy.deepcopy domish.Element works in python 2.5 but not in 2.6

2009-12-18 Thread Ralph Meijer
On Thu, 2009-12-17 at 18:11 +, exar...@twistedmatrix.com wrote:
> On 05:40 pm, gabriel.rosse...@arimaz.com wrote:
> >Hello everyone,
> >
> >for some reason copy.deepcopy forks great on a domish.Element on 2.5 
> >but
> >not in 2.6 :
>
> Actually, it looks like it works about equally well on either version. 
> While it looks like an exception was raised by deepcopy on Python 2.6, 
> notice that the exception was actually *ignored*.  You get back a copy, 
> and it even seems to have all the right attributes. ;)
> 
> The infinite recursion in deepcopy happens on Python 2.5 as well.  I'm 
> not completely sure why it's not being reported, but it probably has to 
> do with tiny differences in how deepcopy works.  hasattr is well known 
> for swallowing exceptions silently.  The impressive thing is that the 
> error is reported at all in Python 2.6.
> 
> A good rule of thumb is to assume that types don't support being copied 
> like this unless their docs explicitly state that they do.  If you want 
> this to be supported, it's probably not too hard to implement.  Feel 
> free to file a ticket with a patch. :)

There is an open ticket about this:

  http://twistedmatrix.com/trac/ticket/724

In short: it is probably a bad idea, and I'm curious about the possible
useful use cases.

ralphm




___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Sending domish.Element results to Unpersistable

2009-12-28 Thread Ralph Meijer
On Mon, 2009-12-28 at 10:14 +0800, Enrique Samson Jr. wrote:
> Hi,
> 
> I'm using PB to to send copies of domish.Element instances to another
> application. I just don't want to parse XML again and thought it would
> be better to send Element copies and save parsing on the other end. But
> receiving application just gets an Unpersistable.

I am not familiar enough with PB, but I assume that PB cannot serialize
objects of unknown classes without any help. In general, serialization
of XML is way more expensive than parsing, but I'd be very curious about
when this would actually become a problem.

> I'm considering reducing the Element instances to dicts but I may leave
> out details I may need in the future.

Except for parent, the instance variables mentioned in the docstring of
Element is all you need to remember. Note that this also requires
walking the DOM tree for the element you want to send over, and then
build up the tree on the other side. It might be just as expensive as
using an XML stream.

I've been thinking about building a (streaming) parser that would mostly
lex the incoming XML stream and only extract as much as needed for
routing, leaving the XML Stanza's payload as an unparsed string that can
be sent along further.

ralphm


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Log rotates not as expected

2010-01-28 Thread Ralph Meijer
On Thu, 2010-01-28 at 09:46 +0100, Pet wrote:
> [..]
>
> I'm getting an error while starting my service:
> 
> Failed to load application: 'module' object has no attribute 'ILogObserver'

ILogObserver was introduced in Twisted 8.2. You are probably using an
older version.

ralphm


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] [ANNOUNCE] Twisted 10.0.0pre1 is now released

2010-02-24 Thread Ralph Meijer
On Wed, 2010-02-24 at 11:20 -0500, Glyph Lefkowitz wrote:
> [..]
>
> Much as I don't like ReST, it's a heck of a lot better than trac markup.  You 
> can't really manipulate trac markup with anything but trac, but ReST gives 
> you all of docutils.
> 
> If we used ReST, we could integrate it with the rest of the documentation 
> once lore's gone, and we can use the {{{<<<###$$$ syntax that Trac has 
> (I was offline while writing this email, sorry that's not exact) to get it 
> into the wiki.

By default, there should be a ReST handler in Trac, if docutils is
installed. This can be used with {{{#!rst ...}}}.

ralphm 


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] twisted xmpp-router component interface problem

2010-03-03 Thread Ralph Meijer
On Wed, 2010-03-03 at 14:32 -0500, Drew Smathers wrote:
> On Wed, Mar 3, 2010 at 1:56 PM, Werner Thie 
> wrote:
> [..]
>
> After some fiddling around it seems that the code at line 282
> in
> twisted\words\protocols\jabber\xmlstream.py presets the sid of
> the
> stream to a str instead of a unicode(str).

Yes, this is a problem I noticed the other day as well. A ticket,
assigned to me, is in order.

> Just out of curiosity, I did look at xmlstream and the whole unicode
> type checking seems unnecessary considering how the values are used:
>
> input = u"%s%s" % (sid, password)
>
> Why sid and password have to be unicode objects and not just
> basestring beats me.

For the gory details, see http://twistedmatrix.com/trac/ticket/3847. The
short version is that digest authentication requires UTF-8 encoded input
and GTK sets Python's default encoding to UTF-8. Before these checks,
using non-ASCII characters in passwords would fail in some cases. As
both the session id and password can use the full range of unicode, it
makes sense to require that explicitly.

ralphm



___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] twisted xmpp-router component interface problem

2010-03-03 Thread Ralph Meijer
On Wed, 2010-03-03 at 22:25 +0100, Ralph Meijer wrote:
> On Wed, 2010-03-03 at 14:32 -0500, Drew Smathers wrote:
> > On Wed, Mar 3, 2010 at 1:56 PM, Werner Thie 
> > wrote:
> > [..]
> >
> > After some fiddling around it seems that the code at line 282
> > in
> > twisted\words\protocols\jabber\xmlstream.py presets the sid of
> > the
> > stream to a str instead of a unicode(str).
> 
> Yes, this is a problem I noticed the other day as well. A ticket,
> assigned to me, is in order.

I created http://twistedmatrix.com/trac/ticket/4345 for this.

ralphm


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Using SerialPort with t.a.s.Application

2011-01-28 Thread Ralph Meijer
On Fri, 2011-01-28 at 09:29 +0100, Albert Brandl wrote:
> Hi!
> 
> In our project, we accumulate data from various sources. Some of them are
> connected via serial line (e.g. a GPS receiver and a weather station).
> 
> I'd like to run the application with twistd. But it looks as if SerialPort
> does not really fit into this framework. It does not implement IService,
> so `my_serial_port.setServiceParent(collection)` does not work.
> 
> Is there any technical reason that SerialPort does not implement 
> IService? Could you suggest a workaround for this problem (other than 
> dumping t.a.s.Application ;-))?

One way to do this, is using t.a.i.GenericClient to hook up the device
to the protocol. This is also a Service that can be hooked up to an
Application. Unfortunately, it uses the now deprecated connectWith
method on a reactor, and therefore GenericClient has been deprecated as
well.

exarkun suggested a new FileDescriptorClient that might use the
reactor's addReader and addWriter methods.

--
ralphm




___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Using six for Python3 porting

2015-04-24 Thread Ralph Meijer
On 2015-04-24 08:41, Adi Roiban wrote:
> Hi,
> 
> I feel that twisted.python.compat is slowly duplicating / reinventing
> an important part of the six code.
> 
> Code which does not import from  twisted.python.compat will have all
> kind of ad-hoc / in module code to handle differences between py2 and
> py3 and many if _PY3 conditional blocks.
> 
> What do you say if we add six as dependency for twisted ?
> 
> In case you don't want six as a dependency, it can be copied in
> twisted code base and make it available from twisted.python.six or a
> similar package.

I vaguely remembered working on this at PyCon in 2014:
https://twistedmatrix.com/trac/ticket/7177

-- 
ralphm

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] overview: new review queue venue

2016-05-22 Thread Ralph Meijer
On May 22, 2016 9:36:28 AM GMT+02:00, Glyph  wrote:
>[..]
>(Please nobody try to do the clever thing where you configure buildbot
>to automatically pull all PRs, that would effectively negate any
>security protections...)
>
>I've been assuming that in the worst-case scenario, we'd do what
>Cryptography does and have a bot that polls for special comments and
>then triggers buildbot in exactly this way.  Perhaps I should have made
>that assumption explicit, I thought it was ticketed somewhere in Braid
>already.

The Jenkins plugin for GitHub PR triggers has this feature, too. However, it 
also has a feature to whitelist users and GitHub teams so that PRs/commits can 
trigger automatically for them. Maybe that's a thing for us, too?


-- 
ralphm

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Twisted Project Jobs Volunteer

2011-11-17 Thread Ralph Meijer
On Thu, 2011-11-17 at 14:46 +1100, Tim Allen wrote:
> On Wed, Nov 16, 2011 at 08:17:51AM -0600, Jeffrey Ollie wrote:
>[..snip..]
>
> > One feature that I'd like to add before calling this final is
> > converting SVN usernames to "proper" names/email addresses like Git
> > prefers to use.
> 
> I see your script repository already has the beginnings of such
> a mapping file; unfortunately you've already filled in most of the names
> I recognise, and I don't know if there's any other authoritative list of
> such information (and of course, it would need to be updated as Twisted
> adds new committers).

These might be a good start:

http://twistedmatrix.com/trac/wiki/TwistedMatrixLaboratories
http://twistedmatrix.com/trac/browser/trunk/twisted/topfiles/CREDITS

However the latter hasn't changed in 5 years, the former probably also
isn't complete and people's e-mail addresses might not map their
(current) Git(Hub) one.

--
ralphm


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


[Twisted-Python] Unknown constants

2011-12-26 Thread Ralph Meijer
Hi,

I've been looking into using twisted.python.constants for representing 
the status codes of the XMPP Multi-User Chat protocol [1]. I will have 
objects representing messages, of which one of the attributes is 
'mucStatuses', a set of status codes. This works out great for the 
initial set of available status codes. The protocol is parsed, and the 
status codes are represented by the ValueConstant instances returned by 
lookupByValue.

However, not all of the possible codes can be known up-front, as the 
protocol allows for registering new ones without changing the 
specification itself. Eventually, applications will receive status codes 
that are not (yet?) part of the set of defined constants in the 
implementation, and application developers (that do know about new 
codes) will want to handle these.

A possible remedy to would be to register new status codes from the 
application itself. My first try of just adding a new attribute to the 
class fails because they are not 'realized' as the _enumerants are cached.

I can imagine this also goes for unknown HTTP methods and HTTP status 
codes, used as examples in the documentation. Any suggestions on how to 
handle such unknown constants?


[1] 

-- 
ralphm

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


[Twisted-Python] [Twisted-Jabber] [ANNOUNCE] Wokkel 0.7.0

2012-01-23 Thread Ralph Meijer
Hi!

I am proud to announce version 0.7.0 of Wokkel, a set of enhancements on 
the Jabber/XMPP support in Twisted Words.

http://wokkel.ik.nu/releases/0.7.0/wokkel-0.7.0.tar.gz

The highlights:

  * Protocol support for Publish-Subscribe subscription options,
subscription identifiers and node configuration options.

  * Enhancements to Data Forms support for easier creation of forms to be
submitted, and (type) verification of forms that are received.

  * A twistd plugin for running a basic XMPP server which accepts
server-side components connections and provides server-to-server
(dialback) connectivity.

  * Support for the Delayed Delivery data format.

  * Client-side support for Multi-User Chat, including a simple example.

Besides those new features, various bugs have been resolved and test 
coverage has been significantly improved. This release drops support for 
Twisted versions before 10.0.0. See the complete news file at:

http://wokkel.ik.nu/releases/0.7.0/NEWS

With this release out of the way, my focus for this year will be on 
moving things from Wokkel to Words.

Jabber on!

--
ralphm

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Must avatarId always be a string?

2013-01-09 Thread Ralph Meijer
On 2013-01-09 15:40, Adi Roiban wrote:
> On 9 January 2013 15:04, Jan Urbański  wrote:
>> On 09/01/13 13:49, Peter Westlake wrote:
>>> http://twistedmatrix.com/documents/current/core/howto/cred.html says
>>> that the avatarId parameter to IRealm.requestAvatar must be a string,
>>> not even a Unicode string. I'm using LDAP for authentication, and the
>>> checker retrieves the full LDAP entry for the user as a side-effect of
>>> authentication.
>>
>> I remember discussing this on IRC with someone not long ago and he
>> pointed me to this thread:
>>
>> http://twistedmatrix.com/pipermail/twisted-python/2010-September/022826.html
>>
>> I have faced a similar problem myself and after reading the code I've
>> resolved to wilfully disregarding the documentation and passing tuples
>> around, accepting that if it breaks, I get to keep both pieces.
>
> I am not an expert in Twisted, but from my understanding, the "string"
> requirement is there to provide a plugable interface. So that you can
> have generic credentials checkers, working with generic realms.
> Having simple "strings" could also help with AvatarId serialization,
> in case you have the CredentialsChecker on one computer and the you
> will pass them over network/socket to a remote Realm.
>
> I have also asked over IRC and I got the good to go answer for using
> anything as AvatarID.
>
> As long as you are only using your custom credentials checkers and
> your custom realm, everything should be ok.
>
> I am using Objects as AvatarID without any problems.

I want to add here that the special avatarID for anonymous 
authenticationm, twisted.cred.checkers.ANONYMOUS, is defined as the 
empty tuple.

-- 
ralphm

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


[Twisted-Python] [Twisted-Jabber] [ANNOUNCE] Wokkel 0.7.1

2013-01-12 Thread Ralph Meijer
Hi!

I am proud to announce version 0.7.1 of Wokkel, a set of enhancements on 
the Jabber/XMPP support in Twisted Words.

http://wokkel.ik.nu/releases/0.7.1/wokkel-0.7.1.tar.gz


The highlights:

  * This release addresses an incompatibility with Twisted 12.3.0,
which made it impossible for clients to connect to a server, and
for servers to connect to other servers. As a bonus, connecting to
servers with an Internationalized Domain Name is now supported.

  * Several improvements to client-side roster handling, including
support for roster versioning, rejecting unauthorized roster pushes
and adding roster items.

  * Server-side components will now try to reconnect to the server
if the first attempt failed.

Besides those, a few minor bugs have been resolved. See the complete 
news file at:

http://wokkel.ik.nu/releases/0.7.1/NEWS

Jabber on!

-- 
ralphm

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Twisted Names strings

2013-01-17 Thread Ralph Meijer
David Reid  wrote:

>Honestly, if you have comprehensive automated testing and plan to
>upgrade
>Twisted regularly or to try and support the latest release it is worth
>the
>effort to setup testing against Twisted trunk.
>
>https://github.com/dreid/treq/blob/master/.travis.yml shows how I do
>this
>with travis-ci.

In this particular case, the problem was an integration issue. All Wokkel's 
test cases passed (over at travis-ci), but the code setting up clients was 
calling SRVConnect with a value that is now being rejected. I.e. it used to 
happily, but erroneously, take unicode strings with ASCII compatible code 
points. Apart from actually using a client, no unit tests would have caught 
this, I believe.

That said, I fully take blame for not making time to test Wokkel against the 
pre-release.


-- 
ralphm___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Twisted Names strings

2013-01-17 Thread Ralph Meijer
On 2013-01-17 23:09, Ralph Meijer wrote:
> David Reid  wrote:
>
> Honestly, if you have comprehensive automated testing and plan to
> upgrade Twisted regularly or to try and support the latest release
> it is worth the effort to setup testing against Twisted trunk.
>
> https://github.com/dreid/treq/blob/master/.travis.yml shows how I do
> this with travis-ci.

(interestingly, K-9 only sent my reply in the plain-text version:)

In this particular case, the problem was an integration issue. All 
Wokkel's test cases passed (over at travis-ci), but the code setting up 
clients was calling SRVConnect with a value that is now being rejected. 
I.e. it used to happily, but erroneously, take unicode strings with 
ASCII compatible code points. Apart from actually using a client, no 
unit tests would have caught this, I believe.

That said, I fully take blame for not making time to test Wokkel against 
the pre-release.

-- 
ralphm

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] maintenance release - a security issue and a regression

2013-01-30 Thread Ralph Meijer
I'll look at #6245 again tomorrow.

-- 
ralphm

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Jabber client, tls and iqauth

2013-03-17 Thread Ralph Meijer
On 2013-03-15 08:32, rakdeFR wrote:
> Hi!
>
> I did some searches about my problem and didn't find any thing that
> match in the archives.
>
> I'm trying to do a simple jabber client with the twisted framework in
> order to automatically send messages.
>
> The server is a prosody server, and enabled the tls and iq auth.
>
> So far, I can connect to the server, and can't login.

Before going into the problem you might be having, are you referring to 
non-SASL authentication [1]? If so, that way of authenticating is 
obsolete since 2008 and all XMPP clients and servers are required to do 
SASL authentication instead.

Does that Prosody server have SASL explicitly disabled? It would also be 
useful to have the traffic log. Be sure to redact (encoded) credentials.

[1] http://xmpp.org/extensions/xep-0078.html

-- 
ralphm

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Deprecated Modules

2013-04-12 Thread Ralph Meijer
On 2013-04-12 08:43, RJ Ewing wrote:
> If I import a deprecated module and then run the test-suite should I be
> seeing an error? I think that I should be seeing an error, but I am not.
> I am not sure if I am doing something wrong or if my local environment
> is weird.

Twisted should always emit DeprecationWarnings for such uses. However, 
since Python 2.7, these are suppressed by default and you need to 
specifically enable the 'default' setting to see them again. Yeah.

See 
 
for details.

-- 
ralphm

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] github, again

2013-06-03 Thread Ralph Meijer

On 2013-06-03 22:59, Glyph wrote:

Hi Twisted developers,

[..]

>

One suggestion that almost everybody made immediately was: we should use
Github for code reviews.


As mentioned on IRC, the only comment I have is about the lack of proper 
e-mail addresses associated with commits. Tom is investigating if this 
can be done with .mailmap, instead of having to make a proper mirror again.


Otherwise: do it.

--
ralphm

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Can't check elements without uri in twisted.words.xish.domish.Element

2013-09-05 Thread Ralph Meijer
On 2013-09-04 16:43, Goffi wrote:
> G'day,
> 
> in the method "elements" of twisted.words.xish.domish.Element, the
> function "generateElementsQNamed" is called event if the uri if None, so
> the uri is checked against None instead of not checked at all.
> 
> I think the function "generateElementsNamed" should be called instead,
> it looks like a bug for me.
> Can you confirm ?

The docstring says you have to either pass in both or not. I would say
your suggestion is a feature request at best.

If we would call generateElementsNamed when only the name parameter is
set, you might get unrelated child elements in a different namespace
than you are looking for. I can imagine cases where this becomes an
attack vector. IMO, you should *always* pass in the fully qualified name
here.

The other permutation that is not currently supported, where you do pass
in the URI but not the local name, seems more useful to me.

-- 
ralphm

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python