Permalink
Browse files

- some cosmetic and documentation fixes

  • Loading branch information...
Jajcus committed Dec 26, 2005
1 parent 5c5d4b9 commit 2a4cdfe2d365ba5450eecbadde198a0c951c54a6
@@ -13,12 +13,6 @@ I0011: 17: Locally disabling 'W0132'
I0011: 17: Locally disabling 'W0611'
************* Module pyxmpp.streambase
I0011: 17: Locally disabling 'W0201'
************* Module pyxmpp._xmlextra
I0001: 0: Unable to run raw checkers on built-in module pyxmpp._xmlextra
W0103: 0: Missing required attribute "__revision__"
W0131: 0:remove_ns: Missing docstring
W0131: 0:replace_ns: Missing docstring
W0131: 0:sax_reader_new: Missing docstring
************* Module pyxmpp.clientstream
I0011: 17: Locally disabling 'W0221'
W0511:349: FIXME: that should be the hostname choosen from SRV records found.
@@ -32,39 +26,21 @@ I0011: 17: Locally disabling 'W0201'
************* Module pyxmpp.version
I0011: 1: Locally disabling 'W0103'
I0011: 1: Locally disabling 'W0131'
************* Module pyxmpp.jabberd.all
I0011: 17: Locally disabling 'W0611'
************* Module pyxmpp.jabberd.componentstream
I0011: 17: Locally disabling 'W0221'
I0011: 17: Locally disabling 'W0201'
************* Module pyxmpp.sasl.core
W0511:188: FIXME: use some better RNG (/dev/urandom maybe)
************* Module pyxmpp._xmlextra
I0001: 0: Unable to run raw checkers on built-in module pyxmpp._xmlextra
W0103: 0: Missing required attribute "__revision__"
W0131: 0:remove_ns: Missing docstring
W0131: 0:replace_ns: Missing docstring
W0131: 0:sax_reader_new: Missing docstring
************* Module pyxmpp.jabber.muc
W0302: 0: Too many lines in module (1020)
W0511:639: TODO: kicks
W0511:691: TODO: ProtocolError
W0511:698: TODO: ProtocolError
************* Module pyxmpp.jabber.muccore
W0511:193: TODO: since -- requires parsing of Jabber dateTime profile
W0511:488: FIXME: alt,decline,invite,password
W0511:529: FIXME: implement
W0131:156:MucX.set_history: Missing docstring
E0602:157:MucX.set_history: Undefined variable 'xml_element_iter'
E0602:157:MucX.set_history: Undefined variable 'xmlnode'
E0602:158:MucX.set_history: Undefined variable 'child'
W0131:181:MucX.get_history: Missing docstring
E0602:182:MucX.get_history: Undefined variable 'xml_element_iter'
E0602:182:MucX.get_history: Undefined variable 'xmlnode'
E0602:183:MucX.get_history: Undefined variable 'child'
W0131:197:MucX.set_password: Missing docstring
E0602:198:MucX.set_password: Undefined variable 'xml_element_iter'
E0602:198:MucX.set_password: Undefined variable 'xmlnode'
E0602:199:MucX.set_password: Undefined variable 'child'
W0131:207:MucX.get_password: Missing docstring
E0602:208:MucX.get_password: Undefined variable 'xml_element_iter'
E0602:208:MucX.get_password: Undefined variable 'xmlnode'
E0602:209:MucX.get_password: Undefined variable 'child'
E0602:715:MucPresence.make_join_request: Undefined variable 'HistoryParams'
W0511:203: TODO: since -- requires parsing of Jabber dateTime profile
W0511:508: FIXME: alt,decline,invite,password
W0511:549: FIXME: implement
************* Module pyxmpp.jabber.all
I0011: 17: Locally disabling 'W0611'
************* Module pyxmpp.jabber.simple
@@ -75,11 +51,18 @@ I0011: 17: Locally disabling 'W0201'
************* Module pyxmpp.jabber.vcard
I0011: 17: Locally disabling 'W0302'
W0511:1326: FIXME: agent field
************* Module pyxmpp.jabberd.all
I0011: 17: Locally disabling 'W0611'
************* Module pyxmpp.jabberd.componentstream
I0011: 17: Locally disabling 'W0221'
I0011: 17: Locally disabling 'W0201'
************* Module pyxmpp.sasl.core
W0511:188: FIXME: use some better RNG (/dev/urandom maybe)


Report
======
6804 statements analysed.
6811 statements analysed.

Duplication
-----------
@@ -95,10 +78,10 @@ Raw metrics

type number % previous difference
:::::::::::::::::::::::::::::::::::::::::::
code 7483 47.80 7418 +65.00
docstring 6414 40.97 6337 +77.00
comment 770 4.92 770 =
empty 989 6.32 983 +6.00
code 7493 47.76 7493 =
docstring 6433 41.01 6433 =
comment 770 4.91 770 =
empty 992 6.32 992 =


External dependencies
@@ -107,9 +90,9 @@ External dependencies

