Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make cynic py3 compatible #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cynic/handlers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

__author__ = 'Ruslan Spivak <[email protected]>'

from BaseHTTPServer import BaseHTTPRequestHandler
from http.server import BaseHTTPRequestHandler

from cynic.utils import get_stream_logger # do not call at module level

Expand Down
11 changes: 5 additions & 6 deletions cynic/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import select
import signal
import optparse
import StringIO
import ConfigParser
import io
import configparser

from cynic.utils import LOG_UNIX_SOCKET, get_console_logger, get_stream_logger

Expand Down Expand Up @@ -151,7 +151,7 @@ def _reap_children(signum, frame):

def _load_config(fname):
"""Return an instance of ConfigParser."""
config = ConfigParser.ConfigParser()
config = configparser.ConfigParser()
if hasattr(fname, 'readline'):
config.readfp(fname)
else:
Expand Down Expand Up @@ -339,15 +339,14 @@ def main():
options, args = parser.parse_args()

if options.dump:
print DEFAULT_CONFIG
print(DEFAULT_CONFIG)
sys.exit(0)

path = options.config_path
if path is None:
path = StringIO.StringIO(DEFAULT_CONFIG)
path = io.StringIO(DEFAULT_CONFIG)

config = _load_config(path)
handlers = _get_handler_configs(config)
ioloop = IOLoop(handlers)
ioloop.run()

16 changes: 8 additions & 8 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
master_doc = 'index'

# General information about the project.
project = u'cynic'
copyright = u'2012, Ruslan Spivak'
project = 'cynic'
copyright = '2012, Ruslan Spivak'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -183,8 +183,8 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'cynic.tex', u'cynic Documentation',
u'Ruslan Spivak', 'manual'),
('index', 'cynic.tex', 'cynic Documentation',
'Ruslan Spivak', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -213,8 +213,8 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'cynic', u'cynic Documentation',
[u'Ruslan Spivak'], 1)
('index', 'cynic', 'cynic Documentation',
['Ruslan Spivak'], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -227,8 +227,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'cynic', u'cynic Documentation',
u'Ruslan Spivak', 'cynic', 'One line description of project.',
('index', 'cynic', 'cynic Documentation',
'Ruslan Spivak', 'cynic', 'One line description of project.',
'Miscellaneous'),
]

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ def read(*rel_names):
[console_scripts]
cynic = cynic.server:main
""",
classifiers=filter(None, classifiers.split('\n')),
classifiers=[x for x in classifiers.split('\n') if x],
long_description=read('README.rst') + '\n\n' + read('CHANGES.rst'),
)