Skip to content

Commit

Permalink
Merge c4646a7 into da248ea
Browse files Browse the repository at this point in the history
  • Loading branch information
petr-muller committed May 9, 2018
2 parents da248ea + c4646a7 commit ae8a6e1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
7 changes: 6 additions & 1 deletion pyff/pyff.py
Expand Up @@ -79,6 +79,11 @@ def __init__(self) -> None:
self._methods: int = 0
self._imported_names: Set[str] = set()

@property
def classnames(self) -> Set[str]:
"""Return a set of class names in the module"""
return {cls.name for cls in self.classes}

def visit_ImportFrom(self, node): # pylint: disable=invalid-name
"""Save imported names"""
for name in node.names:
Expand Down Expand Up @@ -114,7 +119,7 @@ def _pyff_classes(first_ast: Module, second_ast: Module) -> Optional[pf.ClassesP
first_walker.visit(first_ast)
second_walker.visit(second_ast)

appeared = second_walker.classes - first_walker.classes
appeared = {cls for cls in second_walker.classes if cls.name not in first_walker.classnames}

return pf.ClassesPyfference(appeared) if appeared else None

Expand Down
1 change: 0 additions & 1 deletion tests/examples/02.new
Expand Up @@ -4,7 +4,6 @@
#
# $ example_quotes 02
# New imported names 'Sequence' from new package 'typing'
# New class 'Game' with 0 public methods
# $

"""Log of a single VtES game"""
Expand Down
1 change: 0 additions & 1 deletion tests/examples/03.new
Expand Up @@ -7,7 +7,6 @@
# New imported names 'Sequence' from new package 'typing'
# New imported names 'Game' from new package 'vtes.game'
# New imported names 'GameStore', 'load_store' from new package 'vtes.store'
# New class 'ParsePlayerAction' derived from imported 'Action' with 0 public methods
# New function 'add_command'
# New function 'games_command'
# Function 'main' changed implementation, newly uses external names 'Path'
Expand Down

0 comments on commit ae8a6e1

Please sign in to comment.