stringprep (pyxmpp.xmppstringprep)
random (pyxmpp.streambase,pyxmpp.stanza,pyxmpp.resolver,pyxmpp.sasl.core,pyxmpp.sasl)
logging (pyxmpp.streamsasl,pyxmpp.streambase,pyxmpp.clientstream,pyxmpp.client,pyxmpp.stream,pyxmpp.streamtls,pyxmpp.stanzaprocessor,pyxmpp.jabberd.component,pyxmpp.jabberd.componentstream,pyxmpp.sasl.plain,pyxmpp.sasl.core,pyxmpp.sasl.digest_md5,pyxmpp.jabber.muc,pyxmpp.jabber.clientstream,pyxmpp.jabber.client,pyxmpp.jabber.register)
logging (pyxmpp.streamsasl,pyxmpp.streambase,pyxmpp.clientstream,pyxmpp.client,pyxmpp.stream,pyxmpp.streamtls,pyxmpp.stanzaprocessor,pyxmpp.jabber.muc,pyxmpp.jabber.clientstream,pyxmpp.jabber.client,pyxmpp.jabber.register,pyxmpp.jabberd.component,pyxmpp.jabberd.componentstream,pyxmpp.sasl.plain,pyxmpp.sasl.core,pyxmpp.sasl.digest_md5)
socket (pyxmpp.streambase,pyxmpp.resolver,pyxmpp.streamtls)
re (pyxmpp.jid,pyxmpp.xmlextra,pyxmpp.resolver,pyxmpp.sasl.digest_md5,pyxmpp.jabber.vcard)
warnings (pyxmpp.jid)
libxml2 (pyxmpp.roster,pyxmpp.presence,pyxmpp.xmlextra,pyxmpp.streambase,pyxmpp.stanza,pyxmpp.message,pyxmpp.objects,pyxmpp.stanzaprocessor,pyxmpp.iq,pyxmpp.error,pyxmpp.jabber.dataforms,pyxmpp.jabber.muccore,pyxmpp.jabber.delay,pyxmpp.jabber.disco,pyxmpp.jabber.vcard,pyxmpp.jabber.register)
base64 (pyxmpp.streamsasl,pyxmpp.jabber.vcard)
weakref (pyxmpp.jid,pyxmpp.jabber.muc)
@@ -126,6 +109,7 @@ External dependencies
\-resolver (pyxmpp.resolver)
encodings
\-idna (pyxmpp.jid,pyxmpp.resolver)
re (pyxmpp.jid,pyxmpp.xmlextra,pyxmpp.resolver,pyxmpp.jabber.vcard,pyxmpp.sasl.digest_md5)
copy (pyxmpp.jabber.dataforms)
os (pyxmpp.streambase)

@@ -143,8 +127,8 @@ Statistics by type
type number old number difference %documented %badname
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
module 45 45 = 97.78 0.00
class 125 124 +1.00 100.00 0.00
method 680 675 +5.00 97.94 0.74
class 125 125 = 100.00 0.00
method 679 679 = 98.53 0.74
function 47 47 = 93.62 0.00


@@ -155,37 +139,36 @@ type number previous difference
::::::::::::::::::::::::::::::::::::::
convention 0 0 =
refactor 0 0 =
warning 19 14 +5.00
error 13 0 +13.00
warning 15 15 =
error 0 3 -3.00


% errors / warnings by module
-----------------------------

module error warning refactor convention
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
pyxmpp.jabber.muccore 100.00 36.84 0.00 0.00
pyxmpp.jabber.muc 0.00 21.05 0.00 0.00
pyxmpp._xmlextra 0.00 21.05 0.00 0.00
pyxmpp.sasl.core 0.00 5.26 0.00 0.00
pyxmpp.jabber.vcard 0.00 5.26 0.00 0.00
pyxmpp.clientstream 0.00 5.26 0.00 0.00
pyxmpp.cache 0.00 5.26 0.00 0.00
module error warning refactor convention
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
pyxmpp.jabber.muc 0.00 26.67 0.00 0.00
pyxmpp._xmlextra 0.00 26.67 0.00 0.00
pyxmpp.jabber.muccore 0.00 20.00 0.00 0.00
pyxmpp.sasl.core 0.00 6.67 0.00 0.00
pyxmpp.jabber.vcard 0.00 6.67 0.00 0.00
pyxmpp.clientstream 0.00 6.67 0.00 0.00
pyxmpp.cache 0.00 6.67 0.00 0.00


Messages
--------

message id occurences
::::::::::::::::::::::
E0602 13
W0511 10
W0131 7
W0131 3
W0302 1
W0103 1


Global evaluation
-----------------
Your code has been rated at 9.88/10 (previous run: 9.98/10)
Your code has been rated at 9.98/10 (previous run: 9.96/10)

