More PEP8 compliance cleanups.

Cleaned up the atom entry stanza.
This commit is contained in:
Lance Stout 2010-10-06 15:12:39 -04:00
parent cbe76c8a70
commit c294c1a85c
5 changed files with 28 additions and 13 deletions

View file

@ -6,6 +6,7 @@
See the file LICENSE for copying permission. See the file LICENSE for copying permission.
""" """
class XMPPError(Exception): class XMPPError(Exception):
""" """

View file

@ -1,11 +1,26 @@
from .. xmlstream.stanzabase import registerStanzaPlugin, ElementBase, ET, JID """
from xml.etree import cElementTree as ET SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from sleekxmpp.xmlstream import ElementBase
class AtomEntry(ElementBase): class AtomEntry(ElementBase):
namespace = 'http://www.w3.org/2005/Atom'
name = 'entry' """
plugin_attrib = 'entry' A simple Atom feed entry.
interfaces = set(('title', 'summary'))
sub_interfaces = set(('title', 'summary')) Stanza Interface:
plugin_attrib_map = {} title -- The title of the Atom feed entry.
plugin_tag_map = {} summary -- The summary of the Atom feed entry.
"""
namespace = 'http://www.w3.org/2005/Atom'
name = 'entry'
plugin_attrib = 'entry'
interfaces = set(('title', 'summary'))
sub_interfaces = set(('title', 'summary'))

View file

@ -14,6 +14,6 @@ from sleekxmpp.xmlstream.tostring import tostring
from sleekxmpp.xmlstream.xmlstream import XMLStream, RESPONSE_TIMEOUT from sleekxmpp.xmlstream.xmlstream import XMLStream, RESPONSE_TIMEOUT
from sleekxmpp.xmlstream.xmlstream import RestartStream from sleekxmpp.xmlstream.xmlstream import RestartStream
__all__ = ['JID', 'Scheduler', 'StanzaBase', 'ElementBase', __all__ = ['JID', 'Scheduler', 'StanzaBase', 'ElementBase',
'ET', 'StateMachine', 'tostring', 'XMLStream', 'ET', 'StateMachine', 'tostring', 'XMLStream',
'RESPONSE_TIMEOUT', 'RestartStream'] 'RESPONSE_TIMEOUT', 'RestartStream']

View file

@ -12,5 +12,5 @@ from sleekxmpp.xmlstream.matcher.stanzapath import StanzaPath
from sleekxmpp.xmlstream.matcher.xmlmask import MatchXMLMask from sleekxmpp.xmlstream.matcher.xmlmask import MatchXMLMask
from sleekxmpp.xmlstream.matcher.xpath import MatchXPath from sleekxmpp.xmlstream.matcher.xpath import MatchXPath
__all__ = ['MatcherId', 'MatchMany', 'StanzaPath', __all__ = ['MatcherId', 'MatchMany', 'StanzaPath',
'MatchXMLMask', 'MatchXPath'] 'MatchXMLMask', 'MatchXPath']

View file

@ -588,7 +588,6 @@ class ElementBase(object):
if isinstance(xpath, str): if isinstance(xpath, str):
xpath = self._fix_ns(xpath, split=True, propagate_ns=False) xpath = self._fix_ns(xpath, split=True, propagate_ns=False)
# Extract the tag name and attribute checks for the first XPath node. # Extract the tag name and attribute checks for the first XPath node.
components = xpath[0].split('@') components = xpath[0].split('@')
tag = components[0] tag = components[0]