Message12081

Author spaceman_spiff
Recipients jeff.allen, spaceman_spiff, stefan.richthofer
Date 2018-08-11.12:29:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1533990554.1.0.56676864532.issue2700@psf.upfronthosting.co.za>
In-reply-to
Content
Hi, you are right - I did mess up the capitalization in my example.
However - if you look in the attached automation.zip you'll see that I have it correct there. Should have copy-pasted. Sorry! :S

Correct should be the following:

Folder TestModule
   __init__.py:
      import test_file
   test_file.py:
      import TestModule
      print( 'TESTPROP: {}'.format(hasattr(testModule, 'TESTPROP')))
      testModule.TESTPROP = 'TEST'
      print( 'TESTPROP: {}'.format(hasattr(testModule, 'TESTPROP')))

ModuleA.py:
   import TestModule

ModuleB.py:
   import ModuleA
   import TestModule



Upon execution of ModuleB I then would expect the output to be (behavior of)
   TESTPROP: 0
   TESTPROP: 1

In my openhab instance it gives me with 2.7.1 this:
   TESTPROP: 0
   TESTPROP: 1

   TESTPROP: 0
   TESTPROP: 1
History
Date User Action Args
2018-08-11 12:29:14spaceman_spiffsetmessageid: <1533990554.1.0.56676864532.issue2700@psf.upfronthosting.co.za>
2018-08-11 12:29:14spaceman_spiffsetrecipients: + spaceman_spiff, jeff.allen, stefan.richthofer
2018-08-11 12:29:13spaceman_spifflinkissue2700 messages
2018-08-11 12:29:13spaceman_spiffcreate