@@ -64,7 +64,6 @@ def __init__(self,jid,password=None,server=None,port=5222,
in the list should be prefixed with "sasl:" string.
- `tls_settings`: settings for StartTLS -- `TLSSettings` instance.
- `keepalive`: keepalive output interval. 0 to disable.
- `registration_form`: the registration form sent (when registering in-band).
:Types:
- `jid`: `pyxmpp.JID`
- `password`: `unicode`
@@ -73,7 +72,6 @@ def __init__(self,jid,password=None,server=None,port=5222,
- `auth_methods`: sequence of `str`
- `tls_settings`: `pyxmpp.TLSSettings`
- `keepalive`: `int`
- `registration_form`: `pyxmpp.jabber.dataforms.Form`
"""
(self.authenticated, self.available_auth_methods, self.auth_stanza,
self.peer_authenticated, self.auth_method_used,
@@ -49,11 +49,11 @@ def __init__(self, values, label = None):
"""Initialize an `Option` object.
:Parameters:
- `value`: option value.
- `values`: option values.
- `label`: option label (human-readable description).
:Types:
- `label`: `unicode`
- `value`: `unicode`
- `values`: `list` of `unicode`
"""
self.label = label
self.values = values
@@ -580,7 +580,7 @@ def make_submit(self, keep_types = False):
Remove uneeded information from the form. The information removed
includes: title, instructions, field labels, fixed fields etc.
:Raise: `ValueError` when any required field has no value.
:raise ValueError: when any required field has no value.
:Parameters:
- `keep_types`: when `True` field type information will be included
@@ -465,7 +465,7 @@ def join(self, password=None, history_maxchars = None,
- `history_maxstanzas`: limit of the total number of messages in
history.
- `history_seconds`: send only messages received in the last
`seconds` seconds.
`history_seconds` seconds.
- `history_since`: Send only the messages received since the
dateTime specified (UTC).
:Types:
@@ -860,15 +860,14 @@ def join(self, room, nick, handler, password = None, history_maxchars = None,
- `history_maxstanzas`: limit of the total number of messages in
history.
- `history_seconds`: send only messages received in the last
`seconds` seconds.
`history_seconds` seconds.
- `history_since`: Send only the messages received since the
dateTime specified (UTC).
:Types:
- `room`: `JID`
- `nick`: `unicode`
- `handler`: `MucRoomHandler`
- `history`: `HistoryParameters`
- `password`: `unicode`
- `history_maxchars`: `int`
- `history_maxstanzas`: `int`
@@ -251,12 +251,12 @@ def __init__(self, maxchars = None, maxstanzas = None, maxseconds = None, since
:Parameters:
- `maxchars`: limit of the total number of characters in history.
- `maxstanzas`: limit of the total number of messages in history.
- `seconds`: send only messages received in the last `seconds` seconds.
- `maxseconds`: send only messages received in the last `seconds` seconds.
- `since`: Send only the messages received since the dateTime specified.
:Types:
- `maxchars`: `int`
- `maxstanzas`: `int`
- `seconds`: `int`
- `maxseconds`: `int`
- `since`: `datetime.datetime`
"""
self.maxchars = maxchars
@@ -122,7 +122,7 @@ def __init__(self, xmlnode = None):
:Parameters:
- `xmlnode`: an optional XML node to parse.
:Types:
- `node`: `libxml2.xmlNode`
- `xmlnode`: `libxml2.xmlNode`
"""
self.__logger=logging.getLogger("pyxmpp.jabber.Register")
self.form = None
@@ -200,8 +200,10 @@ def get_form(self, form_type = "form"):
Convert legacy fields to a data form if `self.form` is `None`, return `self.form` otherwise.
:Parameters:
- `stanza_type`: If "form", then a form to fill-in should be
- `form_type`: If "form", then a form to fill-in should be
returned. If "sumbit", then a form with submitted data.
:Types:
- `form_type`: `unicode`
:return: `self.form` or a form created from the legacy fields
:returntype: `pyxmpp.jabber.dataforms.Form`"""
@@ -31,7 +31,6 @@

from encodings import idna

from pyxmpp.utils import from_utf8
from pyxmpp.xmppstringprep import nodeprep,resourceprep

node_invalid_re=re.compile(ur"[" u'"' ur"&'/:<>@\s\x00-\x19]",re.UNICODE)
@@ -27,7 +27,6 @@

import time
import datetime
import warnings

def to_utf8(s):
"""
@@ -406,6 +406,7 @@ def xml_node_iter(nodelist):
(not only the elements).
Usually used to iterade over node's children like this::
xml_node_iter(node.children)
:Parameters:
@@ -422,6 +423,7 @@ def xml_element_iter(nodelist):
"""Iterate over sibling XML elements. Non-element nodes will be skipped.
Usually used to iterade over node's children like this::
xml_node_iter(node.children)
:Parameters:
@@ -439,6 +441,7 @@ def xml_element_ns_iter(nodelist, ns_uri):
"""Iterate over sibling XML elements. Only elements in the given namespace will be returned.
Usually used to iterade over node's children like this::
xml_node_iter(node.children)
:Parameters:

0 comments on commit 2a4cdfe

Please sign in to comment.