-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Its only functionality is currencly a feature to detect newly added 'from package import name' statements.
- Loading branch information
1 parent
7119c84
commit f1c3e47
Showing
7 changed files
with
128 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from argparse import Action, ArgumentParser | ||
|
||
class ParsePlayerAction(Action): | ||
def __init__(self, *args, **kwargs): | ||
Action.__init__(self, *args, **kwargs) | ||
|
||
def __call__(self, parser, namespace, values, option_string=None): | ||
if 2 < len(values) < 7: | ||
setattr(namespace, self.dest, values) | ||
else: | ||
raise ValueError("VtES expects three to six players") | ||
|
||
def main(): | ||
parser = ArgumentParser() | ||
subcommands = parser.add_subparsers() | ||
|
||
add = subcommands.add_parser("add") | ||
add.add_argument("players", action=ParsePlayerAction, nargs='*') | ||
|
||
parser.parse_args() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
def main(): | ||
print("Stuff") | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# pylint: disable=missing-docstring | ||
|
||
from pyff.pyff import pyff_module | ||
|
||
TRIVIAL_MODULE = """import sys | ||
def func(): | ||
pass""" | ||
|
||
IMPORT_MODULE = """import sys | ||
from os import path | ||
def func(): | ||
pass""" | ||
|
||
|
||
def test_trivial_module(): | ||
difference = pyff_module(TRIVIAL_MODULE, TRIVIAL_MODULE) | ||
assert difference is None | ||
|
||
def test_changed_module(): | ||
difference = pyff_module(TRIVIAL_MODULE, IMPORT_MODULE) | ||
assert difference is not None | ||
assert len(difference) == 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters