import tools/flakes from oslo

Change-Id: Id6d99fe1fd39e8c061f591e9a82058aea9664674
This commit is contained in:
Joe Gordon 2013-01-30 13:26:07 -08:00
parent 77dbed11a6
commit 64ded79907
2 changed files with 5 additions and 12 deletions

View File

@ -1,7 +1,7 @@
[DEFAULT] [DEFAULT]
# The list of modules to copy from openstack-common # The list of modules to copy from openstack-common
modules=cfg,cliutils,context,excutils,eventlet_backdoor,fileutils,gettextutils,importutils,iniparser,jsonutils,local,lockutils,log,network_utils,notifier,plugin,policy,rootwrap,setup,timeutils,rpc,uuidutils,install_venv_common modules=cfg,cliutils,context,excutils,eventlet_backdoor,fileutils,gettextutils,importutils,iniparser,jsonutils,local,lockutils,log,network_utils,notifier,plugin,policy,rootwrap,setup,timeutils,rpc,uuidutils,install_venv_common,flakes
# The base module to hold the copy of openstack.common # The base module to hold the copy of openstack.common
base=nova base=nova

View File

@ -2,21 +2,14 @@
wrapper for pyflakes to ignore gettext based warning: wrapper for pyflakes to ignore gettext based warning:
"undefined name '_'" "undefined name '_'"
From https://bugs.launchpad.net/pyflakes/+bug/844592 Synced in from openstack-common
""" """
import __builtin__
import os
import sys import sys
import pyflakes.checker
from pyflakes.scripts import pyflakes from pyflakes.scripts import pyflakes
if __name__ == "__main__": if __name__ == "__main__":
names = os.environ.get('PYFLAKES_BUILTINS', '_') orig_builtins = set(pyflakes.checker._MAGIC_GLOBALS)
names = [x.strip() for x in names.split(',')] pyflakes.checker._MAGIC_GLOBALS = orig_builtins | set(['_'])
for x in names:
if not hasattr(__builtin__, x):
setattr(__builtin__, x, True)
del names, os, __builtin__
sys.exit(pyflakes.main()) sys.exit(pyflakes.main())