overviewer_core/__init__: code style fixes
This commit is contained in:
@@ -2,8 +2,6 @@
|
|||||||
# Code to check to make sure c_overviewer is built and working
|
# Code to check to make sure c_overviewer is built and working
|
||||||
#
|
#
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
import os.path
|
import os.path
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
@@ -12,6 +10,7 @@ import sys
|
|||||||
|
|
||||||
from . import util
|
from . import util
|
||||||
|
|
||||||
|
|
||||||
def check_c_overviewer():
|
def check_c_overviewer():
|
||||||
"""Check to make sure c_overviewer works and is up-to-date. Prints
|
"""Check to make sure c_overviewer works and is up-to-date. Prints
|
||||||
out a helpful error and returns 1 if something's wrong, returns 0
|
out a helpful error and returns 1 if something's wrong, returns 0
|
||||||
@@ -24,15 +23,16 @@ def check_c_overviewer():
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
if os.environ.get("OVERVIEWER_DEBUG_IMPORT") == "1":
|
if os.environ.get("OVERVIEWER_DEBUG_IMPORT") == "1":
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
## if this is a frozen windows package, the following error messages about
|
# if this is a frozen windows package, the following error messages about
|
||||||
## building the c_overviewer extension are not appropriate
|
# building the c_overviewer extension are not appropriate
|
||||||
if hasattr(sys, "frozen") and platform.system() == 'Windows':
|
if hasattr(sys, "frozen") and platform.system() == 'Windows':
|
||||||
print("Something has gone wrong importing the c_overviewer extension. Please make sure "
|
print("Something has gone wrong importing the c_overviewer extension. Please make sure "
|
||||||
"the 2008 and 2010 redistributable packages from Microsoft are installed.")
|
"the 2008 and 2010 redistributable packages from Microsoft are installed.")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
## try to find the build extension
|
# try to find the build extension
|
||||||
ext = os.path.join(root_dir, "overviewer_core", "c_overviewer.%s" % ("pyd" if platform.system() == "Windows" else "so"))
|
ext = os.path.join(root_dir, "overviewer_core", "c_overviewer.{}"
|
||||||
|
.format("pyd" if platform.system() == "Windows" else "so"))
|
||||||
if os.path.exists(ext):
|
if os.path.exists(ext):
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
print()
|
print()
|
||||||
@@ -69,6 +69,7 @@ def check_c_overviewer():
|
|||||||
# all good!
|
# all good!
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
# only check the module if we're not setup.py
|
# only check the module if we're not setup.py
|
||||||
if not sys.argv[0].endswith("setup.py"):
|
if not sys.argv[0].endswith("setup.py"):
|
||||||
ret = check_c_overviewer()
|
ret = check_c_overviewer()
|
||||||
|
|||||||
Reference in New Issue
Block a user