From f34cedc4b4ce9189390201d22f1a2274609a645c Mon Sep 17 00:00:00 2001 From: SET Date: Wed, 19 Aug 2020 21:24:52 -0300 Subject: [PATCH] Added copyright to all the MCPY files. --- kibot/mcpy/activate.py | 9 ++++++++- kibot/mcpy/core.py | 6 ++++++ kibot/mcpy/importhooks.py | 8 ++++++-- kibot/mcpy/unparse.py | 6 +++++- kibot/mcpy/visitors.py | 7 ++++++- 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/kibot/mcpy/activate.py b/kibot/mcpy/activate.py index 4ce0f254..75e5ab00 100644 --- a/kibot/mcpy/activate.py +++ b/kibot/mcpy/activate.py @@ -1,4 +1,11 @@ -"""Install mcpy hooks to preprocess source files. +# -*- coding: utf-8 -*- +# Copyright (c) 2015 Salvador de la Puente González +# Copyright (c) 2020 Salvador E. Tropea +# Copyright (c) 2020 Instituto Nacional de Tecnología Industrial +# License: MIT +# Project: MCPY https://github.com/delapuente/mcpy +""" +Install mcpy hooks to preprocess source files. Actually, the library monkey-patches SourceFileLoader to compile the code in a different way, providing the macro-expansion for the AST before compiling diff --git a/kibot/mcpy/core.py b/kibot/mcpy/core.py index 462c5bd6..a9b9c002 100644 --- a/kibot/mcpy/core.py +++ b/kibot/mcpy/core.py @@ -1,3 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2015 Salvador de la Puente González +# Copyright (c) 2020 Salvador E. Tropea +# Copyright (c) 2020 Instituto Nacional de Tecnología Industrial +# License: MIT +# Project: MCPY https://github.com/delapuente/mcpy """ Provide the functionality to find and expand macros. """ import sys from ast import Name, copy_location, Import, alias, ImportFrom diff --git a/kibot/mcpy/importhooks.py b/kibot/mcpy/importhooks.py index 091a4784..e688753f 100644 --- a/kibot/mcpy/importhooks.py +++ b/kibot/mcpy/importhooks.py @@ -1,3 +1,7 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2015 Salvador de la Puente González +# License: MIT +# Project: MCPY https://github.com/delapuente/mcpy import ast from .core import find_macros, expand_macros @@ -7,8 +11,8 @@ def nop(*args, **kw): def source_to_xcode(self, data, path, *, _optimize=-1): - '''Intercepts the source to code transformation and expand the macros - before compiling to actual code.''' + """Intercepts the source to code transformation and expand the macros + before compiling to actual code.""" tree = ast.parse(data) module_macro_bindings = find_macros(tree, self.name) expansion = expand_macros(tree, bindings=module_macro_bindings) diff --git a/kibot/mcpy/unparse.py b/kibot/mcpy/unparse.py index 070d619f..a4a03adf 100644 --- a/kibot/mcpy/unparse.py +++ b/kibot/mcpy/unparse.py @@ -1,4 +1,8 @@ -"""Usage: unparse.py """ +# -*- coding: utf-8 -*- +# Copyright (c) 2015 Salvador de la Puente González +# License: MIT +# Project: MCPY https://github.com/delapuente/mcpy +""" Usage: unparse.py """ import sys import ast # import tokenize diff --git a/kibot/mcpy/visitors.py b/kibot/mcpy/visitors.py index 22d73e56..d18f35e7 100644 --- a/kibot/mcpy/visitors.py +++ b/kibot/mcpy/visitors.py @@ -1,4 +1,9 @@ -# from functools import wraps +# -*- coding: utf-8 -*- +# Copyright (c) 2015 Salvador de la Puente González +# Copyright (c) 2020 Salvador E. Tropea +# Copyright (c) 2020 Instituto Nacional de Tecnología Industrial +# License: MIT +# Project: MCPY https://github.com/delapuente/mcpy from ast import NodeTransformer, AST, copy_location, fix_missing_locations, Call, Constant, Name, Expr, Load from .unparse import unparse