[BUG ?] Ignition 8.1.0 - _RETARGET_FROM_PROJECT is not set anymore

in Ignition 8.0.16 and before,
when we use system.util.retarget("MyProj")

in the project launched, in the client statup script we was able to use getGlobals
to obtain the source project.

NomProject = system.util.getGlobals()['_RETARGET_FROM_PROJECT']

In 8.1.0, after a retarget the system.util.getGlobals() return an empty map.

@PGriffith
This feature seem to be broken ?

Can you directly access _RETARGET_FROM_PROJECT? It should still be in the true globals map.

how to read the “true” globals map ???

https://docs.python.org/2.7/library/functions.html#globals

If it’s in the actual, Python-standard, globals map (which it should be, that code hasn’t changed) then in both 7.9, 8.0, and 8.1 you should be able to literally just refer to _RETARGET_FROM_PROJECT as a variable anywhere in your script.

globals() return a dictionnary , but there is no key “_RETARGET_FROM_PROJECT” ?
print _RETARGET_FROM_PROJECT return an error varaible is not defined ???

Ooops
I looked for globals inside a function.
Directly in the client startup script globals has a _RETARGET_FROM_PROJECT.

globals()
Return a dictionary representing the current global symbol table. This is always the dictionary of the current module (inside a function or method, this is the module where it is defined, not the module from which it is called).
1 Like