Skip to content

Instantly share code, notes, and snippets.

@SpainTrain
Created July 22, 2015 02:51
Show Gist options
  • Save SpainTrain/b5d4689156f0190700ef to your computer and use it in GitHub Desktop.
Save SpainTrain/b5d4689156f0190700ef to your computer and use it in GitHub Desktop.
Add file to `PYTHONPATH` and run as pylint plugin: `pylint --load-plugins gae_pylint_plugin` (See also http://docs.pylint.org/plugins.html)
from astroid import MANAGER
from astroid import scoped_nodes
NDB_PROPERTIES = [
'DateTimeProperty',
'StringProperty',
'KeyProperty',
'StructuredProperty'
]
def register(linter):
pass
def transform(modu):
if modu.name == 'google.appengine.ext.ndb':
for f in NDB_PROPERTIES:
modu.locals[f] = [scoped_nodes.Class(f, None)]
MANAGER.register_transform(scoped_nodes.Module, transform)
@SpainTrain
Copy link
Author

Wrote this to rid my project of no-member pylint errors due to the google app engine python library dynamically mucking with __all__. This is obviously not a full solution, but can be easily extended with other "missing" members.

See also:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment