Fixed linespacing and whitespace issues in examples to make them PEP8 compliant.

This commit is contained in:
Lance Stout 2010-09-01 18:21:09 -04:00
parent 0b4320a196
commit 4a2e7c5393
2 changed files with 10 additions and 10 deletions

View file

@ -24,7 +24,7 @@ from sleekxmpp.xmlstream.stanzabase import ET, registerStanzaPlugin
# by default. To ensure that Unicode is handled properly # by default. To ensure that Unicode is handled properly
# throughout SleekXMPP, we will set the default encoding # throughout SleekXMPP, we will set the default encoding
# ourselves to UTF-8. # ourselves to UTF-8.
if sys.version_info < (3,0): if sys.version_info < (3, 0):
reload(sys) reload(sys)
sys.setdefaultencoding('utf8') sys.setdefaultencoding('utf8')
@ -147,13 +147,13 @@ if __name__ == '__main__':
optp = OptionParser() optp = OptionParser()
# Output verbosity options. # Output verbosity options.
optp.add_option('-q','--quiet', help='set logging to ERROR', optp.add_option('-q', '--quiet', help='set logging to ERROR',
action='store_const', dest='loglevel', action='store_const', dest='loglevel',
const=logging.ERROR, default=logging.INFO) const=logging.ERROR, default=logging.INFO)
optp.add_option('-d','--debug', help='set logging to DEBUG', optp.add_option('-d', '--debug', help='set logging to DEBUG',
action='store_const', dest='loglevel', action='store_const', dest='loglevel',
const=logging.DEBUG, default=logging.INFO) const=logging.DEBUG, default=logging.INFO)
optp.add_option('-v','--verbose', help='set logging to COMM', optp.add_option('-v', '--verbose', help='set logging to COMM',
action='store_const', dest='loglevel', action='store_const', dest='loglevel',
const=5, default=logging.INFO) const=5, default=logging.INFO)
@ -173,8 +173,8 @@ if __name__ == '__main__':
config = Config(xml=ET.fromstring(config_data)) config = Config(xml=ET.fromstring(config_data))
config_file.close() config_file.close()
# Setup the ConfigComponent and register plugins. Note that while plugins may # Setup the ConfigComponent and register plugins. Note that while plugins
# have interdependencies, the order in which you register them does # may have interdependencies, the order in which you register them does
# not matter. # not matter.
xmpp = ConfigComponent(config) xmpp = ConfigComponent(config)
xmpp.registerPlugin('xep_0030') # Service Discovery xmpp.registerPlugin('xep_0030') # Service Discovery

View file

@ -20,7 +20,7 @@ import sleekxmpp
# by default. To ensure that Unicode is handled properly # by default. To ensure that Unicode is handled properly
# throughout SleekXMPP, we will set the default encoding # throughout SleekXMPP, we will set the default encoding
# ourselves to UTF-8. # ourselves to UTF-8.
if sys.version_info < (3,0): if sys.version_info < (3, 0):
reload(sys) reload(sys)
sys.setdefaultencoding('utf8') sys.setdefaultencoding('utf8')
@ -83,13 +83,13 @@ if __name__ == '__main__':
optp = OptionParser() optp = OptionParser()
# Output verbosity options. # Output verbosity options.
optp.add_option('-q','--quiet', help='set logging to ERROR', optp.add_option('-q', '--quiet', help='set logging to ERROR',
action='store_const', dest='loglevel', action='store_const', dest='loglevel',
const=logging.ERROR, default=logging.INFO) const=logging.ERROR, default=logging.INFO)
optp.add_option('-d','--debug', help='set logging to DEBUG', optp.add_option('-d', '--debug', help='set logging to DEBUG',
action='store_const', dest='loglevel', action='store_const', dest='loglevel',
const=logging.DEBUG, default=logging.INFO) const=logging.DEBUG, default=logging.INFO)
optp.add_option('-v','--verbose', help='set logging to COMM', optp.add_option('-v', '--verbose', help='set logging to COMM',
action='store_const', dest='loglevel', action='store_const', dest='loglevel',
const=5, default=logging.INFO) const=5, default=logging.INFO)