Skip to content

Commit

Permalink
Merge pull request #119 from orf/patch-1
Browse files Browse the repository at this point in the history
Use the logging module instead of print statements in _generate.py
  • Loading branch information
cfarrow authored Mar 21, 2017
2 parents 0158d7f + d46f6cc commit fff6c8e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions comtypes/client/_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import logging
logger = logging.getLogger(__name__)

__verbose__ = __debug__

if os.name == "ce":
# Windows CE has a hard coded PATH
# XXX Additionally there's an OEM path, plus registry settings.
Expand Down Expand Up @@ -127,8 +125,7 @@ def GetModule(tlib):
else:
return mod
# the module is always regenerated if the import fails
if __verbose__:
print "# Generating comtypes.gen.%s" % modulename
logger.info("# Generating comtypes.gen.%s", modulename)
# determine the Python module name
fullname = _name_module(tlib)
modname = fullname.split(".")[-1]
Expand Down Expand Up @@ -171,8 +168,7 @@ def _CreateWrapper(tlib, pathname=None):
else:
ofi = open(os.path.join(comtypes.client.gen_dir, modname + ".py"), "w")
# XXX use logging!
if __verbose__:
print "# Generating comtypes.gen.%s" % modname
logger.info("# Generating comtypes.gen.%s", modname)
generate_module(tlib, ofi, pathname)

if comtypes.client.gen_dir is None:
Expand Down

0 comments on commit fff6c8e

Please sign in to comment.