Skip to content

Commit

Permalink
sphinxtogithub: python3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
davvid committed Mar 18, 2020
1 parent 0a46518 commit 0db213f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions sphinxtogithub/__init__.py
@@ -1,5 +1,6 @@
"""Script for preparing the html output of the Sphinx documentation system for
github pages. """
from __future__ import absolute_import, division, unicode_literals

VERSION = (1, 1, 0, 'dev')

Expand All @@ -10,7 +11,7 @@
__homepage__ = "http://github.com/michaeljones/sphinx-to-github"
__docformat__ = "restructuredtext"

from sphinxtogithub import (
from .sphinxtogithub import (
setup,
sphinx_extension,
LayoutFactory,
Expand All @@ -26,4 +27,3 @@
OperationsFactory,
HandlerFactory
)

12 changes: 9 additions & 3 deletions sphinxtogithub/sphinxtogithub.py
@@ -1,5 +1,5 @@
#! /usr/bin/env python
from __future__ import absolute_import
from optparse import OptionParser

import os
Expand All @@ -8,6 +8,10 @@
import codecs


def stdout(msg):
sys.stdout.write(msg + '\n')


class DirHelper(object):

def __init__(self, is_dir, list_dir, walk, rmtree):
Expand Down Expand Up @@ -276,12 +280,14 @@ def sphinx_extension(app, exception):

if not app.config.sphinx_to_github:
if app.config.sphinx_to_github_verbose:
print "Sphinx-to-github: Disabled, doing nothing."
stdout("Sphinx-to-github: Disabled, doing nothing.")
return

if exception:
if app.config.sphinx_to_github_verbose:
print "Sphinx-to-github: Exception raised in main build, doing nothing."
msg = ("Sphinx-to-github: "
"Exception raised in main build, doing nothing.")
stdout(msg)
return

dir_helper = DirHelper(
Expand Down

0 comments on commit 0db213f

Please sign in to comment.