Permalink
Browse files

pep8 and pyflakes

  • Loading branch information...
1 parent 65f879c commit 328e7ab39da21f3f2e837bc585b12fe4bff8f702 @wraithan committed Sep 7, 2012
Showing with 24 additions and 106 deletions.
  1. +10 −95 docs/conf.py
  2. +9 −6 python/setup.py
  3. +5 −5 python/zenircbot_api.py
View
@@ -1,31 +1,21 @@
# -*- coding: utf-8 -*-
#
-# ZenIRCBot API documentation build configuration file, created by
-# sphinx-quickstart on Tue Apr 17 16:41:01 2012.
-#
-# This file is execfile()d with the current directory set to its containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-import sys, os
+import sys
+import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../python'))
-# -- General configuration -----------------------------------------------------
+# -- General configuration ----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
-# Add any Sphinx extension module names here, as strings. They can be extensions
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc',]
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.autodoc']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -66,7 +56,8 @@
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
-# The reST default role (used for this markup: `text`) to use for all documents.
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
@@ -87,7 +78,7 @@
#modindex_common_prefix = []
-# -- Options for HTML output ---------------------------------------------------
+# -- Options for HTML output --------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
@@ -167,82 +158,6 @@
htmlhelp_basename = 'ZenIRCBotAPIdoc'
-# -- Options for LaTeX output --------------------------------------------------
-
-latex_elements = {
-# The paper size ('letterpaper' or 'a4paper').
-#'papersize': 'letterpaper',
-
-# The font size ('10pt', '11pt' or '12pt').
-#'pointsize': '10pt',
-
-# Additional stuff for the LaTeX preamble.
-#'preamble': '',
-}
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
-latex_documents = [
- ('index', 'ZenIRCBotAPI.tex', u'ZenIRCBot API Documentation',
- u'Wraithan', 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
-
-# -- Options for manual page output --------------------------------------------
-
-# One entry per manual page. List of tuples
-# (source start file, name, description, authors, manual section).
-man_pages = [
- ('index', 'zenircbotapi', u'ZenIRCBot API Documentation',
- [u'Wraithan'], 1)
-]
-
-# If true, show URL addresses after external links.
-#man_show_urls = False
-
-
-# -- Options for Texinfo output ------------------------------------------------
-
-# Grouping the document tree into Texinfo files. List of tuples
-# (source start file, target name, title, author,
-# dir menu entry, description, category)
-texinfo_documents = [
- ('index', 'ZenIRCBotAPI', u'ZenIRCBot API Documentation',
- u'Wraithan', 'ZenIRCBotAPI', 'One line description of project.',
- 'Miscellaneous'),
-]
-
-# Documents to append as an appendix to all manuals.
-#texinfo_appendices = []
-
-# If false, no module index is generated.
-#texinfo_domain_indices = True
-
-# How to display URL addresses: 'footnote', 'no', or 'inline'.
-#texinfo_show_urls = 'footnote'
-
-import sys
-
class Mock(object):
def __init__(self, *args, **kwargs):
pass
@@ -261,4 +176,4 @@ def __getattr__(self, name):
MOCK_MODULES = ['gevent']
for mod_name in MOCK_MODULES:
- sys.modules[mod_name] = Mock()
+ sys.modules[mod_name] = Mock()
View
@@ -4,30 +4,33 @@
import os
import sys
+setup = None
try:
- from setuptools import setup
+ from setuptools import setup as setuptools
+ setup = setuptools
except ImportError:
- from distutils.core import setup
+ from distutils.core import setup as distutils
+ setup = distutils
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
required = ['redis', 'gevent']
-py_modules = ['zenircbot_api',]
+py_modules = ['zenircbot_api']
setup(
name='zenircbot_api',
version='2.2.4',
description='API for ZenIRCBot',
- long_description=open('README.rst').read() + '\n\n' +
- open('HISTORY.rst').read(),
+ long_description=(open('README.rst').read() + '\n\n' +
+ open('HISTORY.rst').read()),
author='Wraithan (Chris McDonald)',
author_email='xwraithanx@gmail.com',
url='http://zenircbot.rtfd.org/',
py_modules=py_modules,
- package_data={'': ['LICENSE',]},
+ package_data={'': ['LICENSE']},
include_package_data=True,
install_requires=required,
license=open('LICENSE').read(),
View
@@ -7,6 +7,7 @@
monkey.patch_all()
+
def load_config(name):
""" Loads a JSON file and returns an object.
@@ -118,13 +119,12 @@ def registration_reply(message, service, commands):
elif message['data']['message'] == 'services':
self.send_privmsg(message['data']['sender'],
service)
- redis_sub = gevent.spawn(self.non_blocking_redis_subscribe,
- func=registration_reply,
- kwargs={'service': service,
- 'commands': commands})
+ gevent.spawn(self.non_blocking_redis_subscribe,
+ func=registration_reply,
+ kwargs={'service': service, 'commands': commands})
def get_redis_client(self):
""" Get redis client using values from instantiation time."""
return StrictRedis(host=self.host,
port=self.port,
- db=self.db)
+ db=self.db)

0 comments on commit 328e7ab

Please sign in to comment.