NINJA-IDE

Contents

Module: checker.py API

No description.


Class: Scope(dict)

class Scope(dict):

No description.

Function: __init__() [at ln:120]

def __init__():

No description.


Function: __repr__() [at ln:116]

def __repr__():

No description.


Class: ModuleScope(Scope)

class ModuleScope(Scope):

No description.


Class: Binding(object)

class Binding(object):
Represents the binding of a value to a name.

The checker uses this to keep track of which names have been bound and
which names have not. See L{Assignment} for a special type of binding that
is checked with stricter rules.

@ivar used: pair of (L{Scope}, line-number) indicating the scope and
line number that this binding was last used

Function: __init__(name, source) [at ln:33]

def __init__(name, source):

No description.


Function: __repr__() [at ln:41]

def __repr__():

No description.


Function: __str__() [at ln:38]

def __str__():

No description.


Class: Assignment(Binding)

class Assignment(Binding):
Represents binding a name with an explicit assignment.

The checker will raise warnings for any Assignment that isn't used. Also,
the checker does not consider assignments in tuple/list unpacking to be
Assignments, rather it treats them as simple Bindings.

Class: Checker(object)

class Checker(object):
I check the cleanliness and sanity of Python code.

@ivar _deferredFunctions: Tracking list used by L{deferFunction}. Elements
of the list are two-tuples. The first element is the callable passed
to L{deferFunction}. The second element is a copy of the scope stack
at the time L{deferFunction} was called.

@ivar _deferredAssignments: Similar to C{_deferredFunctions}, but for
callables which are deferred assignment checks.

Function: ASSIGN(node) [at ln:531]

def ASSIGN(node):

No description.


Function: ASSNAME(node) [at ln:488]

def ASSNAME(node):

No description.


Function: CLASS(node) [at ln:473]

def CLASS(node):
Check names used in a class definition, including its decorators, base
classes, and the body of its definition. Additionally, add its name to
the current scope.

Function: FOR(node) [at ln:366]

def FOR(node):
Process bindings for loop variables.

Function: FROM(node) [at ln:542]

def FROM(node):

No description.


Function: FUNCTION(node) [at ln:429]

def FUNCTION(node):

No description.


Function: GLOBAL(node) [at ln:352]

def GLOBAL(node):
Keep track of globals declarations.

Function: IMPORT(node) [at ln:536]

def IMPORT(node):

No description.


Function: LAMBDA(node) [at ln:435]

def LAMBDA(node):

No description.


Function: LISTCOMP(node) [at ln:359]

def LISTCOMP(node):

No description.


Function: NAME(node) [at ln:389]

def NAME(node):
Locate the name in locals / function / globals scopes.

Function: WITH(node) [at ln:336]

def WITH(node):
Handle C{with} by checking the target of the statement (which can be an
identifier, a list or tuple of targets, an attribute, etc) for
undefined names and defining any it adds to the scope and by continuing
to process the suite within the statement.

Function: __init__(tree, filename=str, builtins=None) [at ln:164]

def __init__(tree, filename=str, builtins=None):

No description.


Function: _runDeferred(deferred) [at ln:205]

def _runDeferred(deferred):
Run the callables in C{deferred} using their associated scope stack.

Function: addBinding(lineno, value, reportRedef=True) [at ln:292]

def addBinding(lineno, value, reportRedef=True):
Called when a binding is altered.

- `lineno` is the line of the statement responsible for the change
- `value` is the optional new value, a Binding instance, associated
with the binding; if None, the binding is deleted if it exists.
- if `reportRedef` is True (default), rebinding while unused will be
reported.

Function: check_dead_scopes() [at ln:220]

def check_dead_scopes():
Look at scopes which have been fully examined and report names in them
which were imported but unused.

Function: deferAssignment(callable) [at ln:198]

def deferAssignment(callable):
Schedule an assignment handler to be called just after deferred
function handlers.

Function: deferFunction(callable) [at ln:187]

def deferFunction(callable):
Schedule a function handler to be called just before completion.

This is used for handling function bodies, which must be deferred
because code later in the file might modify the global scope. When
`callable` is called, the scope at the time this is called will be
restored, however it will contain any new bindings added to it.

Function: handleChildren(tree) [at ln:258]

def handleChildren(tree):

No description.


Function: handleNode(node, parent) [at ln:262]

def handleNode(node, parent):

No description.


Function: ignore(node) [at ln:278]

def ignore(node):

No description.


Function: popScope() [at ln:217]

def popScope():

No description.


Function: pushClassScope() [at ln:252]

def pushClassScope():

No description.


Function: pushFunctionScope() [at ln:249]

def pushFunctionScope():

No description.


Function: report(messageClass, *args, **kwargs) [at ln:255]

def report(messageClass, *args, **kwargs):

No description.


Function: scope() [at ln:213]

def scope():

No description.


Class: UnBinding(Binding)

class UnBinding(Binding):
Created by the 'del' operator.

Class: ClassScope(Scope)

class ClassScope(Scope):

No description.


Class: ExportBinding(Binding)

class ExportBinding(Binding):
A binding created by an C{__all__} assignment. If the names in the list
can be determined statically, they will be treated as names for export and
additional checking applied to them.

The only C{__all__} assignment that can be recognized is one which takes
the value of a literal list containing literal strings. For example::

__all__ = ["foo", "bar"]

Names which are imported and not otherwise used but appear in the value of
C{__all__} will not have an unused import warning reported for them.

Function: names() [at ln:101]

def names():
Return a list of the names referenced by this binding.

Class: Importation(Binding)

class Importation(Binding):
A binding created by an import statement.

@ivar fullName: The complete name given to the import statement,
possibly including multiple dotted components.
@type fullName: C{str}

Function: __init__(name, source) [at ln:61]

def __init__(name, source):

No description.


Class: Argument(Binding)

class Argument(Binding):
Represents binding a name as an argument.

Class: FunctionDefinition(Binding)

class FunctionDefinition(Binding):

No description.


Class: FunctionScope(Scope)

class FunctionScope(Scope):
I represent a name scope for a function.

@ivar globals: Names declared 'global' in this function.

Function: __init__() [at ln:134]

def __init__():

No description.

Contents © 2013 NINJA-IDE - Powered by Nikola and Documentor