Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TransformationError: Node type 'Global': Line: 37, column: 4. No transformation for the node #65

Closed
Morsmalleo opened this issue Dec 7, 2021 · 5 comments

Comments

@Morsmalleo
Copy link

Morsmalleo commented Dec 7, 2021

Being given this error when tryin to run python3 -m metapensiero.pj source.py

 TransformationError: Node type 'Global': Line: 37, column: 4. No transformation for the node

Obviously this is being caused by my Python file at line 37, column 4, with "Global", are there anywork arounds for this does anyone know, or is there something I can tweak or add to metapensiero.pj to fix this, PS I am new to metapensiero.pj so go easy :)

  • yes I have named my python file as source.py to keep it simple
  • I have setup metapensiero.pj using this github repository by running the command sudo pip3 install git+https://github.com/metapensiero/metapensiero.pj provided by a user on a seperate issue
  • Getting the error when running python3 -m metapensiero.pj source.py & python3 -m metapensiero.pj -5 source.py
  • Python3 version is 3.9.2
  • Pip version is Python3-pip 20.3.4-4
@azazel75
Copy link
Collaborator

azazel75 commented Dec 8, 2021

Hi @Morsmalleo, could you share the fragment of the code that generates the error?

@Morsmalleo
Copy link
Author

Hi @Morsmalleo, could you share the fragment of the code that generates the error?

I sure can, I'll do that very soon for you :)

@Morsmalleo
Copy link
Author

Hi @Morsmalleo, could you share the fragment of the code that generates the error?

Hi @azazel75 sorry it took me so long but here is the fragment of code you asked for from my source.py file which I have now renamed to file.py

global app_icon, app_name, protect_title, protect_desc, key_pass

@azazel75
Copy link
Collaborator

Unfortunately global declaration isn't something supported right now, anyway if those variables are defined in an outer scope, pj will not redefine them, for example:

$ pj -s -
foo = 'bar'

class Baz:
	def blob(self):
		foo = 1
		other = 2

var foo;
foo = "bar";
class Baz {
    blob() {
        var other;
        foo = 1;
        other = 2;
    }
}

if you don't want any var statement for them you can use from __globals__ import statement, see the readme

@Morsmalleo
Copy link
Author

Thank you for the information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants