¿ªÔÆÌåÓý

Locked Instance Manager


 

Upgrading from 4.4 to 4.10 breaks the script line:
??? self.panel = jmri.InstanceManager.configureManagerInstance().findInstance(java.lang.Class.forName("jmri.jmrit.display.layoutEditor.LayoutEditor"),0)

with
AttributeError: type object 'jmri.InstanceManager' has no attribute 'configureManagerInstance'

Is there a workaround please?

Nom


 

Nom: On totally unrelated software I had a recent problem when updating from a very old version directly to the latest version. The vendor recommended updating in several smaller steps i.e. 4.4 to 4.6 to 4.8 to 4.10 for example. That worked for me so might be worth a try in your case. Don't? forget too that java needs to be kept up to date. Others know which java version is needed by which jmri version.

Jan


 

There's a new import line I believe you need. Unfortunately I don't recall it, but now you know what to search for.

Also 4.10 has 'issues', so strongly advise to go to 4.12


On Wed, Nov 21, 2018, 19:07 Nom dInet via Groups.Io <nomdinet=[email protected] wrote:

Upgrading from 4.4 to 4.10 breaks the script line:
??? self.panel = jmri.InstanceManager.configureManagerInstance().findInstance(java.lang.Class.forName("jmri.jmrit.display.layoutEditor.LayoutEditor"),0)

with
AttributeError: type object 'jmri.InstanceManager' has no attribute 'configureManagerInstance'

Is there a workaround please?

Nom


 

Norm,

Several issues come to mind:

The most recent production version is 4.12, not 4.10 which had a lot of problems. Perhaps you simply had a typo?

Searching the release notes from through does not turn up any reference to 'jmri.InstanceManager' or to 'configureManagerInstance' but perhaps there was an earlier notification of 'configureManagerInstance' being depreciated and then simply disappearing between those versions.

Without some context as to what problem the quoted line from your script is trying to do, I am not able to figure out how to offer any useful options.

Maybe one of the developers will recognize something that he or she fixed in that time-frame and be able to provide better information. Otherwise, uploading your script to the Problems Being Worked On portion of the Files section would be in order. Be aware that most of us would only work with versions 4.12 or later.

For the sake of sanity, there are no more than one production version and one test version active on this computer at a time. Other group members may have reasons to keep older versions around.

Cliff in Baja SoCal


 

Additional information that I neglected in the previous note:

The documentation found at supplies no clues as to what might or might not have been a 'configureManagerInstance' attribute for that class.

Cliff


 

Nom,

This will return a list of layout editor panels:

lePanels = jmri.InstanceManager.getDefault(jmri.jmrit.display.PanelMenu).getLayoutEditorPanelList()
print "First panel: {}".format(lePanels[0])

Dave Sand

On Nov 21, 2018, at 9:07 PM, Nom dInet via Groups.Io <nomdinet@...> wrote:

Upgrading from 4.4 to 4.10 breaks the script line:
self.panel = jmri.InstanceManager.configureManagerInstance().findInstance(java.lang.Class.forName("jmri.jmrit.display.layoutEditor.LayoutEditor"),0)

with
AttributeError: type object 'jmri.InstanceManager' has no attribute 'configureManagerInstance'

Is there a workaround please?

Nom


 

Replace that line with?

?self.panel = jmri.InstanceManager.getDefault(jmri.ConfigureManager).findInstance(java.lang.Class.forName("jmri.jmrit.display.layoutEditor.LayoutEditor"),0)
?
making sure to keep the same indentation. ?The change is from "configureManagerInstance()" to "getDefault(jmri.ConfigureManager)"

Bob


 

On Thu, Nov 22, 2018 at 07:43 PM, Bob Jacobsen wrote:
self.panel = jmri.InstanceManager.getDefault(jmri.ConfigureManager).findInstance(java.lang.Class.forName("jmri.jmrit.display.layoutEditor.LayoutEditor"),0)
Thanks Bob, that did the trick.? Thanks to all who answered.
Dave Sand, I love the humour.

Nom