Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
fix minor issues (variables names, string, imported modules)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed May 21, 2015
1 parent 441df0a commit 58179ec
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 12 deletions.
3 changes: 3 additions & 0 deletions _unittests/ut_module/test_flake8.py
Expand Up @@ -7,6 +7,7 @@
import unittest
import re
import flake8
import warnings


try:
Expand Down Expand Up @@ -34,6 +35,8 @@ def test_flake8(self):
OutputPrint=__name__ == "__main__")

if sys.version_info[0] == 2 or "Anaconda" in sys.executable or "condavir" in sys.executable:
warnings.warn(
"skipping test_flake8 because of Python 2 or " + sys.executable)
return

thi = os.path.abspath(os.path.dirname(__file__))
Expand Down
1 change: 0 additions & 1 deletion src/pyquickhelper/helpgen/install_custom.py
Expand Up @@ -3,7 +3,6 @@
@brief Various function to install some application such as `pandoc <http://johnmacfarlane.net/pandoc/>`_.
"""
from __future__ import print_function
import sys
import re
import os

Expand Down
2 changes: 1 addition & 1 deletion src/pyquickhelper/helpgen/install_js_dep.py
Expand Up @@ -33,7 +33,7 @@ def install_javascript_tools(root, dest, fLOG=noLOG,
if not os.path.exists(rev):
try:
import sphinxjp.themes.revealjs
except ImportError as e:
except ImportError:
raise ImportError(
"module sphinxjp.themes.revealjs is needed to get reveal.js javascript files")

Expand Down
2 changes: 0 additions & 2 deletions src/pyquickhelper/helpgen/post_process.py
Expand Up @@ -279,7 +279,6 @@ def post_process_html_output(file, pdf, python, slides):
Parameters *slides* was added.
"""
fold, name = os.path.split(file)
noext = os.path.splitext(name)[0]
if not os.path.exists(file):
raise FileNotFoundError(file)
with open(file, "r", encoding="utf8") as f:
Expand All @@ -305,7 +304,6 @@ def post_process_slides_output(file, pdf, python, slides):
.. versionadded:: 1.1
"""
fold, name = os.path.split(file)
noext = os.path.splitext(name)[0]
if not os.path.exists(file):
raise FileNotFoundError(file)
with open(file, "r", encoding="utf8") as f:
Expand Down
2 changes: 1 addition & 1 deletion src/pyquickhelper/helpgen/sphinx_helper.py
Expand Up @@ -67,7 +67,7 @@ def post_process_html_nb_output_static_file(build, fLOG=noLOG):
# maybe it is Windows and the encoding is sometimes different
with open(full, "r", encoding="cp1252") as g:
try:
content = f.read()
content = g.read()
content = content.replace(
"charset=cp1252", "charset=utf-8")
except UnicodeDecodeError:
Expand Down
2 changes: 1 addition & 1 deletion src/pyquickhelper/ipythonhelper/helper_in_notebook.py
Expand Up @@ -6,7 +6,7 @@
.. versionadded:: 1.1
"""

from IPython.display import Javascript, HTML, display_html
from IPython.display import Javascript, HTML


def store_notebook_path(name="theNotebook"):
Expand Down
4 changes: 2 additions & 2 deletions src/pyquickhelper/jenkinshelper/jenkins_server.py
Expand Up @@ -714,7 +714,7 @@ def setup_jenkins_server(self,
if isinstance(job, tuple):
if len(job) < 2:
raise JenkinsJobException(
"the tuple must contain at least two elements:\nJOB:\n" + str(options))
"the tuple must contain at least two elements:\nJOB:\n" + str(job))

# we extract options if any
if len(job) == 3:
Expand All @@ -725,7 +725,7 @@ def setup_jenkins_server(self,
else:
options = {}

# job and scheduler
# job and scheduler
job, scheduler = job[:2]
if scheduler is not None:
order = 1
Expand Down
1 change: 0 additions & 1 deletion src/pyquickhelper/pycode/call_setup_hook.py
Expand Up @@ -5,7 +5,6 @@
.. versionadded:: 1.1
"""
import os
import sys
from ..loghelper import run_cmd, noLOG
from ..loghelper.flog import get_interpreter_path

Expand Down
4 changes: 2 additions & 2 deletions src/pyquickhelper/pycode/setup_helper.py
Expand Up @@ -272,9 +272,9 @@ def process_standard_options_for_setup(argv,
out, err = call_setup_hook(folder,
project_var_name if module_name is None else module_name,
fLOG=fLOG)
if len(err) > 0:
if len(err) > 0 and err != "no _setup_hook":
raise Exception(
"unable to run _setup_hook\nOUT:\n{0}\nERR:\n{1}".forma(out, err))
"unable to run _setup_hook\nOUT:\n{0}\nERR:\n{1}".format(out, err))
standard_help_for_setup(
file_or_folder, project_var_name, module_name=module_name, extra_ext=extra_ext,
add_htmlhelp=add_htmlhelp)
Expand Down
2 changes: 1 addition & 1 deletion src/pyquickhelper/pycode/utils_tests.py
Expand Up @@ -601,7 +601,7 @@ def run_main():
def tested_module(folder, project_var_name):
# module mod
out, err = call_setup_hook(folder, project_var_name, fLOG=fLOG)
if len(err) > 0:
if len(err) > 0 and err != "no _setup_hook":
raise Exception(
"unable to run _setup_hook\n**OUT:\n{0}\n**ERR:\n{1}\n**FOLDER:\n{2}\n**NAME:\n{3}"
.format(out, err, folder, project_var_name))
Expand Down

0 comments on commit 58179ec

Please sign in to comment.