Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ehendrix23
slixmpp
Commits
2a808240
Commit
2a808240
authored
Aug 23, 2011
by
Lance Stout
Browse files
Remove extra debugging code that made it into a commit.
parent
f92f9632
Changes
2
Hide whitespace changes
Inline
Side-by-side
examples/adhoc_provider.py
View file @
2a808240
...
...
@@ -85,17 +85,6 @@ class CommandBot(sleekxmpp.ClientXMPP):
form
.
addField
(
var
=
'greeting'
,
ftype
=
'text-single'
,
label
=
'Your greeting'
)
form
.
addField
(
var
=
'recipient'
,
ftype
=
'jid-single'
,
label
=
'Who to greet'
)
form
.
addField
(
var
=
'message'
,
ftype
=
'text-multi'
,
label
=
'Your message'
)
form
.
addField
(
var
=
'demobool'
,
ftype
=
'boolean'
,
label
=
'Test booleans'
,
desc
=
'Test default values too'
,
value
=
True
)
session
[
'payload'
]
=
form
session
[
'next'
]
=
self
.
_handle_command_complete
...
...
@@ -137,13 +126,9 @@ class CommandBot(sleekxmpp.ClientXMPP):
form
=
payload
greeting
=
form
[
'values'
][
'greeting'
]
recipient
=
form
[
'values'
][
'recipient'
]
message
=
'
\n
'
.
join
(
form
[
'values'
][
'message'
])
if
recipient
is
None
:
recipient
=
session
[
'from'
]
self
.
send_message
(
mto
=
recipient
,
mbody
=
"%s, %s!
\n
%s"
%
(
greeting
,
recipient
,
message
),
self
.
send_message
(
mto
=
session
[
'from'
],
mbody
=
"%s, World!"
%
greeting
,
mtype
=
'chat'
)
# Having no return statement is the same as unsetting the 'payload'
...
...
examples/echo_client.py
View file @
2a808240
...
...
@@ -36,7 +36,7 @@ class EchoBot(sleekxmpp.ClientXMPP):
"""
def
__init__
(
self
,
jid
,
password
):
sleekxmpp
.
ClientXMPP
.
__init__
(
self
,
jid
,
password
,
plugin_config
=
{
'feature_mechanisms'
:
{
'use_mech'
:
'PLAIN'
}}
)
sleekxmpp
.
ClientXMPP
.
__init__
(
self
,
jid
,
password
)
# The session_start event will be triggered when
# the bot establishes its connection with the server
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment